Skip to content

Commit

Permalink
New version: v2.75
Browse files Browse the repository at this point in the history
  • Loading branch information
d3r1n committed May 29, 2022
1 parent d729f18 commit 89c1182
Show file tree
Hide file tree
Showing 17 changed files with 502 additions and 103 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
target*
./brainsuck
test.bs
target*
8 changes: 5 additions & 3 deletions Benchmarks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ Mandelbrot Set
--------------
Optimized: took 5.399 seconds with 1024 bytes of memory at pointer location 512 (no auto-allocation)
Unoptimized: took 13.773 seconds with 1024 bytes of memory at pointer location 512 (no auto-allocation)
Compiled + Optimized: took 2.08 seconds with 1024 bytes of memory at pointer location 512 (no auto-allocation)

Hello World
-----------
Optimized: took 0.002 seconds with 1024 bytes of memory at pointer location 512 (no auto-allocation)
Unoptimized: took 0.012 seconds with 1024 bytes of memory at pointer location 512 (no auto-allocation)
Compiled + Optimized: took 0.001 seconds with 1024 bytes of memory at pointer location 512 (no auto-allocation)

Factorial
---------
TERMINATION AFTER 1 SECOND

Optimized: reached "354996793146960497053355363383973425965094809743694491885455534984190204750249968830591340591162785093141951525209177997501478084577063512837513105442388103085116949108248219929177667335850225156399124325817472036634653562449665740610033707601842063277098323069015230061026956365247457276593902258859903874498560000000000000000000000000000000000000000000000" with auto-allocation
Unoptimized: reaced "68514381077363375931297585133106871211263298280533036933892918251948709516798243984304128734094417522976396644365371353517785270323373257977640029350380903895427571177891906446331289795819093455185030994882772103070488137552785487937736505567155518212479976352319939401778202578492759254382623135959961447778222080000000000000000000000000000000000000000000000" with auto-allocation
Optimized: took 2.739 seconds and reached "11978571669969891796072783721689098736458938142546425857555362864628009582789845319680000000000000000" with 1024 bytes of memory at pointer location 512 (no auto-allocation)
Unoptimized: took 2.927 seconds and reached reaced "68514381077363375931297585133106871211263298280533036933892918251948709516798243984304128734094417522976396644365371353517785270323373257977640029350380903895427571177891906446331289795819093455185030994882772103070488137552785487937736505567155518212479976352319939401778202578492759254382623135959961447778222080000000000000000000000000000000000000000000000" with 1024 bytes of memory at pointer location 512 (no auto-allocation)
Compiled + Optimized: took 0.001 seconds and reached "68514381077363375931297585133106871211263298280533036933892918251948709516798243984304128734094417522976396644365371353517785270323373257977640029350380903895427571177891906446331289795819093455185030994882772103070488137552785487937736505567155518212479976352319939401778202578492759254382623135959961447778222080000000000000000000000000000000000000000000000" with 1024 bytes of memory at pointer location 512 (no auto-allocation)
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 32 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@

<h1 align=center>Brainsuck</h1>
<h1 align=center>Brainsuck [WIP]</h1>

<p align=center>Brainfuck but not really... like, a better version of it.</p>

<div align=center>
<img alt="GitHub all releases" src="https://img.shields.io/github/downloads/d3r1n/brainsuck/total?color=%235caef2&label=downloads&logo=github&style=for-the-badge">
<img alt="Lines of code" src="https://img.shields.io/tokei/lines/github/d3r1n/brainsuck?style=for-the-badge">
<img alt="Status" src="https://img.shields.io/badge/STATUS-WIP-brightgreen?style=for-the-badge">
</div>

<h2>Install</h2>

Pre-build binaries with examples can be found in [releases](https://github.com/d3r1n/brainsuck/releases/)
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.

<h2>Build</h2>

Expand Down Expand Up @@ -48,28 +49,42 @@ $ brainsuck [-o, --optimize]
<h4>Execute</h4>

```bash
$ brainsuck <INPUT FILE> [OPTIONS]
$ brainsuck [OPTIONS] <INPUT FILE>
```

<h4>Compile</h4>

```bash
$ brainsuck [-c, --compile] [OPTIONS] <INPUT FILE>
```
> Automatic allocation is not supported in compilation right now.
<h4>Options</h4>

- **[-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)

<h2>Versions History</h2>

- **v3.0** *[Next]*
* Adding more functionality and more keywords (Main Feature)
* Adding a compiler based on LLVM (Main Feature)
* Adding a transpiler to C and Rust (Main Feature)
* Adding JiT compilation (Main Feature)
- **v2.5** *[Now]*
* 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** *[Previous]*
- **v2.0**
* Added **Interactive Shell** (Main Feature) `see Usage ^`
* More bug fixes
- **v1.5**
Expand Down Expand Up @@ -110,12 +125,15 @@ $ brainsuck <INPUT FILE> [OPTIONS]
- [X] Add basic brainfuck commands.
- [X] Add automatic memory allocation.
- [X] Add repl
- [x] Add optimization
- [X] Add optimization
- [X] Add Rust based compiler
- [ ] Add LLVM based compiler
- [ ] Add LLVM based JiT compiler
- [ ] Add custom keywords
- [ ] Add macros
- [ ] Add a compiler
- [ ] Add transpiler
- [ ] Add a JiT compiler
- [ ] Add support for debugging
- [ ] Add support for making system calls
- [ ] Add support for cross-platform compilation


---

Expand Down
2 changes: 1 addition & 1 deletion bs_bin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bs_bin"
version = "2.5.0"
version = "2.75.0"
edition = "2021"

[dependencies]
Expand Down
Loading

0 comments on commit 89c1182

Please sign in to comment.