Bootstrapping Specific Languages
The golang compiler is implemented in golang. It was originally in C, but they semi-automatically translated it into go: GopherCon 2014 Go from C to Go by Russ Cox. But gcc has it's own implementation of go too! gcc-go lets you compile the golang implementation of go. So you can bootstrap go from the gcc platform.
This is not done yet in Guix.
- According to https://golang.org/doc/install/gccgo, gccgo-4.8.2 includes a
- complete go-1.1.2 implementation, gccgo-4.9 includes a complete go-1.2
- implementation, and gccgo-5 a complete implementation of go-1.4. Ultimately
- we hope to build go-1.5+ with a bootstrap process using gccgo-5. As of
- go-1.5, go cannot be bootstrapped without go-1.4, so we need to use go-1.4 or
- gccgo-5. Mips is not officially supported, but it should work if it is
The rust compiler is implemented in rust, each version is used to compile the next version **The train model**.
- This file describes the stage0 compiler that's used to then bootstrap the Rust
- compiler itself. For the rustbuild build system, this also describes the
- relevant Cargo revision that we're using.
- Currently Rust always bootstraps from the previous stable release, and in our
- train model this means that the master branch bootstraps from beta, beta
- bootstraps from current stable, and stable bootstraps from the previous stable
- If you're looking at this file on the master branch, you'll likely see that
- rustc and cargo are configured to `beta`, whereas if you're looking at a
- source tarball for a stable release you'll likely see `1.x.0` for rustc and
- `0.x.0` for Cargo where they were released on `date`.
Fortunately there is a rust compiler implemented in C++ that is able to bootstrap rust.
This project is an attempt at creating a simple rust compiler in C++, with the ultimate goal of being a separate re-implementation.
mrustc works by comping assumed-valid rust code (i.e. without borrow checking) into a high-level assembly (currently using C, but LLVM/cretonne or even direct machine code could work) and getting an external code generator to turn that into optimised machine code. This works because the borrow checker doesn't have any impact on the generated code, just in checking that the code would be valid.
mrustc is packaged inside guix but building rustc is still done off an initial binary seed and from then on using the train model.
UPDATE: rustc has been bootstrapped off of mrustc in guix!
Lisp interpreters are relatively easy to write in assembly or C, the primary issue is macros. To properly implement macros in lisp, you have two options: 1) Implement lazy evaluation on top of eager evaluation (can get very ugly) or 2) Implement a lazy lisp (a boatload of work) and simply use straight lambdas to provide macro functionality
- bootstrappable lisp/scheme compilers**: guile scheme, mes, tarot, tinyscheme, scheme_interpreter.
- non bootstrappable lisp/scheme compilers**: chez scheme, racket scheme, (almost all).
FORTH interpreters are far easier to write in assembly than they are to write in any other (non-functional) language. The biggest issue ends up being what FORTH standard to follow and finding programmers willing to use/improve your FORTH.
Contrary to what you would expect, it actually ends up being far easier to implement as Macro-assembler than it is to implement an assembler without Macros. This is especially true when it comes to the easiest form of Macros, line macros.