A fast, powerful and configurable interpreter written in Rust

Overview

brainfuck-interpreter

Overview

A fast, powerful and configurable interpreter written in Rust, which allows various options to meet different demends, including memory (tape) length configuration, EOF handling configuration and so on.

Usage

Quick Start

$ git clone https://github.com/ctj12461/brainfuck-interpreter.git
$ cd brainfuck-interpreter
$ cargo install --path ./crates/bf-exec # The program will be installed to ~/.cargo/bin
$ bf-exec ./examples/helloworld.bf
Hello World!

Verbose Version

Usage: bf-exec [OPTIONS] <SOURCE>

Arguments:
  <SOURCE>
          the path of the brainfuck program source code file.

Options:
      --len <LEN>
          the memory (tape) length the program will use.

          [default: 32768]

      --addr <ADDR>
          the address range of the memory (tape).

           - unsigned: [0, len - 1]
           - signed: [-ceil(len / 2), ceil(len / 2) - 1]

          [default: unsigned]
          [possible values: unsigned, signed]

      --cell <CELL>
          the data type of one cell in the memory (tape).

          [default: int8]
          [possible values: int8, int32]

      --overflow <OVERFLOW>
          the operation the interpreter should do when an overflow error occurs.

           - wrap: automatically wrap the value in cell (e.g.: `127 + 1` => `-127`)
           - error: throw an error and abort

          [default: wrap]
          [possible values: wrap, error]

      --eof <EOF>
          the operation the interpreter should do when an `EOF` is read.

           - zero: turn `EOF` to `0`
           - keep: keep what the `EOF` is and return it (`EOF == -1`)
           - ignore: ignore this input and leave the cell unchanged

          [default: ignore]
          [possible values: zero, keep, ignore]

      --input <INPUT>
          the input stream type.

          [default: std]
          [possible values: null, std]

      --output <OUTPUT>
          the output stream type.

          [default: char-std]
          [possible values: char-std, int-std]

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

License

Licensed under MIT.

Copyright (C) 2023 Justin Chen (ctj12461)

You might also like...
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

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

A little bit fast and modern Ruby version manager written in Rust
A little bit fast and modern Ruby version manager written in Rust

A little bit fast and modern Ruby version manager written in Rust Features Pure Rust implementation not using ruby-build Cross-platform support (macOS

Fast and simple PHP version manager written in rust

[WIP] phpup (PHP-up): Fast and Simple PHP version manager ⚡ Fast and simple PHP version manager, written in rust Features No requirements for system P

A blazingly fast 🔥 Discord bot written in Rust

rusty-bot 🦀 A blazingly fast 🔥 Discord bot written in Rust. Commands name use !rm count deletes old messages !meme subreddit sends a random meme

A fast package manager for NodeJS written in Rust.
A fast package manager for NodeJS written in Rust.

click A fast package manager for NodeJS written in Rust. How fast? Benchmark of bun vs click clean install: Based on benchmarks done with hyperfine, c

A blazinlgy fast 🚀 transpiler written in rust 🦀 that fixes (pun intended) your problems

Pissfix 🚀 Pissfix is a blazingly fast 🚀 programming language that transpiles to a "interesting" and not well known programming language called "Post

Owner
Justin Chen
Justin Chen
MeiliSearch is a powerful, fast, open-source, easy to use and deploy search engine

MeiliSearch is a powerful, fast, open-source, easy to use and deploy search engine. Both searching and indexing are highly customizable. Features such as typo-tolerance, filters, and synonyms are provided out-of-the-box. For more information about features go to our documentation.

MeiliSearch 31.6k Dec 30, 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
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

Microsoft 13 Mar 2, 2023
Brainfuck interpreter written in rust

Brainfuck Interpreter Written in Rust Simple Interpreter that runs bare Brainfuck and extends it with debug command # which prints content of first te

Was 1 Nov 28, 2021
The brainfuck language interpreter written in Rust

The brainfuck language interpreter written in Rust

Jan Štaffa 1 Feb 21, 2022
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
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 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
A thread pool for running multiple tasks on a configurable group of threads.

Threadfin A thread pool for running multiple tasks on a configurable group of threads. Extra features: Dynamic pool size based on load Support for asy

Stephen M. Coakley 46 Dec 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