A brainfuck interpreter

I’ve written a simple brainfuck interpreter in Zig (https://github.com/daneelsan/brainfuckz) as a tutorial (nothing fancy). Any code review is appreciated!

Things I liked:

  • Code is really “transparent”
  • Using zig to do everything (build.zig ftw)
  • Importing files as structs
  • Structs having functions (aka “methods”), but not being objects
  • Not assuming any default allocator
  • Testing integration

Things I have to get used to:

  • Putting try everywhere

Next steps:

  • I want to put it in the web (wasm + js + html). An inspiration is the “Easy *” series: Easy 6502 by skilldrick or (Easy Forth)

Zig is fun :slight_smile:

6 Likes