Go to file
2024-09-14 15:10:05 +03:00
examples add nasm backend 2024-09-14 15:10:05 +03:00
include add nasm backend 2024-09-14 15:10:05 +03:00
src add nasm backend 2024-09-14 15:10:05 +03:00
.gitignore add compile command 2024-07-14 16:13:47 +03:00
build.zig add nasm backend 2024-09-14 15:10:05 +03:00
build.zig.zon add compile command 2024-07-14 16:13:47 +03:00
README.md add nasm backend 2024-09-14 15:10:05 +03:00

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