A generalized toy virtual machine, assembler, debugger/ UI written in python. Intended as just a fun time waster over a few weekends for myself, and also somehow we dragged in @zayfod into this too, but maybe there is some educational value to others?
- Keeping things simple, illustrating basic ideas behind classical computing, emulation and VMs
- Modular way to define architecture/ VMs
- Allows for definition of custom assembly sytaxes
- Swapping/ extending instruction sets
- VMs currently in project
- Toy VM (Completed) ✔️
- Brainfuck (Completed) ✔️
- F4 MISc (Completed) ✔️
- 8 bit PIC (In progress)
It's all virtual machines in virtual machins in virtual machines ... and soon Transformer models infrencing the output of virtual machines ... - Probaly someone
Writing a VM in a language that runs in a VM and has no business having a VM written in ! Possibly educational for someone ? If you grew up learning to code in the 90's you get it.
Clone repo
Install python 3.13
Install uv
(Optional):
pip install uv
Install deps:
Setup virtual env., and install deps. (Uses uv
)
make dev_build_env
or
uv pip install -r requirements.txt
or
pip install -r requirements.txt
Load with only default "Toy VM" virtual machine:
python main.py
Load with addition virtual machines define in python modules:
python main.py 8_bit_pic f4_misc brainfuck
or you can pass-in the same arch. module multiple times to get more than one instance of the same VM type
python main.py toy_vm toy_vm
Load with debug logging, first arg. must be --debug
python main.py --debug toy_vm toy_vm
All check/ auto-fixes:
make check-all
Lint:
make lint
or
ruff check
Format:
make format
or
ruff format
Type checks:
make type-check
or
pyright .