aboutsummaryrefslogtreecommitdiff
path: root/README.adoc
blob: 594452944deb6ae15eb653dc28758bded8387aba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
bfc
===

'bfc' is a small, fast, self-contained, optimizing Brainfuck compiler for *nix
on Intel x86-64.

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.

It's pretty easy to retarget the compiler, it just means redoing half the work.
Thanks to the unified ABI, adding support for another flavour of *nix only means
changing the syscall numbers.  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]
 $ ./bfc-amd64-openbsd [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 project's 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:

http://www.gnu.org/licenses/license-list.html