Live data from Hacker News

crustc: entirety of `rustc`, translated to C

github.com

51–60 of 99 posts

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

#51

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…

Not really. This C code is more like a binary and compiler artifact than a source code. So it won't match the standards of bootstrap.

Depending on what your goal is. If it is eliminating trusting trust attacks, yes this is no enough. But more commonly you only want to compile rustc for a platform it was never compiled on, and for that this project is definitely enough.

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

#53
> The primary goal of this is support for old/obscure hardware with no LLVM/GCC support

Wouldn't it be easier to add old hardware support to LLVM/GCC instead? I adore the project scale and determination, but for this goal extending existing projects seems more logical than building a language translator.

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

#54

> The primary goal of this is support for old/obscure hardware with no LLVM/GCC support Wouldn't it be easier to add old hardware support to LLVM/GCC instead? I adore the project scale and determination, but for this goal extending existing projects seems more logical than building a language translator.

Some architecture lacks documentation, if you have a working C compiler, it's easier to use it than working on a compiler to target it.

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

#55
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.

It's not diverse in that case - it's the same compiler source compiled to binaries twice - it's just that with one compiler you've gone via a C intermediate representation. For the purposes of diversity it's the same as compiling rustc with the cranelift/gcc backend.

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

#56
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.

Nobody who would code this up would be entirely sane. But I can't help thinking "these are my people" when I read this...

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

#57

> The primary goal of this is support for old/obscure hardware with no LLVM/GCC support Wouldn't it be easier to add old hardware support to LLVM/GCC instead? I adore the project scale and determination, but for this goal extending existing projects seems more logical than building a language translator.

> Wouldn't it be easier to add old hardware support to LLVM/GCC instead?

No, in fact it's much, much harded. You have no idea of the scope. I have no idea of the scope. Nobody does. There are obscure machines we've never heard about and there are C compilers for them. Targeting and supporting them from modern toolchains is a fool's errand.

Post reply on HN