jack

VM translator, compiler and operating system for the Jack language

In progress2024 โ€” ongoing โ†— github โ†— jsr
Jack language software stack
The Jack software hierarchy: VM translator, compiler and operating system

The second half of nand2tetris. With the Hack hardware in place, this project builds the entire software stack on top of it. From a virtual machine down (or up) to an operating system, and a compiler that bridges the two.

Jack is a simple object-based language (think Java without the standard library). Writing the compiler for it means understanding every layer it touches: VM bytecode, Hack assembly, and ultimately binary. I'm currently working on the VM translator parser. The rest is incomplete.

// highlights

  1. VM translator โ€” in progress โ€” Translates Jack VM bytecode into Hack assembly. Currently building the parser. The full spec covers arithmetic, memory segments (local, argument, this, that, static, temp, pointer), branching, and function calls with a recursive call stack.
  2. Jack compiler โ€” pending โ€” Will take .jack source through tokenisation, parsing (recursive descent), and code generation down to VM bytecode. Handles classes, methods, constructors, expressions, arrays, and control flow.
  3. Jack OS โ€” pending โ€” The standard library written in Jack itself: Math, Memory, Screen, Output, Keyboard, String, and Array.

// stack

  • TypeScript
  • Deno