Close

Entry 6: Is the Grass Greener?

A project log for Lua2e

LUA before Lua: a self-hosting compiler on the Apple //e

jorj-bauerJorj Bauer • 09/29/2026 at 01:52•0 Comments

This virtual machine of Ms. Albright's is not packaged like UCSD's, but in spirit it is the same animal: a stack machine with byte-coded instructions - one opcode plus inline operands; locals addressed by slot rather than by name; one constant pool per code unit, referenced by index; conditional jump on a popped boolean; 16-bit integer math.

Where it differs is more interesting, and some of it is ambition while other parts are just immaturity:

And then there is this one comment in the file, which shapes my opinion of everything that follows.

            VPUSHB 11         ; apple home()

She's fundamentally calling the Apple ][ specific functionality a library.  On the first weekend that her virtual machine exists; with no actual language for this to be a library in. There is no opcode in her instruction set that knows what an Apple is. Everything that touches the hardware, the text page, the keyboard strobe, the monitor'sHOME, sits behind a numbered call. Three of them at this point: poke is 1, key is 10, home is 11.

Everything on this drive that impressed me later is telegraphed by that one comment, and we will come back to it in a few years of Ms. Albright's time.

Discussions