@velartrill
They use C++ impl to bootstrap it: https://github.com/thepowersgang/mrustc Rust needs more impls like other langs have. Writing "reference" impl in not itself would be hypocrisy 😃
@velartrill
Why are most languages self hosted then? C compilers are also self hosted. What are the downsides apart from secure bootstrapping needing another impl?
@velartrill
"Many programming languages have self-hosted implementations: compilers that are both in and for the same language. Such languages include Ada, BASIC, C, C++[5], C#[6], ClojureScript[7], CoffeeScript, Crystal, D, Dylan, F#, FASM, Forth, Gambas, Go, Haskell, HolyC, Java, Lisp, Modula-2, OCaml, Oberon, Pascal, Python, Rust, Scala, Smalltalk, TypeScript, Vala, and Visual Basic."
@velartrill
"In some of these cases, the initial implementation was not self-hosted, but rather, written in another language (or even in machine language); in other cases, the initial implementation was developed using bootstrapping."
@velartrill
I get that there are theoretical concerns. The fact that "\n" value is nowhere to be found in rustc source is concerning. But as you noted, rustc is generating LLVM IR and not binary directly so you can inspect it there. Also you just need one other capable impl in already portable language to break the chain (even if you don't call it bootstrapping any more).
@velartrill
I guess having X written in X helps with development as you only need to know one language very well to develop it (less cognitive load?). And any advancement in your language reinforces your ability to further develop it. Rust was created to address problems with C++. Also first compiler was created in ML for a reason.
For what I know portability issues are mostly to do with LLVM missing support... if you have any links, I would like to learn more.
@velartrill
According to this https://doc.rust-lang.org/nightly/rustc/platform-support.html
the compiler runs on MIPS, PowerPC, RISC-V, SPARK and some other architectures.
@velartrill
Do you think there is a conspiracy there?
@velartrill
Sorry. I did not run rustc on other archs than x86_64 and aarch64 but I see no reason why they would be providing false information in the official documentation.
@velartrill
So perfect bootstrapping would be: punch cards -> ASM -> C -> C++ -> Rust? :D