3 ms·
Why not write the compiler in Rust, then compile it to assembly, and then use some disassembler/decompiler to compile that back to portable C?
by amelius 2y ago
Why not write the compiler in Rust, then compile it to assembly, and then use some disassembler/decompiler to compile that back to portable C?
- mighmi 2y agoWait, dissemblers will turn assembly into any language you want?
- amelius 2y agoWell, maybe decompiler is a better word. https://reverseengineering.stackexchange.com/questions/3748/converting-assembly-code-to-c https://reverseengineering.stackexchange.com/questions/3748/...
- bluGill 2y agoWell they try. They tend to get lost on x86 where instructions are not fixed length.
- pabs3 2y agoThe article mentions that the Bootstrappable Builds folks don't allow pre-generated code in their processes, they always have to build or bootstrap it from the real source.
- kelnos 2y agoBecause that wouldn't be reasonable to audit. The program that compiles the new Rust compiler, as well as the programs that disassemble and decompile, could insert backdoors or other nefarious behavior into the generated C, in a way that could be difficult to detect. The "ethos" (for lack of a better word) of these bootstrapping projects requires that everything be written by hand, and in a way that can be auditable.