A deep dive into ECMAScript (JavaScript) specification and internals of TypeScript compiler. In this first part I’ll explore lexical grammar and explain TypeScript’s scanner implementation details.

My journey into compilers world started with this tweet and the question how does Angular AOT compilation that uses static code analysis work. After some debugging I found out that it relies heavily on TypeScript compiler so the quest then began to reverse-engineer it. What’s interesting is that most compilers are implemented using the same principles collectively known as compilers theory. Having a good grasp of this theory is indispensable when trying to understand a compiler internals.

#javascript #typescript #compilers #grammar

Gentle Introduction Into Compilers. Lexical Analysis and Scanner
1.40 GEEK