Making space for closures
Skate implements lexical closures using heap binding records and pointers. Following a small adder example shows how those bindings survive a procedure call on a Z80.
John Hardy’s engineering notebook
Current bench Atom · Z80 systems · AI and authorship
Skate implements lexical closures using heap binding records and pointers. Following a small adder example shows how those bindings survive a procedure call on a Z80.
Skate divides its small heap into 256-byte pages. Pairs, bindings, closures, strings and vectors can then share the available memory without fixed reservations for each type.
Skate reclaims list pairs that a running program can no longer reach. Its collector traces from live roots, keeps reachable pairs and returns the rest to the free list.
Skate brings compiled Scheme to Z80/CP/M. Providing automatic memory management on a small machine means balancing runtime size, data capacity and processing time.
Skate’s design balances useful Scheme features against the memory and processing limits of Z80/CP/M. Some features remain central; others sit outside the scope of the first version.
I’m building Skate, a Scheme compiler for the Z80 running CP/M. Examples from Structure and Interpretation of Computer Programs provide a test of how much we can retain while leaving enough memory to run useful programs.
I’m building Skate, a Scheme compiler for Z80/CP/M. I’ll release the implementation in stages and explore how to make its expressive style of programming practical on a small machine.