Layer 03 · Language

YatsuScript

A scripting language and register-based VM of my own design, written in Rust.

What it is

YatsuScript is a scripting language and bytecode VM I designed myself. I didn't read an existing interpreter's source first: it was the Rust compiler, a text editor, and a lot of terminal print debugging. Small crates like logos handle the lexing plumbing, the language and VM design are mine.

It started as “I wonder how these work” and ended as the hardest thing I’ve built.

Architecture

The core splits into three clear phases:

  • Front end: The lexer and parser turn source code into an AST.
  • Compiler: Optimizes the AST and emits register-based bytecode.
  • VM: Dispatches bytecode on a register machine, with a generational GC and native functions.

Since then

The first version leaked memory: values were allocated and never freed. YatsuScript now has a generational garbage collector, async/await, a language server, and a WebAssembly build that powers the playground.

What I learned

More than any other project: that you don't need to understand everything before you start. I began with zero knowledge of VM design. The Rust compiler catches enough mistakes that you can learn by doing: each compiler error teaches you something real about how computers work at the low level.

If you like compilers, we should talk.