3 ms·
The idea of bootstrapping is that you start with nothing, or at least with almost nothing. In case of stage0 (the first stage of live-bootstrap) this a small pr
by fjfaase 9mo ago
The idea of bootstrapping is that you start with nothing, or at least with almost nothing. In case of stage0 (the first stage of live-bootstrap) this a small program that converts a file with hexadecimal characters (in pairs) to a binary file. From there you have to build everything. To compile Rust, you need a Rust or C compiler, I understand. I have no idea how hard it would be to build a minimal Rust compiler that could compile itself, one that not necessary performs all the checks that the (full) Rust compiler would do.
I think that Rust is build as part of live-bootstrap, but at a much later stage when the latest version of the GNU C compiler has been build.
- csb6 9mo agoThere was a project [0] to write a bare bones rust compiler (no borrow checking) in C that aims to be able to build rustc in order to simplify bootstrapping, but it seems to have stalled. [0] https://notgull.net/announcing-dozer/ https://notgull.net/announcing-dozer/
- steveklabnik 9mo agoYou would get a C++ compiler going and then build mrustc and then use that to build rustc and then use that to build the version of rustc you want.
- fjfaase 9mo agoThe latest version of g++ is written in C++. If I am not mistaken g++ 4.7.4 is the oldest version that is written in C. But it does not support the C++ version in which the latest version of g++ is written. For that you have to compile g++ 10.4.0 first. And g++ 4.7.4 cannot be compiled by the Tiny C Compiler (tcc). The total chain then becomes: tcc 0.9.26 → tcc 0.9.27 → gcc 4.0.4 → g++ 4.7.4 → g++ 10.4.0 → g++ 13.1.0