4 ms·
I don’t think it’s possible since you’d need the original compilers from the 70’s and bootstrap other compilers up to a modern one. Otherwise your existing comp
by withinboredom 4y ago
I don’t think it’s possible since you’d need the original compilers from the 70’s and bootstrap other compilers up to a modern one. Otherwise your existing compiler could taint your new one.
- chameco 4y agoIt'd be a fun exercise to write a tiny Forth in machine code (sans assembler) and use it to write enough of a C compiler to build tcc, or something along those lines. From there I think you can chain old (but accessible) gcc versions up to modern gcc.
- chithanh 4y agoNo, you only need two compilers that have not been subverted by the same adversary. https://www.schneier.com/blog/archives/2006/01/countering_trus.html https://www.schneier.com/blog/archives/2006/01/countering_tr...
- withinboredom 4y agoThat’s a good point
- chlorion 4y agoThere are people who spend time trying to solve this issue! https://bootstrappable.org/ https://bootstrappable.org/ https://www.gnu.org/software/mes/ https://www.gnu.org/software/mes/ The idea here, is that if you can get a very basic C compiler, you can start building TinyCC, and eventually build a pre-C++ version of GCC, and from there build up to modern GCC. This is a lot easier said than done of course, but not quite as bad as needing the original compilers from the 70s!
- ectopod 4y agoMany years ago I wrote a C compiler in assembly language. It wasn't hard, and C hasn't changed that much. The complexity in modern compilers is in the optimisation, which you don't need if you're bootstrapping. It's not impossible.
- withinboredom 4y agoA pragmatic approach!