百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
B

brain

> 编程语言
开源

一种高级编程语言,可编译成 brainfuck 专业编程语言

184 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一种高级编程语言,可编译成 brainfuck 专业编程语言

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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustbrainbrainfuckbrainfuck-interpreterbrainfuck-programs

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

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