Typing eval and new Function: A JavaScript Interpreter in TypeScript Types
summary
Demonstrates implementing an interpreter for a subset of JavaScript using only TypeScript’s type system, so expressions evaluated via eval or new Function have their results computed at compile time. Covers using TypeScript’s Turing-complete type-level programming to model language semantics, discusses JS engine concepts and the functional-programming approach used to build the type-level interpreter.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 4:17Type EVAL and new Function
- 8:37Arithmetic typing
- 15:17String handling and number addition
- 18:48Number multiplication via types
- 22:18Evaluating arithmetic expressions
- 26:11Variable interpretation and return
- 30:02Parsing function instructions
- 33:37Interpreting parameterless functions
- 35:00Supporting function parameters
- 38:12Extending new Function
- 41:25Summary
- 42:50Resources








