Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/detectivekaktus/brainc
Brainfuck x86_64 execution toolset written in pure C for Linux
https://github.com/detectivekaktus/brainc
assembly brainfuck c compiler interpreter linux make nasm nasm-assembly toolset x86-64
Last synced: 2 months ago
JSON representation
Brainfuck x86_64 execution toolset written in pure C for Linux
- Host: GitHub
- URL: https://github.com/detectivekaktus/brainc
- Owner: detectivekaktus
- License: mit
- Created: 2024-07-11T13:50:56.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-07-27T22:32:57.000Z (6 months ago)
- Last Synced: 2024-07-28T20:12:16.778Z (6 months ago)
- Topics: assembly, brainfuck, c, compiler, interpreter, linux, make, nasm, nasm-assembly, toolset, x86-64
- Language: C
- Homepage:
- Size: 35.2 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```console
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:
- Hello world: [Wikipedia](https://en.wikipedia.org/wiki/Brainfuck)
- Calculator: [Dougaak/Brainfuck-Calculator](https://github.com/Dougaak/Brainfuck-Calculator/tree/master)## Contribution
Make sure to read the [CONTRIBUTING.md](https://github.com/detectivekaktus/brainc/blob/master/CONTRIBUTING.md) file before making pull requests to this repository.