from Hacker News

Rust to .NET compiler – Progress update

by sbt567 on 5/4/24, 12:51 AM with 16 comments

  • by Alupis on 5/4/24, 1:00 AM

    I'm curious of the utility of writing Rust code but wanting to run it on the CLR.

    If anything, a GraalVM target would make more sense, as it's already gaining traction for this type of thing (although, usually interpreted langs like python, ruby, etc). Even there, the utility of running Rust on a JVM target also seems dubious.

    TFA doesn't mention an intended use-case. Perhaps it's an academic endeavor?

  • by megadal on 5/4/24, 1:07 AM

    How is this is more useful than just compiling Rust into a dll and using that, or better, writing some framework or tooling that automates the process of marshaling/unmarshaling data for a Rust dll?

    A .NET target for Rust just makes no real sense to me given Rust is basically already interoperable with .NET (or rather .NET is already interoperable with unmanaged native code, which Rust can generate)

  • by withinrafael on 5/4/24, 1:24 AM

    The author answers the "why" in the FAQ https://github.com/FractalFir/rustc_codegen_clr?tab=readme-o.... I didn't find it very convincing but I'm sure the author will learn a lot of neat things along the way.
  • by jjtheblunt on 5/4/24, 1:29 AM

    Can’t one compile Rust to WASM, and use Blazor for .NET to WASM, so end up with both in the WASM world?