Talk

Typing eval and new Function: Type-level JavaScript Interpreter with TypeScript

  • In Russian

It is known that the TypeScript type system is Turing-complete, but what does that mean? In short, it can be used to implement any finite algorithm, including a JavaScript interpreter. This is what we will try to do by learning how to calculate the values ​​of eval and new Function at compile time using type-level programming.

You thought that the task is a bit crazy and the result has no practical value? TypeScript is not a type-safe language, so it is extremely important to understand the capabilities and limitations of its type system, and this task is perfect for this. And it's also just fun! During the solution, we will discuss useful rules for writing convenient and safe types. From the talk, you will be able to learn more about type systems in programming, the functional approach, and JavaScript engines.

Speakers

Talks