Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Yeah, that’s what I personally do but maintaining the PInvoke interface during development adds a good amount of overhead as things are changing around. It’s also a lot of boilerplate to deal with, and you only notice at runtime that something is wrong. It doesn’t feel like a well integrated solution


If Zig can export C headers, you can easily generate the bindings out of them with CLangSharpPInvokeGenerator.

https://github.com/dotnet/ClangSharp

I strongly caution against WASM suggestions in a sibling comment - I’m not even sure if the author has actually done any C# at all, given how ridiculous it is.


Awesome, thanks for the link, that’s really useful!

WASM is definitely a strange suggestion here, I didn’t take it seriously. I’m already using a C-compatible zig library approach. Some details of the use case here: https://hackertimes.com/item?id=41729059


What is ridiculous in it?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: