Skip to content

Brainfuck x86_64 execution toolset written in pure C for Linux

License

Notifications You must be signed in to change notification settings

detectivekaktus/brainc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brainc

Brainc is a toolset that allows you to execute brainfuck code efficiently due to its implementation written in pure C. For compilation, the toolset offers to its user only the x86-64 processor architechture; the files compiled are in ELF64 format.

Compilation

It's used GNU Make tool and any C compiler (either gcc or clang) to compile the source code. You would also need NASM assembler. You can execute the following instruction in your terminal:

make

You will find yourself with a new directory called build in the project's root folder in which you find the executable brainc which is the compiler itself.

Usage

The toolset has the following flags:

Flag Description
-h --help Outputs help information about the compiler
-v --version Outputs version of the compiler
-i --interpret Interprets the source .bf file
-c --compile Compiles the source .bf file down to ELF64 executable
-o --output Used with -c or -S flags. Compiles the source .bf file down to ELF64 executable with a specified name
-S Outputs assembly generated by the compiler

Examples

You can find examples in the examples directory and execute them with the toolset.

Links to the examples:

Contribution

Make sure to read the CONTRIBUTING.md file before making pull requests to this repository.