← Back to context

Comment by nathell

7 years ago

I have attempted following Ghuloum's paper, too. One difference is I wanted to make it as self-contained as possible and didn't want to depend on a C compiler or binutils. So I wrote a simple assembler. Here it is, all in Clojure:

https://github.com/nathell/lithium

It's dormant – I was stuck on implementing environments around step 7 of 24 – but someday I will return to it and make progress.

When I went over the tiger book back at the university, our teacher had a cool approach to overcome that.

Generate bytecode, but in a form that could be easily mapped to macros on a Macro Assembler, thus we only needed to write such macros for each target platform.

From performance point of view it was quite bad, but we got complete AOT static binaries out of it anyway.