https://github.com/eriknyquist/bfcc
Brainfuck compiler
https://github.com/eriknyquist/bfcc
brainfuck brainfuck-compiler esoteric novelty
Last synced: 4 months ago
JSON representation
Brainfuck compiler
- Host: GitHub
- URL: https://github.com/eriknyquist/bfcc
- Owner: eriknyquist
- Created: 2017-05-07T03:20:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-11T19:00:21.000Z (over 8 years ago)
- Last Synced: 2025-01-11T05:28:34.922Z (11 months ago)
- Topics: brainfuck, brainfuck-compiler, esoteric, novelty
- Language: C
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Brainfuck compiler
==================
Compiles `Brainfuck `_ source code into
executable format.
(Actually, more like a brainfuck-to-C translator that invokes GCC to get an
executable)
Two sample brainfuck programs, ``hello_world.b`` (prints "Hello world!" to the
terminal), and ``sierpinski.b`` (prints a pretty ASCII triangle to the
terminal) are provided in this repository.
Install
=======
::
> make
> sudo make install
Now, you have two new programs installed:
* ``btoc`` (reads a brainfuck source file, prints C to stdout)
* ``bfcc`` (reads a brainfuck source file, and creates an executable by
running ``btoc`` and piping it to ``gcc``)
Compile a brainfuck program
===========================
If you have GCC and a C standard lib. installed, you can use ``bfcc`` to compile
brainfuck programs directly into executable format. Here is an example, Using
``hello_world.b``
::
> bfcc hello_world.b -o hello_world
> ./hello_world
Hello World!
>
Or, if (for some reason) you want to see the C code, you can just run ``btoc``
on the brainfuck program yourself
::
> btoc hello_world.b > hello_world.c