Menu
Libraries |
Category

NAND

  • Purpose: NAND is a Turing equivalent 16-bit computer emulated on the web, built entirely from a clock and NAND gates. It serves as an educational and theoretical project to demonstrate how a computer can be constructed from basic logic gates.
  • Features:
    • Includes a complete tech stack: CPU, machine code, assembly language, assembler, virtual machine language, translator, programming language (Jack), compiler, IDE, and user interface.
    • Based on the Jack-VM-Hack platform from the Nand to Tetris course .
    • Supports example programs like games (Pong, 2048), algorithms (GeneticAlgorithm), and exploits (Overflow, SecretPassword).
  • Target Audience: Learners and enthusiasts interested in computer architecture, low-level programming, and theoretical computing.
  • Programming Language (Jack):
    • A weakly typed, object-oriented language similar to C with Java-like syntax.
    • Manual memory management is required, with heap and stack limitations.
    • Supports custom data types, type coercion, and undefined behaviors (e.g., stack overflows, improper casting).
  • Hardware Specifications:
    • 4 KiB RAM (with strict memory layout constraints).
    • 512x256 pixel screen, ASCII keyboard input, and limited registers.
  • Jack OS: Provides essential system functions (memory, I/O, math, etc.). Users can optionally replace it with their own OS implementation.
  • Example Programs:
    • Demonstrates control flow, recursion, hardware interaction, and even exploits like stack smashing.
    • Includes games (Pong, 2048) and simulations (GeneticAlgorithm).
  • Compiler & Virtual Machine:
    • Recursive descent parser generating stack-based VM code.
    • Maps VM instructions to assembly and machine code.
  • FAQ Clarifications:
    • While NAND gates are the theoretical foundation, the implementation uses high-level abstractions (TypeScript, Rust, WebAssembly).
    • The IDE has usability limitations due to its unconventional design.

NAND is a hands-on exploration of computing fundamentals, bridging logic gates to high-level programming.

rustsveltetypescriptvitejavascriptnand2tetrisscsswasm-bindgen

Comments