Brainfuck compiler
Go to file
Přemysl Janouch b846a7a0ea
Add support for OpenBSD
It just rejects the generic System V ABI and has other syscall numbers.
2016-12-24 22:29:29 +01:00
interpreters Update READMEs 2016-12-22 23:40:30 +01:00
bfc-amd64.c Add support for OpenBSD 2016-12-24 22:29:29 +01:00
LICENSE Initial commit 2016-12-22 23:26:41 +01:00
Makefile Add support for OpenBSD 2016-12-24 22:29:29 +01:00
README.adoc Add support for OpenBSD 2016-12-24 22:29:29 +01:00

bfc

bfc is a small, fast, self-contained, optimizing Brainfuck compiler for *nix on Intel x86-64. Currently supported targets are Linux and OpenBSD.

Also included are several interpreters in various states of sophistication that document my progress as I was writing this, from the simplest approach to an optimizing JIT compiler.

Its pretty easy to retarget the compiler, it just means redoing half the work. The compiler itself is platform agnostic.

Building

Build dependencies: a C99 compiler
Runtime dependencies: Linux or OpenBSD

$ git clone https://github.com/pjanouch/bfc.git
$ cd bfc
$ make

To obtain dumps of the intermediate representation, compile with -DDEBUG:

$ make CPPFLAGS=-DDEBUG

Usage

./bfc-amd64-linux [INPUT-FILE] [OUTPUT-FILE]

When no input file is specified, standard input is used. Similarly, the default output filename is a.out. After the compilation, the resulting file can be run on the target platform.

Contributing and Support

Use this projects GitHub to report any bugs, request features, or submit pull requests. If you want to discuss this project, or maybe just hang out with the developer, feel free to join me at irc://irc.janouch.name, channel #dev.

License

bfc is written by Přemysl Janouch <p.janouch@gmail.com>.

You may use the software under the terms of the ISC license, the text of which is included within the package, or, at your option, you may relicense the work under the MIT or the Modified BSD License, as listed at the following site: