Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The easiest example: an interpreter for the Subleq VM. One instruction. Literal three or four lines, three more (if any) for I/O.

https://github.com/howerj/subleq/

As a goodie you can run Eforth on top which almost writtes itself. Compiler, interpreter, editor, IDE and a Sokoban, all in a simple VM.

Let's scale. Mu808/n808. Interpreters in C and AWK, a compiler in Python.

https://codeberg.org/luxferre/n808

You have the exact assembly algorithm in the page. What you see it's what you get. Now, for real, I'd suggest getting lvltl (VTL-02) interpreter written in C for a "bigger" language running not just under a VM, but for small machines and simulators such as the 6502 based Kim-1 and Apple1. With that "not enough to be called Basic" a Sokoban might be written with a bit of patience.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: