Jose Gibson
← All Projects

Nand2Tetris Web IDE & Compiler Suite

Full Nand2Tetris compiler suite and browser IDE that compiles Jack through VM, assembly, and Hack machine code, with an integrated VM emulator.

ReactTypeScriptPythonFlaskJackAssemblerVM Emulator

Outcomes

  • 100% pass rate on the Nand2Tetris test suite for Assembler, VM Translator, and Compiler
  • Modular two-pass compiler with decoupled tokenizer, parser, and code generator
  • Live web tool deployed on Render with integrated browser VM emulator

Portfolio Highlights

  • Built a web IDE and compiler suite for Nand2Tetris, compiling Jack to VM, assembly, and Hack binary with an integrated browser VM emulator.
  • Engineered a modular, two-pass compilation architecture that handles complex scoping and symbol table management with 100% accuracy.
  • Mastered the complete computer hierarchy, from logic gates to high-level object-oriented programming, reinforcing a "First-Principles" approach to systems engineering.

Snapshot

  • Period: November 2025
  • Domain: Compiler Design / Computer Architecture
  • Tech Stack: React, TypeScript, Python (Flask), Jack VM, Assembler
  • Full-Cycle Engineering: Architected the entire software stack from logic gates to a high-level compiler, ensuring a deep understanding of the "no black boxes" philosophy.
  • Status: Deployed Web Tool

The Business Problem

To be a truly effective Systems Engineer, one must understand the layers of abstraction that modern software sits upon. Many developers operate only at the high-level, leading to architectural blindness when low-level performance bottlenecks or hardware constraints arise. This project was a rigorous exercise in "First-Principles Thinking" to master the full computer stack.

Technical Deep Dive: Two-Pass Compilation & Symbol Tables

The hardest technical challenge was implementing a robust compiler for Jack, an object-oriented language.

The Solution:

I engineered a modular Two-Pass Compiler:

  1. 1.Pass 1 (Lexical & Syntax Analysis): Decouples tokenization from parsing to build a comprehensive Symbol Table that handles forward references and scope (class vs. subroutine).
  2. 2.Pass 2 (Code Generation): Translates the high-level syntax into VM instructions, which are then further lowered into assembly and machine code.

This architecture ensures that the compiler is not just a "black box" that outputs text, but a structured engine that understands the semantics of the language.

Evaluation & Metrics

  • Correctness: 100% pass rate on the Nand2Tetris test suite for Assembler, VM Translator, and Compiler.
  • Modularity: Successfully decoupled the tokenizer, parser, and code generator, allowing for isolated unit testing of each compilation phase.
  • Deployment: Live web tool hosted on Render, featuring an integrated VM emulator that runs generated code directly in the browser.

Key Decisions & Trade-offs

  • Python vs. TypeScript: Originally built the assembler in Python for rapid logic prototyping, then ported critical components to TypeScript to leverage strict typing and browser-side execution for the web IDE.
  • API-First Design: Built the compiler logic behind a Flask API to ensure it could be used both as a web service and a standalone CLI tool, demonstrating a commitment to versatile software architecture.

Development Timeline

  1. **The Foundation:** This project represents my transition from a Mechanical Engineer to a Systems Engineer. By building the computer from the NAND gate up, I gained the hardware-level intuition that now informs my work in Embedded AI and IoT.
  2. **Rigor:** Every layer was hand-built without the use of compiler-generators (like Lex/Yacc), ensuring that my understanding of lexical analysis and code generation is fundamental and grounded.