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

It is really simple to call into native code from C# ( .NET ). While I have not done this with Rust specifically, presenting a C compatible interface from Rust should work fine.


In programming, never make an assumption that something is "easy."

https://news.ycombinator.com/item?id=35701181 did just that and explained the results.

Personally, I find PInvoke time consuming; and often time a lot of people screw it up.

I'm not sure how I'd translate things like lifetimes and ownership into C#: The language just doesn't have those concepts.

Lifetimes might make sense as IDisposable, but that could get tedious. I'd be tempted for types that are just "memory" to have finalizers.

Ownership may require some kind of locking wrapper.


Exposing a C interface from rust is possible, but a bit of a pain.




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

Search: