solid-snake-vm
The register-based bytecode VM: instruction set, encoding, execution, a heap with reference counting, and the builtin functions.
A low level, modular bytecode, finite register VM focused on safety and extensibility, with plans for a Python like, statically typed language on top.
A statically typed, Python-flavored language with Rust-inspired guarantees, and the register-based bytecode VM it compiles to. The idea is a language that reads like Python but does not let you shoot yourself in the foot, running on a small hardened VM that stays boring and predictable underneath.
The name is a Metal Gear Solid nod. There is no stealth action here, just a VM that tries not to mess around.
You can try it in the browser. The web demo compiles and runs Solid Snake in a sandboxed wasm build, with the example programs one click away. No install.
The language is real and runs end to end:
if, while, for, and the usual arithmetic over Int, Float, Bool, and String.extend blocks.match as both a statement and an expression, with exhaustiveness checking.Result, Option, and the ? operator, all in the prelude.for over a shared iterator protocol.The prelude is library code written in the language itself. Only the syntax that needs compiler support lives in Rust.
cargo run -p solid-snake-compiler -- path/to/program.ss
Or a snippet inline:
cargo run -p solid-snake-compiler -- -c 'let x = 2 + 3
print(x)'
The VM is register based and deliberately small. Values are raw u64 interpreted per instruction, with no global runtime typing. Memory is segment-indexed and every access is bounds checked. Calls follow a fixed convention, R0 for the return value and R1 upward for arguments, over a sliding frame stack.
Types and safety are the compiler’s job. The VM stays a plain, checkable execution layer, which also keeps a future native or C compilation target on the table.
The register-based bytecode VM: instruction set, encoding, execution, a heap with reference counting, and the builtin functions.
The language front end and code generator: lexer, parser, type checking, monomorphization, IR, and bytecode generation.
A wasm build for running in the browser, sandboxed away from the real machine, so a program can never touch the actual filesystem or network.
Early but real. The language runs, the test suite is green, and the near-term direction is file and network I/O toward a self-hosted small web server.