smol compiler, using Python, QBE (compiler backend), and Lark (parser generator)
idk, i was bored and then i made this...
nix-shell # use nix like a chad
python src/main.py < tests/expressions.lark > out.ssa # Outputs QBE IR
qbe out.ssa > out.s # Turn QBE IR into assembly
gcc out.s -o out # Turn assembly into binary
./out # woah magic
install nix and refer to but how do i run it??.
don't.
- Install Python 3.10 (or later)
- Install QBE (or compile from scratch)
pip install lark
# Run the commands from the other thing, minus the `nix-shell`