Hi everyone,
I've been thinking about integrating Rust with C# recently, and after noticing it aligns with the roadmap I thought I'd cast the net for thoughts in the community. This is a dump of my thoughts so far:
I'm working on a project to write handlers for a hyper
server in C# as an excuse to work on tooling to integrate Rust into .NET projects. Rust already has good support for exposing a C-like API, and .NET already has good support for consuming one so I see this touching the following areas:
- Building and consuming Rust libraries in a .NET workflow. I've got a simple tool for packing Rust libs for nuget, but proper msbuild integration is probably also worth exploring
- Code generation for FFI structures. I haven't experimented with this yet, but thought a custom derive would be a simple, but maybe surprising, way to dump blittable Rust
struct
s andenum
s as C# types. An external tool that looks at an.rs
file could also work though - Wrapper libraries for translating some common Rust/.NET concepts. Being able to poll a C#
Task
as a RustFuture
would be really neat (but probably quite subtle) - IDE support is already working for VS Code, and VS 2017 shouldn't be far behind.
If anyone is actively integrating Rust with C# or has any thoughts I'd love to hear it