Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

liquidev/microbf

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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.

#include <ubf_brainfuck.h>

int 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.

About

A small, optimizing Brainfuck interpreter

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.