Photo credit: @high_byte
This compiler is kinda wack as it was more a golfing exercise and reason to play with Zig. I put more love into my C compiler.
I just wanted to create a simple golfing language that solves dropper CTF challenge from paradigm.xyz and also a reason to play with zig. The best solutions requires pre-computation, but that isn't what we are trying to do here. The point is not to create the best solution, but create a golfing solution.
See docs for some example programs.
Solution on Dropper | Score |
---|---|
Tiny evm language | 955188 |
Naive solc | 970992 |
See benchmark or run it yourself ./run_dropper_benchmark.sh
These todo's will likely never happen, you want a good evm language ? Use huff.
- Code generation
- Nested functions call doesn't really work (the fallthrough logic is not optimal)
- If conditional jump destination can sometimes generate bad / invalid JUMPs.
- Validation / padding of PUSH argument values.
- Zig code can likely be made more modular.
snap install zig --classic --beta
zig build --summary all
./zig-out/bin/cli [path]
Note that we don't have any real unit tests
zig build test
We have some compiler tests
./e2e_test.sh