examples | ||
include | ||
src | ||
.gitignore | ||
build.zig | ||
build.zig.zon | ||
README.md |
Brainfuck interpreter & compiler
https://en.wikipedia.org/wiki/Brainfuck
Building & Usage
To compile CLI
zig build -Doptimize=ReleaseFast
Will run using emulator
./zig-out/bin/brainfuck run <filename>
Will compile program to executable
./zig-out/bin/brainfuck compile <filename> <output>
Developing
This command will create a compile_commands.json
file which an IDE can use to more smartly say from where
each file is included. If you don't do this, some defines not be defined and then what you see in the IDE
wont match what the compiler is doing.
zig build cdb
Feature wishlist
- Update TinyCC backend, so host would not need to have it installed. Relies on host having include paths used by TinyCC.
- Add more backends. Maybe LLVM or create my own
- Perform optimizations? Like removing not needed
[]
blocks which are known never to be ran? Idk, what could be optimized - Add WASM/Web build