A brainfuck interpreter written in F#
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
Program.fs
README.md
brainFsharp.fsproj
brainfsharp-mbrun.gif
brainfuck.fs

README.md

brainFsharp

A brainfuck interpreter written in F#

This was an experiment in writing a parser/intepreter for the instruction set in F#, brainfuck despite it's expletive name is a pretty good language for this.

Steps:

  1. Construct a basic AST from the instruction set
  2. Optimise the AST so it's not quite as slow
  3. Build a more VM friendly instruction set (i.e. get rid of recrusive structure of the AST and use jump conditions instead)
  4. Run through all the VM commands performing appropriate action.

I built it on top of dotnet core so if you want to run it just ensure you have both dotnet and the F# SDK and do a dotnet run

It will generate you a lovely mandlebrot by default, but the real beauty is the code. alt text