5 ms·
writing mrustc in C++ seems like such a mistake. It compiles rust to C, so why not write it in rust? then compile itself to C. Another idea, just compile rust
by andrewchambers 8y ago
writing mrustc in C++ seems like such a mistake.
It compiles rust to C, so why not write it in rust? then compile itself to C.
Another idea, just compile rustc to web assembly then use https://github.com/WebAssembly/wabt/tree/master/wasm2c https://github.com/WebAssembly/wabt/tree/master/wasm2c to convert it to your bootstrap source.
- nine_k 8y ago> why not. write it in rust? Exactly to avoid having any rust compilers in the chain.
- mrob 8y agoThere are many Rust compilers in the bootstrap chain. The point is to make every step in the chain human-readable. Auto-generated C is not "source code" in the sense of "the preferred form of the work for making modifications to it" (the GPL's definition of source code). A malicious code generator could hide a trusting trust attack in the generated code in such a way that it would be difficult to find. True source code is easier to audit.