This folder contains the TypeScript implementation of examples and exercises from the book "Structure and Interpretation of Computer Programs" (SICP).
The code in this directory is based on the Scheme implementations provided by Ivan Jovanović.
The code is organized by chapters and sections corresponding to the book:
1.x: Building Abstractions with Procedures2.x: Building Abstractions with Data3.x: Modularity, Objects, and State4.x: Metalinguistic Abstraction5.x: Computing with Register Machines
cd typescript
npm installWe use Vitest for testing. To run all tests:
npm testWhile Scheme is a functional Lisp dialect, this port attempts to capture the core concepts of SICP using TypeScript's features, including:
- First-class functions and closures
- Higher-order procedures
- Data abstraction using types and classes
- Streams and lazy evaluation (simulated using closures)
- Concurrency primitives (simulated using Promises)