https://github.com/liquidev/microbf
A small, optimizing Brainfuck interpreter
https://github.com/liquidev/microbf
brainfuck-compiler brainfuck-interpreter
Last synced: about 2 months ago
JSON representation
A small, optimizing Brainfuck interpreter
- Host: GitHub
- URL: https://github.com/liquidev/microbf
- Owner: liquidev
- License: mit
- Created: 2019-02-16T18:22:14.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-13T13:31:50.000Z (almost 6 years ago)
- Last Synced: 2024-11-03T11:03:05.905Z (6 months ago)
- Topics: brainfuck-compiler, brainfuck-interpreter
- Language: C
- Homepage:
- Size: 48.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- AwesomeInterpreter - microbf
README
# microbf
A small, optimizing Brainfuck interpreter.## Usage
To use the microbf interpreter, simply execute it:
```
./ubf
```
It will read from the standard input until it hits an EOF (`^D` on Linux,
Ctrl + Z on Windows), and interpret the input.## Compiling
To compile microbf, you'll need a C compiler and Meson.
```bash
meson build
ninja -C build
```
libubf and ubfrun will be built to `build/meson-out`.## Embedding
microbf can be embedded to create a custom REPL, debugger, or something, but it
doesn't have any modularity or application embedding capabilities.
Not yet, at least.
```c
#includeint main(void) {
// To create a VM, use:
ubf_vm_t *vm = ubf_init_vm();
// To interpret code, use:
ubf_interpret(vm, "+++++[>+++++<-]");
// After you're done with the VM, don't forget to release its memory:
ubf_free_vm(vm);return 0;
}
```## Contributing
Feel free to contribute to the microbf project. If you find any missing
features or bugs, submit an issue or open a pull request.## Implementation details
If you want some background on microbf's internal architecture, read
[this document](docs/implementation.md).