4 ms·
most of them end up self-hosting, but plenty of them are initially written in language that's well geared to building compilers. Rust fe was bootstrapped using
by toolslive 11y ago
most of them end up self-hosting, but plenty of them are initially written in language that's well geared to building compilers. Rust fe was bootstrapped using OCaml to write the first compilers. Smart choice.
- jwdunne 11y agoI believe many lisps do this too. This is where I learned about self-hosting compilers before realising they're pretty much everywhere. I remember looking at the source of a CL impl and thinking "what? It's all in Common Lisp?!" Despite my ignorance, it's pretty common. C compilers tend to be self-hosting from my understanding. It seems like madness to maintain it all in x86 without some justification.
- jwdunne 11y agoTaking another look at SBCL, even the assembler and its code is written in Lisp: https://github.com/sbcl/sbcl/blob/master/src/assembly/x86/arith.lisp https://github.com/sbcl/sbcl/blob/master/src/assembly/x86/ar... Very interesting stuff. In the same repo, you can also see that the compiler is also written in SBCL.
- gmfawcett 11y agoIt's written in ANSI Common Lisp, not in an SBCL dialect: you can bootstrap SBCL with an ANSI CL implementation other than SBCL. IIRC, that was one of the key reasons for the original SBCL/CMUCL split.