An interpreter and compiler for the Brainfuck language.

Overview

Brainrust 🧠

An interpreter and compiler for the Brainfuck language.

Prerequisites

You need a LLVM 16.0.* installation on your system. On Windows, you may need to build LLVM from source, since the pre-built binaries do not include everything you need (see below).

Building LLVM from Source on Windows

You will have to have Visual Studio installed.

git clone https://github.com/llvm/llvm-project.git
cd llvm-project
git checkout tags/llvmorg-16.0.4
mkdir build
cd build
cmake -DLLVM_ENABLE_PROJECTS=clang -A x64 -Thost=x64 ..\llvm

This creates a file called LLVM.sln. You can open that file in Visual Studio, choose the desired build type (e.g. "Release") and build the BUILD_ALL target.

Make sure to add the /bin folder of the resulting build artifacts to PATH. Verify that it worked:

clang --version

This should yield something like this:

clang version 16.0.4
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\dev\llvm-project\build\Release\bin

Getting Started

Run the program using cargo. Pass --help to see the available options.

cargo run -- --help

To run an example program using the built-in interpreter, type:

cargo run -- -r programs/hello_world.b

To compile a program, type:

cargo run -- -o hello_world.exe programs/hello_world.b

The compiler uses clang for linking. Make sure that clang is available in the PATH.

You might also like...
Tools - The Rome Toolchain. A linter, compiler, bundler, and more for JavaScript, TypeScript, HTML, Markdown, and CSS.
Tools - The Rome Toolchain. A linter, compiler, bundler, and more for JavaScript, TypeScript, HTML, Markdown, and CSS.

Rome is currently being rewritten in Rust. Read more about it in our latest blog post. The documentation below is out of date and available for poster

Minimal Pandoc compiler - HTML

Minimal Pandoc compiler - HTML

Vyper-Compiler Version Manager in Rust

Vyper Compiler Version Manager in Rust Install $ cargo install --git https://github.com/storming0x/vvm-rs --locked vvm-rs Install from source $ git c

Discord-to-Cohost compiler written in Rust using Tera
Discord-to-Cohost compiler written in Rust using Tera

Cohoard - Post formatted chatlogs to Cohost! Cohoard is a tool for turning chatlogs into formatted posts on Cohost. You can use Cohoard to easily form

🐱 HQ9C is a very serioues compiler for HQ9+, it meta-compiles with Rust.

HQ9+ Compiler HQ9c (Or HQ9+ Compiler) is a blockchain-based NFT minting AI machine-learning cloud infraestructure for the compiling of the great progr

Nederlandse programmeertaal. Geinterpreteerd en met dynamische types. Met bytecode compiler en virtual machine, in Rust.

Nederlang Nederlang is een geinterpreteerde programmeertaal, in het Nederlands! Met als bestandsnaam extensie.... .nl! Het maakt gebruik van dynamisch

The JavaScript Oxidation Compiler - Linter / Prettier

The JavaScript Oxidation Compiler (oxc) Why this project? The goal of this project is to: Create a blazingly fast JavaScript Compiler written in Rust.

⚡ Blazing ⚡ fast ⚡ compiler for Cairo, written in 🦀 Rust 🦀

Cairo 1.0 🐺 ⚡ Blazing ⚡ fast ⚡ compiler for Cairo, written in 🦀 Rust 🦀 Report a Bug - Request a Feature - Ask a Question Getting Started Prerequisi

The zkEVM Vyper compiler.

zkSync Era: Vyper Compiler zkSync Era is a layer 2 rollup that uses zero-knowledge proofs to scale Ethereum without compromising on security or decent

Owner
Michael Gerhold
Software Engineer, Tutor, Twitch Streamer
Michael Gerhold
Interpreted, optimized, JITed and compiled implementations of the Brainfuck lang.

Interpreted, Optimized, JITed and Compiled Brainfuck implementations This repo contains a series of brainfuck implementations based on Eli Bendersky b

Rodrigo Batista de Moraes 5 Jan 6, 2023
A BrainFuck zkVM implementation using Halo2.

zkvm_brainfuck A BrainFuck zkVM implementation using Halo2. Zkvm_brainfuck is a zero-knowledge BrainFuck VM, designed as a custom, STARK-inspired vers

PO 5 Nov 7, 2023
A BASIC language interpreter. Does not conform to existing standards. Mostly a toy.

JW-Basic A toy language that is somewhat like QBasic. Features: Graphics: 160x96 (255 colors & transparent) Text: 32x16 (4x5 font) Character set: ASCI

John Wells 8 Feb 15, 2023
Rust-based interpreter for the Dreamberd (https://github.com/TodePond/DreamBerd) language

Dreamberd.rs Rust-based interpreter for the Dreamberd language. The full specification for Dreamberd is available at https://github.com/TodePond/Dream

null 16 Jul 2, 2023
An awesome language and its compiler.

Calocom Project Build Build with cargo-make Just run cargo make in the root directory of the project. Or, if you want to build it in release mode, run

Aoyang Yu 31 Sep 16, 2022
A fast, powerful, and safe interpreter written in rust!

Kraber A fast, powerful, and safe programming language written in rust! About It packs a punch like the Kraber .50-Cal. Kraber is designed to be minim

Int Fract 3 Mar 24, 2024
Compiler for an "extended" version of the Mindustry logic language

Minblur Compiler Minblur is a compiler for a superset of "logic" programming language in the game Mindustry. It helps reduce code-duplication, making

Binder News 15 May 2, 2022
Open-source compiler for the Papyrus scripting language of Bethesda games.

Open Papyrus Compiler This project is still WORK IN PROGRESS. If you have any feature requests, head over to the Issues tab and describe your needs. Y

erri120 22 Dec 5, 2022
Compiler frontend for the PureScript programming language.

purescript-analyzer Goals Provide an independent frontend for providing information for IDE tooling, separate from the compiler. Implement a rich edit

Justin Garcia 16 Jul 25, 2023
A Typescript interpreter in Rust.

typescript This is a Rust native implementation of a Typescript Parser and a JIT execution engine. This project comes in two crates: [typescript-ast]:

Arne Simon 4 Oct 31, 2022