A programming language in progress, which this repository will host the compiler of.
See docs/spec.md
For ease of reading the Markdown files, I recommend opening them up in VSCode
- Link to external Markdown reader, for example: https://dillinger.io/ (this one doesn't work with custom heading ids)
- Better error messages and handling
- Perhaps separate all stringify functions in
ASTNode
into its ownStringifier
class
graph TD
Lexer --> |Tokens| Parser
Parser --> |Untyped AST| Analyzer
Analyzer --> |Untyped AST| Typer
Typer --> |Typed AST| CTEE[Compile-time expression evaluator - CTEE]
subgraph Frontend
Lexer & Parser & Analyzer & Typer
end
CTEE ---> |Unmodified Typed AST| Transpiler
CTEE .-> |Modified Typed AST| Transpiler
Transpiler --> C[C code]
C --> CComp[C Compiler]
C .-> JIT[C JIT]
JIT .-> |evaluations| CTEE
CTEE <.-> |?| Macro[Macro Processor ?]
subgraph Third-party
JIT & CComp
end
subgraph Backend
Macro & CTEE & Transpiler
end
CComp --> EXE[Final Executable]
Vector2 := $[
x, y #i32;
add[self *#Vector2, other *Vector2] => [] = {
self.x += other.x;
self.y += other.y;
}
]
main[] => [] = {
pos Vector2 = [1, 2];
ofs Vector2 = [3, 4];
pos.add[&ofs];
}
- Get meson with
pip3 install meson
- Get ninja
- Run
setup.bat
Run build.bat
Run run.bat