Cover image for JS compiled language

JS compiled language

giandodev profile image GiandoDev ・1 min read

The history teaches us that the compiler processes the code in three stages:


Alt Text
As in the image above, in this phase, we convert our program into meaningful tokens.


Here we take a stream of tokens (array) and trasform it into an abstract syntax tree called AST that represent the grammatical structure of the program.
Alt Text

Code Generation

Here JavaScript convert AST into a set of machine instruction.
Between parsing and code generation, JavaScript optimizes performance, execution and does also other cool stuff, all in a millisecond.
If you want take time to understand JavaScript engines look this awesome video from JS config Franziska Hinkelmann
Alt Text

Posted on May 23 by:

giandodev profile



Hi, I am Giandomenico. I love to learn new stuff and solve problems.


markdown guide