Skip to content

richardhallett/brainFsharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A brainfuck interpreter written in F#

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages