
Bcompiler – Bootstrapping a simple compiler from nothing (2002) - adg001
http://rano.org/bcompiler.html
======
vidarh
My first compiler wasn't bootstrapped in nearly that extreme fashion.

I started with an assembler, and the first version was written in M68k
assembly and was very simple:

It supported pretty much function calls with no arguments, and function
definitions, and inline M68k assembly and that it for the first iteration.
Then I "rewrote" the compiler using those facilities, and iterated, adding
support for variables, function arguments, etc.. Over time I had a relatively
decent object oriented language.

One of the "fun" parts of the language was that you could use M68k registers
in any expression (with some caveats about having to avoid the ones the
compiler used). So you might have things like "foo := D0.w + bar" where foo
and bar where regular variables, and D0.w indicated 16 bits of the D0
register.

I spent a lot of time in high-school working on it on paper during breaks (if
you want to come across as a geek, spending breaks reading piles of assembly
printouts works wonders), and occasionally lessons.

------
CarolineW
This doesn't scroll vertically on the Blackberry browser. You have to sweep
right to find the special scroll bar, click on that (hoping you don't miss),
and then sweep back left to read the new text. A few iterations and I gave up.
Maybe I'll read it later, maybe not, but the page is, for me, a usability
disaster.

Designers - please consider using widely tested techniques and systems so you
are at least aware of the people you exclude.

~~~
gosub
the whole page is an iframe for this:
[http://homepage.ntlworld.com/edmund.grimley-
evans/bcompiler....](http://homepage.ntlworld.com/edmund.grimley-
evans/bcompiler.html)

------
_almosnow
Awesome post. Can't wait to try something similar.

