Lucas Girouard-Stranks
Lucas Girouard-Stranks
Auto-generated bindings can be quite large as seen here: https://github.com/flecs-hub/flecs-cs/pull/5. I would like to explore how to reduce the Git diff noise.
Zig
TODO: - Add minimal sample of using Zig library from C#. BOCKED BY: - https://github.com/ziglang/zig/issues/6753; need to emit the C header to generate C# bindings.
Look into `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/objc/NSObject.h` and see if `libclang` can parse it. If yes, then next is can C2CS leverage `libclang` to some how generate C# bindings for ObjectiveC code.
Group C# syntax nodes into regions with the file name of the header file. This increases visibility into navigating the `.cs` file using an IDE like Rider or plugins to...
- Use `ref` for pointers where necessary.
Use `MarshalAs` attribute for strings, arrays, etc. Don't use `CString` in this case in bindgen. See Microsoft docs for an example tutorial: https://learn.microsoft.com/en-us/dotnet/standard/native-interop/tutorial-custom-marshaller?source=recommendations.
Use case: https://partner.steamgames.com/doc/sdk Steamworks SDK provides a C header for exposing function names; all good. Problem is that the transitive types used in functions have C++. ``` libclang: Parsing './ext/steam/steam_api_flat.h'...
Found when generating bindings for flecs: https://github.com/SanderMertens/flecs ```c /* Append format string with argument list to a buffer. * Returns false when max is reached, true when there is still...
Since extracting the abstract syntax tree of a header file is now de-coupled in it's own step using `ast` it is now possible to think about the possibility of generating...