hbf: An optimizing Brainfuck compiler and evaluator

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

hbf is a compiler and executor of Brainfuck programs. It provides two executables: hbfc the Brainfuck compiler, and hbf the virtual machine that executes compiled Brainfuck programs.


[Skip to ReadMe]

Properties

Versions0.1.0.0, 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.2.0.0
Change logChangeLog.md
Dependenciesbase (>=4.10.0.0 && <4.13), binary (>=0.8.5.1), bytestring (>=0.10.8.0), deepseq (>=1.4.3.0), filepath (>=1.4.1.2), hbf, optparse-applicative (>=0.14.0.0), parsec (>=3.1.13.0), primitive (>=0.6.2.0), text (>=1.2.2.0), transformers (>=0.5.2.0), vector (>=0.12.0.1) [details]
LicenseGPL-3.0-only
CopyrightSebastian Galkin, 2018
AuthorSebastian Galkin
Maintainerparaseba@gmail.com
CategoryLanguage
Home pagehttps://gitlab.com/paraseba/hbf
Bug trackerhttps://gitlab.com/paraseba/hbf/issues
Source repositoryhead: git clone git@gitlab.com:paraseba/hbf.git
Executableshbfc, hbf
UploadedMon Jun 25 22:11:59 UTC 2018 by paraseba

Modules

[Index]

Flags

NameDescriptionDefaultType
dump

Dump stg and core files

DisabledManual
profile

Enable profiling in benchmarks

DisabledManual

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for hbf-0.1.0.0

[back to package description]

HBF Build Status

An unoptimized Brainfuck optimizing compiler and evaluator.

HBF can compile standard Brainfuck code into an optimized Intermediate Representation (IR). This IR can later be executed for faster Brainfuck program evaluation.

Getting Started

Installing

Use your preferred method for installing HBF from Hackage. If you prefer to build from source you can use cabal.

Usage

Let's say you have a Brainfuck program in the file mandelbrot.bf, for example, you can get one here

You can compile the program to the Intermediate Representation using the hbfc executable provided by this project:

hbfc mandelbrot.bf

That will create a file mandelbrot.bfc in the same directory. If you want the output in a different path you cane use --output option to hbfc

Now, you can run the compiled program:

hbf mandelbrot.bfc

and get something like:

Mandelbrot

There are several options to both the compiler and the evaluator, to modify levels of optimization, output and others. Try --help to learn more.

Hacking

HBF has heavily documented code. Take a look at the documentation on Hackage.

Running the tests

cabal test

Test coverage report for the last build can be found here.

Running the benchmarks

cabal bench

Benchmark report for the last build can be found here.

License

This project is licensed under the GPL-3 License - see the LICENSE file for details

Copyright 2018 Sebastian Galkin.

Acknowledgments

This work is based on the excellent project bfoptimization by matslina: