mossprescott / pynand

Nand2Tetris in Python.
Other
12 stars 3 forks source link

Implement a Scheme REPL based on the Ribbit VM #39

Closed mossprescott closed 3 months ago

mossprescott commented 3 months ago

This involved a lot of side projects, including:

mossprescott commented 3 months ago

Current status:

The interpreter largely works, and performance is good enough to call it interactive, provided you used the fast --simulator compiled option, and don't use tracing.

Garbage-collection isn't implemented yet. This will become a priority when the interpreter runs correctly for long enough to fill the heap.

A simple expression like (+ 1 2) can be entered and evaluated. The compiled code looks correct until it tries to call + and then it falls over, so something is not quite right yet.

mossprescott commented 3 months ago

A few bugs have been sorted out, and the getchar/putchar opcodes are now more responsive and support simple line editing.

That's sufficient to make this "usable".

In the REPL, a couple of simple expressions will consume the available memory, so we'll need a garbage collector to make this any more real.

mossprescott commented 3 months ago

Calling this good enough to merge. Planning to add pointer tagging and garbage collection on another branch.