Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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

Sign up

A Brainfuck interpreter and optimizing compiler written in Go

License

NotificationsYou must be signed in to change notification settings

linux4life798/gobf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go ReferenceGo Build/TestCodeQL

GoBF

This is aBF interpreter and optimizing compiler written in Go.

GoBF can simply run your BF program or compile it to a binary to run later.

Obligatory Install Line

go get github.com/linux4life798/gobf

Usage

The commandline program currently supportscompile,gengo,run, anddumpil actions.

Give it a try!

go get github.com/linux4life798/gobfwget https://github.com/erikdubbelboer/brainfuck-jit/raw/master/mandelbrot.bfgobf compile mandelbrot.bf./mandelbrot

Note that therun command will simply interpret the BF program in-place,thus the performance will be as-is. Please use thecompile to generatean optimized program.

Please seegobf --help for more fun options!

Optimization

The generated code optimizer reduces redundant and repetitive commands,like data pointer moves or incrementing a data cell.It coalesces multiple moves or data cell changes into one operation.Due to BF's repetitive nature, this typically increases the BF program'sperformance dramatically. All of the interesting optimization stuffis ingobflib/il package.

Recent work has added some pattern and vectorization based optimizations,but these have not been fully calibrated yet.

To try the zero pattern optimization, invoke gobf in the following manor:

gobf -O zero compile mandelbrot.bf

About

A Brainfuck interpreter and optimizing compiler written in Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp