Eurydice compiles Rust into clean, readable C code
Compiling Rust to readable C with Eurydice
Eurydice, part of the Aeneas project, converts Rust into C while preserving code structure, unlike rustc's LLVM output. It targets high-assurance software where verification tools expect C. The tool handles generics and dynamically sized types, though it currently works best for small, self-contained programs. It has been used for post-quantum cryptography routines.
Whether this C code counts as "readable" is probably a matter of individual taste.
- weinzierl
I highly recommend checking out the other projects from AeneasVerif
(and Jonathan Protzenko).
Scylla is kind of Eurydice's dual. But also Charon and the eponymous Aeneas.
Also,
"There is ongoing work to integrate Eurydice-generated code for both Microsoft and Google’s respective crypto libraries." [1]
which I find incredibly cool. This link is also a brilliant intro to Eurydice.
- nlehuen
> readable C
> return uu____0;
If readability is the selling point, why not go the extra millimeter and add a heuristic so that this variable is named return_value for instance?
- stabbles
If it's readable C, this sounds great for a full source bootstrap of the rust compiler.
- Neywiny
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.
- chias
What an excellent choice of product name :D
"You're da C"