Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

brain

> 编程语言
Open source

A high level programming language that compiles into the brainfuck esoteric programming language

184 stars0 likes1 views
WebsiteGitHub

About

A high level programming language that compiles into the brainfuck esoteric programming language

brain

brain is a strongly-typed, high-level programming language that compiles into brainfuck. Its syntax is based on the [Rust programming language][rust] (which it is also implemented in). Though many Rust concepts will work in brain, it deviates when necessary in order to better suit the needs of brainfuck programming.

[brainfuck] is an esoteric programming language with only 8 single-byte instructions: +, -, >, `,>,>,>,>+++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++.--------------------

---.+++++++++++++++++++++++++++++.--------- --------------------.---------------------- ----------.>.>.>.>++++++++++.------- ---,>++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++.------------------------

.+++++++++++++++++++++++++++++.------------ -----------------.------------------------- -------++++++++++.----------,>,> ,>,>>++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++.------------------------- -----------------------------------------.+ ++++++++++++++++++++++++++++.-------------- ---------------.--------------------------- -----.>.>.>.>>++++++++++.----------


Run this after compiling with `brainfuck input.bf < someinputfile.txt`.

## Installation

For people just looking to use brain, the easiest way to get brain right now
is to first install the [Cargo package manager][cargo-install] for the
Rust programming language.

**NOTE: Until this version is released, these instructions will NOT work. Please
see the Usage instructions below for how to manually install the compiler from the
source code.**

Then in your terminal run:

cargo install brain cargo install brain-brainfuck


If you are upgrading from a previous version, run:

cargo install brain --force cargo install brain-brainfuck --force

…

cargo run filename.brn

where `filename.brn` is the brain program you want to compile

Use `--help` to see further options and additional information

cargo run -- --help


**If the brain compiler seems to be taking too long or "hanging", try running
`cargo build` first to see if the Rust compiler is just taking too long for
some reason.**

You can also install the compiler from the source code using this command in the
repository's root directory:

cargo install --path .


## Examples

There are various brain examples in the `examples/` directory which you can
compile into brainfuck using the usage instructions above.

## Thanks

This project would not be possible without the brilliant work of the many
authors of the [Esolang Brainfuck Algorithms][bf-algorithms] page. The entire
wiki has been invaluable. That page in particular is the basis for a lot of the
code generation in this compiler. I have contributed many novel brainfuck
algorithms to that page as I come up with them for use in this compiler.

[brainfuck]: http://www.muppetlabs.com/~breadbox/bf/
[rust]: https://www.rust-lang.org/
[cargo-install]: https://crates.io/install
[bf-algorithms]: https://esolangs.org/wiki/Brainfuck_algorithms
[brainfuck-interpreter]: https://github.com/brain-lang/brainfuck
[bf-spec]: https://github.com/brain-lang/brainfuck/blob/master/brainfuck.md

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustbrainbrainfuckbrainfuck-interpreterbrainfuck-programs

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言