Skip to content

d3r1n/brainsuck

Repository files navigation

Brainsuck [WIP]

Brainfuck but not really... like, a better version of it.

GitHub all releases Status

Install

Pre-build binaries with examples can be found in releases
To use Brainsuck's Compiler you'll need to have Rust version 1.50 or higher versions installed.

Build

Requirements:

  • Rust version 1.50 or higher

Linux

curl https://raw.githubusercontent.com/d3r1n/brainsuck/master/install.sh | bash

Windows

  • Clone the repository and cd into it
  • run cargo build --release
  • generated binary will be in target/release (binary name: bs_bin)

Usage:

Help

$ brainsuck [-h, --help]

Interactive Shell

$ brainsuck
$ brainsuck [-o, --optimize]

Execute

$ brainsuck [OPTIONS] <INPUT FILE>

Compile

$ brainsuck [-c, --compile] [OPTIONS] <INPUT FILE>

Automatic allocation is not supported in compilation right now.

Options

  • [-m, --mem-size]: Sets the program's memory size. (default: 1024)
  • [-p, --ptr-loc]: Sets the program's memory pointer location. (default: 512)
  • [-a, --auto]: Automatically allocates memory for the program. (default: false)
  • [-o, --optimize]: Optimize the Parser and Interpreter (default: false)
  • [-c, --compile]: Compile the program to a binary (default: false)

Versions History

  • v3.0 [Next]
    • Adding more functionality and more keywords (Main Feature)
    • Adding JiT compilation [LLVM] (Main Feature)
    • Adding LLVM compilation (Main Feature)
    • Adding support for debugging (Main Feature)
    • Adding support for making system calls (Main Feature)
    • Adding support for cross-platform compilation
  • v2.75 [Now]
    • Adding a compiler based on Rust (Main Feature) see Usage ^
    • Minor bug fixes
    • Re-structed the code
  • v2.5 [Previous]
    • Optimized the Parser and Interpreter (Main Feature)
    • Improved speed (3x-100x times faster optimized) (Main Feature)
    • Bug fixes
  • v2.0
    • Added Interactive Shell (Main Feature) see Usage ^
    • More bug fixes
  • v1.5
    • Automatic Memory Allocation (Main Feature)
    • New way of argument handling
    • Some bug fixes
  • v1.0
    • Initial Verison of Brainsuck

Programs:

Hello, World!

Mandelbrot Set

Click to expand

Errors

File Not Found

Syntax Errors

Memory Overflow Errors

TODO:

  • Add basic brainfuck commands.
  • Add automatic memory allocation.
  • Add repl
  • Add optimization
  • Add Rust based compiler
  • Add LLVM based compiler
  • Add LLVM based JiT compiler
  • Add custom keywords
  • Add support for debugging
  • Add support for making system calls
  • Add support for cross-platform compilation

Mentions:

SpongeBed81 with his language Yearlight