Modular Brainfuck interpreter written in Hare

10097c2 Remove LICENSE file

~smlavine pushed to ~smlavine/bf git

1 year, 7 months ago

1c9af6b Use REUSE specification for licensing information

~smlavine pushed to ~smlavine/bf git

1 year, 7 months ago


A modular Brainfuck interpreter, written in Hare.


As a standalone interpreter:

$ bf examples/wikipedia_hello.bf
Hello World!
$ printf 'a\n b\n  c\n' | bf examples/parrot.bf

As a Hare library:

// examples/main.ha
use bufio;
use io::{mode};
use os;
use strings;

use brainfuck;

export fn main() void = {
	const program = bufio::fixed(strings::toutf8(",[.,]"), mode::READ);
	const program = brainfuck::load(&program)!;
	defer free(program);

	const input = bufio::fixed(strings::toutf8("8675309\n"), mode::READ);
	brainfuck::run(program, &input, os::stdout)!;
$ hare run examples/main.ha

See haredoc brainfuck for full documentation.


To build the binary:


To install the library:

make install

To install the binary:

make install-cmd

To uninstall the library or binary:

make uninstall
make uninstall-cmd


Patches may be sent to ~smlavine/bf-devel.

Copyright (C) 2022 Sebastian LaVine

The majority of this project is licensed under the MPL-2.0.

This project conforms with the REUSE specification; see LICENSES/ and the individual files for more information.