~/talk

Typing eval and new Function: A JavaScript Interpreter in TypeScript Types

TalkinRussianat HolyJS 2025 Spring · 2025-04-07..04-08· [typescript, javascript]
links:none on file
slides:none on file

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

  1. 0:00Introduction
  2. 4:17Type EVAL and new Function
  3. 8:37Arithmetic typing
  4. 15:17String handling and number addition
  5. 18:48Number multiplication via types
  6. 22:18Evaluating arithmetic expressions
  7. 26:11Variable interpretation and return
  8. 30:02Parsing function instructions
  9. 33:37Interpreting parameterless functions
  10. 35:00Supporting function parameters
  11. 38:12Extending new Function
  12. 41:25Summary
  13. 42:50Resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.