vladk1m0 / gbfm

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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!

About

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

License:MIT License


Languages

Language:Go 49.8%Language:Brainfuck 49.4%Language:Beef 0.7%Language:Shell 0.1%