A miniature model of the Typescript compiler, intended to teach the structure of the real Typescript compiler
I started this project as part of reading Modern Compiler Implementation in ML because I wanted to learn more about compiler backends. When I started building the example compiler I found I disagreed with the implementation of nearly everything in the frontend. So I wrote my own, and found that I had just written a small Typescript.
I realised a small Typescript would be useful to others who want to learn how the Typescript compiler works. So I rewrote it in Typescript and added some exercises to let you practise with it. The resulting compiler covers a tiny slice of Typescript: just
var declarations, assignments and numeric literals. The only two types are
git clone https://github.com/sandersn/mini-typescript cd mini-typescript code . # Get set up npm i npm run build # Or have your changes instantly happen npm run build --watch # Run the compiler: npm run mtsc ./tests/singleVar.ts