Mini-Lua compiler in JavaScript


#1

Project URL: http://hyperweb.space/#!/project/shag-legs

This is a compiler, using a hand-rolled lexer, recursive-descent parser, and x86 assembly generator. It compiles a very small subset of Lua to very basic x86 assembly.

I wrote this compiler for a Tech Talk called “Writing a Compiler in HyperWeb in 30 Minutes”. It took almost 90 minutes. Estimates are hard.

(If you want to start from the beginning of the Tech Talk, use the [blank compiler project] (http://hyperweb.space/#!/project/lime-soarer))


#2

Shag legs? WTF?!

(If you want to start from the beginning of the Tech Talk, use the blank compiler project2)

Is this talk available somewhere?


#3

I think https://fogcreek.wistia.com/medias/jlmycl67ty is it


#4

I’m sure you saw, but this project is now featured on the HyperDev blog https://hyperdev.com/blog/how-to-write-a-compiler-in-javascript-and-hyperdev/


#5

Moved to http://minilua.glitch.me/