Hacker News new | ask | show | jobs
by indenturedsmile 2534 days ago
I don't have a source, and maybe I'm misremembering, but I think compilers (for software) and CPU production tooling (for hardware) both bootstrap off their own performance.

A better compiler can compile itself more efficiently, same for CPU/chip layout systems.

4 comments

> compilers

Absolutely. Otherwise, all compilers would be written in Assmebly. Most compilers used today are written in C and the compiler for C (GCC) is written in C itself.

The C language was also written by Ken Thomson, because he was unhappy with the BCPL language, so the compiler for C was originally written in B. So on and So forth.

More Recently, the initial compiler for Rust was written in OCaml but is now written in Rust itself.

Slight nit: GCC has been written in C++ (not C) for several years now.
The original version of the C# compiler was written in C and C++, but today's version is indeed itself written in C#!

https://stackoverflow.com/questions/27513234/in-which-langua...

Often, the first bootstrapped is the bare minimum to get basic functionality available, to then build upon what features you can support.

Its been a while, and I think it was gcc 7.x timeframe, and IIRC, you had to have at a min, gcc 4.x available to bootstrap, and it took something like 3 separate bootstrap iterations to get the final compilers was like 4-6 hours if memory serves.

You’re exactly right about this. Of course compilers which compile themselves come with their own risks! https://dl.acm.org/citation.cfm?id=358210
Risks which can be ameliorated: https://dwheeler.com/trusting-trust
This is accurate, but compiler runtime efficiency and compiler effectiveness at producing efficient programs are inherently orthogonal.

There is certainly a major milestone in each new language though, when it becomes feature complete enough to write its own compiler.