Compiling Rust to readable C with Eurydice

(lwn.net)

38 points | by peter_d_sherman 4 hours ago

3 comments

  • soltanov 47 minutes ago
    Good bridge for legacy embedded targets with zero LLVM support, but aliasing guarantees across the translation layer remain the real pain point.
  • Neywiny 3 hours ago
    I wish this covered more features specific to rust that make it more runtime safer not just compile time safer. I guess by the time it's IR it's the same but moving it back up to C would be nice to see. Like bounds checking.
    • Lvl999Noob 3 hours ago
      I think those are covered. Any checks that Rust adds will be present in the IR (either coded in the original source or implied through rust semantics). Those checks would then get put in the compiled C output. The ideal output of Eurydice would be to have exactly the same semantics and safety as provided by Rust. Since their use case is to use Rust to code on platform without support for a rust compiler, it is a rather important goal to have too.
  • caniload 2 hours ago
    this reads more like karamel-for-rust than a general rust backend, which is probably the right framing. the hard part isn't syntax mapping, it's carrying ownership/borrow info out of mir so the generated c keeps the safety guarantees, and the readable requirement makes sense if the end goal is auditable crypto that drops into existing c codebases without a rust toolchain. curious how it handles the cases where rust and c disagree about aliasing