Share your repls and programming experiences

← Back to all posts
BrainF Implementation in C++
ANDREWVOSS (187)

A BrainF implementation written in C++. I'm bad with names, so it doesn't have one (Suggestions in the comments if you feel like it).

Features

  • Compiles BrainF to C
  • Specify amount of cells at compile-time
  • System calls (kinda)
  • Works 100% correctly (In compiler mode)

WIP Features

  • Optional interpreter instead of compiler

Planned

  • Command-line REPL (Similar to the Python shell)
  • Specify size of cells at compile-time

Specifications

Same as the original BrainF:

  • 30,000 memory cells
  • Each cell is 1 (unsigned) byte

The compiler source code is in the attached repl. If you want to run it, fork the repl and change main.bf (idk what's in there, I keep changing it).
Thanks for reading, and please give feedback in the comments! :)

Comments
hotnewtop
dashgeometry (0)

Thanks for the sharing. This is my first time visiting your blog. Really I like your Blog. Keep doing more like this.
https://cookie-clicker.io/

DynamicSquid (4916)

There's a bunch of errors when I run it

ANDREWVOSS (187)

@DynamicSquid

nF#inlcude <iostream>

looks like I had a minor stroke while typing the title of the repl. It should work now lol.

ANDREWVOSS (187)

@DynamicSquid Thanks! Once I get the interpreter done, the REPL should be a piece of cake (and then this project will actually be done). I saw a bunch of BrainF implementations on Esolang, but they were all interpreters, so I decided to make a compiler and an interpreter.

ANDREWVOSS (187)

@DynamicSquid And then I came up with the idea for a REPL at 11:00 PM last night when I was trying to sleep

DynamicSquid (4916)

@ANDREWVOSS lol, that always happens to me