/gbfm

Golang Brainfuck machine (GBFM), this is a naive implementation of interpreter and transpiler Brainfuck to JavaScript

Primary LanguageGoMIT LicenseMIT

Golang brainfuck machine (GBFM)

Brainfuck is an esoteric programming language with 8 very simple instructions.

The purpose of GBFM is to interpret the brainfuck code or transpile it into other target programming languages.

Limitations:

  • 😉 now only Javascript target language is supported!
  • 😏 Javascript transpiled program don't support ',' (read char from stdin) brainfuck operator.

How to use

  1. Run GBFM in interpretation mode use cmd:

    ./gbfm.sh run ./test_data/hello_world.bf
  2. Run GBFM in transpiler mode use cmd:

    ./gbfm.sh translate ./test_data/hello_world.bf

    Generate ./test_data/hello_world.bf.js in result To run *.bf.js file use nodejs

    node ./test_data/hello_world.bf.js

Testing

Prerequisites for tests running:

  • local nodejs installation!

To run all tests use cmd:

go test -v ./...

Licence

Code is released under the MIT license.

Contribute

Pull requests are very welcome!