The brainfuck language interpreter written in Rust

Overview

Brainfudge

The brainfuck language interpreter written in Rust.

run:

# compile
cargo build
# run
./target/debug/brainfudge <path to file> <optional: memory size>

# or

# run directly
cargo run <path to file> <optional: memory size>

# example
cargo run minecraft.bf 50000

syntax:

This interpreter uses standard brainfuck syntax i.e:

symbol instruction
+ increment the current memory address
- decrement the current memory address
> move the memory cursor forward
< move the memory cursor backwards
[ enter a loop
] exit a loop
. print the ASCII character at the current memory address
, take input from user

The input file's extension doesn't matter, it only has to be encoded as plain ASCII text. Any symbol not mentioned in the table above won't be executed and treated as a comment (including newline characters).

memory:

The default allocated memory is 30000 bytes i.e 30000 available memory addresses*. You can allocate a custom amount of memory by providing it as a plain number as a second argument to the program at runtime. The minimum ammount of memory is 10 bytes.

comments:

* - a memory address is esentially a single number that you can perform operations on, the memory is just an array of these, by default all alocted bytes are set to 0 (\nul in ASCII), you can move along the memory using > and < instruction

You might also like...
A fast, powerful and configurable interpreter written in Rust

brainfuck-interpreter Overview A fast, powerful and configurable interpreter written in Rust, which allows various options to meet different demends,

Regorus - Rego interpreter, analyzer and validator written in Rust

regorus THIS REPOSITORY IS IN ACTIVE DEVELOPMENT AND NOT INTENDED FOR PRODUCTION USE. Regorus is a Rego interpreter, analyzer and checker written in R

Risc-V assembly interpreter built with pure Rust
Risc-V assembly interpreter built with pure Rust

Risc-V Interpreter Interpreter for Risc-V assembly built with Rust Report bug · Request feature Table of contents Quick start Exemple Program Instruct

This crate defines a single macro that is a brainfunct compile-time interpreter.

Compile Protection This crate defines a single macro that is a brainfunct compile-time interpreter. One example is as follows #![recursion_limit = "18

PICNIC Is Config Notation Interpreter/Converter
PICNIC Is Config Notation Interpreter/Converter

PICNIC Is Config Notation Interpreter/Converter 🦀 PICNIC PICNIC's name is powered by AI, which immediately makes it worth your time: Human: Please co

tr-lang is a language that aims to bring programming language syntax closer to Turkish.

tr-lang Made with ❤️ in 🇹🇷 tr-lang is a language that aims to bring programming language syntax closer to Turkish. tr-lang is a stack based language

A language server implementation for the WGSL shading language

wgsl-analyzer wgsl-analyzer is a language server plugin for the WGSL Shading language. It comes with a VS Code plugin located in ./editors/code, but d

A language server for lua written in rust

lua-analyzer lua-analyzer is a lsp server for lua. This is mostly for me to learn the lsp protocol and language analysis so suggestions are helpful. T

Luno API Client written in Rust Language for Rustaceans :)

The Luno API provides developers with a wealth of financial information provided through the Luno platform

Owner
Jan Štaffa
Student learning computer science.
Jan Štaffa
Brainf - A brainfuck interpreter written in Rust 🦀

brainf A brainfuck interpreter written in Rust ?? . Do not I wrote this in my spare time... but still its good! Run Locally Clone the project git cl

Nav 3 Oct 8, 2022
A collection of compilers based around compiling a high level language to a Brainfuck dialect.

tf A collection of compilers based around compiling a high level language to a Brainfuck dialect. Built at, and for, the VolHacks V hackathon during O

adam mcdaniel 6 Nov 25, 2021
Programming Language Inspired by Brainfuck

Brainsuck Brainfuck but not really... like... a better version of it. Installation Requirements: Rust version 1.50 or higher Linux curl https://raw.gi

Derin Önder Eren 27 Nov 18, 2022
A simple interpreter written in Rust programming language.

Interpreter in Rust A simple interpreter written in Rust programming language. Getting Started These instructions will get you a copy of the project u

Ismail Mosleh 5 Feb 17, 2023
Boop is a variant of Brainfuck featuring cats.

Boop Boop is a variant of Brainfuck featuring cats. Try it $ cat ./examples/hello-world.boop This program is Hello World translated from Brainfuck to

Federico Damián Schonborn 4 Aug 12, 2022
A transpiler/compiler for CrabRave, a version of BrainFuck with sea-life emojis.

CrabRave Programming Language CrabRave is a fun and unique programming language based on Brainfuck, which utilizes crab and sea-life emojis as its syn

null 23 May 3, 2023
rlox-interpreter is an AST-walking implementation of Bob Nystrom's Lox language in Rust.

rlox-interpreter rlox-interpreter is an AST-walking implementation of Bob Nystrom's Lox language in Rust. Disclaimer: This is my first Rust project, d

Paul Fedorow 3 Oct 5, 2022
Compiler & Interpreter for the (rather new and very experimental) Y programming language.

Y Lang Why would anyone build a new (and rather experimental) language with no real world use case. Design Y (pronounced as why) is based on the idea

Louis Meyer 8 Mar 5, 2023
A Brainf** interpreter written in rust 🦀

Brainf Interpreter An interpreter for the esoteric programming language Brainfuck written in rust ?? Compilation NOTE: To compile the project, you nee

Chitram Dasgupta 2 Sep 12, 2022
Brainfu*k interpreter and REPL written in Rust🦀

brainfuck interpreter: a simple brainfuck interpreter and REPL writen in rust ?? Read this in other languages. AR Arabic-العربية Features Run brainfuc

Anas Elgarhy 7 Feb 1, 2023