4 ms·
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
by LeFantome 4y ago
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.
- School-Cotton 4y agoExposing a C interface from rust is possible, but a bit of a pain.
- gwbas1c 4y agoIn programming, never make an assumption that something is "easy." https://news.ycombinator.com/item?id=35701181 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.