|
bfx
An interpreter, compiler, and REPL for brainfuck-like languages
|
This is an interpreter, compiler, and REPL for the following Turing-complete esoteric programming languages:
Most tape-based single-character instruction languages can be incorporated into libbfx with relative ease (see Extending).
-e eof_behavior: Specify behavior when encountering EOF. Valid values are "zero" (the default, sets the current cell to zero), "decrement" (subtract one from the current cell), and "unchanged" (do not change the current cell).-i: Separate code from input using ! (Note: Grin is not supported here).-l language: Specify the language to use (Default: brainfuck).-r: Run in interactive REPL mode (Note: Weave is not supported here).-t tape_size: Specify the size of the tape (default: 30000).Note that the bfx library must be installed to your PATH in order to use these options. Compiled code may be run without the bfx library.
-c: Compile the given program to a native binary.-o output_file: Specify the output file (default: './a.out')-D: Default to degrees instead of radians (Grin).-P precision: Specify the number of decimal places to print (Grin). Default is 4.-v: Print version information.brainforkbrainfuck (Default)grinpbrainweaveIf file is not specified, bfx will read source code from standard input.
It is possible to add support for new languages pretty easily by following these steps:
BFX_Languages enum in libbfx/src/bfx.h.BFX_LANG(NAME) macro to the list in libbfx/src/interpret.c.get_language() in bfx/src/main.c.bfx running sierpinski.b

If you find a bug, submit an issue, PR, or email me with a description and/or patch.
Copyright (c) 2022-2026 Ben O'Neill ben@o.nosp@m.neil.nosp@m.l.sh. This work is released under the terms of the MIT License. See [LICENSE](LICENSE) for the license terms.