A Lua compiler that emits x86
ArchivedTokeniser, recursive-descent parser, symbol table and code generator, written in Swift, producing assembly that runs.
866 lines of Swift taking Lua source to 32-bit x86 NASM: a tokeniser, a recursive-descent parser written against a documented EBNF, a symbol table tracking stack offsets, and a code generator.
The generated assembly does real work rather than toy work. It allocates locals on the stack, resolves identifiers to offsets, and emits the control flow for conditionals and loops as labels and jumps.
Swift is an unusual choice and was not the sensible one. I picked it because I wanted to know how the language behaved away from application code, and a compiler is a good way to find out: it is all value types, recursion and exhaustive switches over an enum, which is the part of Swift that either holds up or does not.