aboutsummaryrefslogtreecommitdiff
path: root/doc/IMPLEMENTATION.md
blob: 9a0fb4ac08fb4c8377aa0d32a860f7e933256b36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
1. In the first stage the parser parses multiple files at the same time using multiple threads.
2. In the second stage the ast is handled using multiple threads. In this stage, variables, parameters
and types are defined and resolved and if a type is defined after there is a reference to it,
then the compiler first resolves that type. There are flags set to make sure there aren't recursive dependencies.
3. In the third stage the resolved ast is used to create SSA form (static single assignment form). If optimization is
enabled then then some inlining for ast is done by copying ast from functions to the places they are called from
before the SSA is created.
4. In the fourth stage the SSA form is used to create the bytecode. If optimization is enabled then the SSA form
is optimized before creating the bytecode.
5. If optimization is enabled then the bytecode is optimized.

Currently implemented:
None