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:
- Construct a basic AST from the instruction set
- Optimise the AST so it's not quite as slow
- Build a more VM friendly instruction set (i.e. get rid of recrusive structure of the AST and use jump conditions instead)
- 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.