An open API service indexing awesome lists of open source software.

https://github.com/d3r1n/brainsuck

Programming Language Inspired by Brainfuck
https://github.com/d3r1n/brainsuck

brainfuck brainfuck-compiler brainfuck-interpreter compiler interpreter language lexer parser

Last synced: 11 months ago
JSON representation

Programming Language Inspired by Brainfuck

Awesome Lists containing this project

README

          

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](https://github.com/d3r1n/brainsuck/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

```bash
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

```bash
$ brainsuck [-h, --help]
```

Interactive Shell

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

Execute

```bash
$ brainsuck [OPTIONS]
```

Compile

```bash
$ brainsuck [-c, --compile] [OPTIONS]
```
> 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:

- [X] Add basic brainfuck commands.
- [X] Add automatic memory allocation.
- [X] Add repl
- [X] Add optimization
- [X] 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](https://github.com/SpongeBed81) with his language [Yearlight](https://github.com/SpongeBed81/yearlight)