Live data from Hacker News

crustc: entirety of `rustc`, translated to C

github.com

21–30 of 99 posts

Re: crustc: entirety of `rustc`, translated to C

#21
this is really cool but it seems very unlikely that someone targeting an exotic system not supported by rust (mostly embedded and ancient mainframe targets) would be willing to trust a beta transpiler to not inject any bugs or leaks in the process of turning rust to c. nevertheless, very cool.

Re: crustc: entirety of `rustc`, translated to C

#22
post #8

Have you tried Diverse Double-Compiling (DDC) to test if the official rust compiler has a backdoor? Use crustc to compile the rust source code, producing a new compiler. Then use this new compiler and the official rustc binary, both with deterministic flags, to compile the rust source code again. The two outputs should match bit for bit.

Awesome idea!

Re: crustc: entirety of `rustc`, translated to C

#23
post #7

> For the past 3 years, I have been working on compiling Rust to C. .. This is, by my count, the 14th attempt: cilly Gotta respect the dedication to a niche interest. > The primary goal of this is support for old/obscure hardware with no LLVM/GCC support. I remember reading about the bootstrapping question, how it typically requires a Rust compiler to build the Rust compiler from source. https://bootstrapping.mirahez…

Guix uses mrustc for bootstrapping Rust, as required for compiler packages; it's a really impressive project and has worked well in that role for some time. This new project is interesting for other reasons though, because mrustc is targeted at the de fact "subset" of Rust in use by rustc at any given time. This looks like it could have broader applications, like compiling Rust programs for platforms not supported by LLVM. If it really targets ANSI C (C89 or so), that's potentially many more platforms than are possible with ordinary rustc

More on the Rust bootstrapping process (2018): https://guix.gnu.org/blog/2018/bootstrapping-rust/

Re: crustc: entirety of `rustc`, translated to C

#25

This could be used within https://bootstrappable.org/projects.html to make bootstrappability of rust incredibly much easier other than the previous route of OCaml and other things. I know some folks within the bootstrappable OS projects community are on Hackernews and I hope that they could take a look at this. I feel as if this project could drastically shrink down the efforts needed to get a working rust compiler i…

mrustc (a handwritten Rust compiler in C++) is already used for that in Guix and likely other distros: https://guix.gnu.org/blog/2018/bootstrapping-rust/ This would have other benefits though, as it's both a second bootstrapping path and could potentially compile Rust programs for platforms not supported by LLVM

Re: crustc: entirety of `rustc`, translated to C

#26
post #3

> I put my left hand in a blender. The blender won. (Still have all my fingers, just some stitches). I will not elaborate further. What a shame. I would've read an article about this.

I mean I get confused every time I use blender too but not to the point of losing fingers...

Re: crustc: entirety of `rustc`, translated to C

#27
post #8

Have you tried Diverse Double-Compiling (DDC) to test if the official rust compiler has a backdoor? Use crustc to compile the rust source code, producing a new compiler. Then use this new compiler and the official rustc binary, both with deterministic flags, to compile the rust source code again. The two outputs should match bit for bit.

This reminds me of https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_Ref...

Re: crustc: entirety of `rustc`, translated to C

#30
post #8

Have you tried Diverse Double-Compiling (DDC) to test if the official rust compiler has a backdoor? Use crustc to compile the rust source code, producing a new compiler. Then use this new compiler and the official rustc binary, both with deterministic flags, to compile the rust source code again. The two outputs should match bit for bit.

This was done with mrustc, which produced byte identical output.
Post reply on HN