All Projects → liancheng → brainsuck

liancheng / brainsuck

Licence: other
A simple optimizing Brainfuck compiler (used as the demo for my QCon Beijing 2015 talk)

Programming Languages

Brainfuck
56 projects
scala
5932 projects

Projects that are alternatives of or similar to brainsuck

BrainfuckIDE
A Brainfuck IDE/debugger designed to be intuitive, featureful and visually appealing
Stars: ✭ 77 (+40%)
Mutual labels:  brainfuck
llvm-brainfuck
Brainfuck compiler based on LLVM API
Stars: ✭ 27 (-50.91%)
Mutual labels:  brainfuck
bf256
Brainfuck compiler under 256 bytes in size.
Stars: ✭ 21 (-61.82%)
Mutual labels:  brainfuck
Brainfuck
A flexible Brainfuck / Brainloller / Braincopter interpreter in Swift 3.1.
Stars: ✭ 13 (-76.36%)
Mutual labels:  brainfuck
brainfuck
A simple brainfuck interpreter in Rust.
Stars: ✭ 18 (-67.27%)
Mutual labels:  brainfuck
vbf
A brainfuck interpreter/compiler written in V.
Stars: ✭ 17 (-69.09%)
Mutual labels:  brainfuck
rathilang
A small gift for someone who did big things (Python Package)
Stars: ✭ 14 (-74.55%)
Mutual labels:  brainfuck
bfboot
A full brainfuck to bootable OS image compiler.
Stars: ✭ 35 (-36.36%)
Mutual labels:  brainfuck
rot13
This is a collection of ROT13 encoding programms written in different languages. Just for fun.
Stars: ✭ 24 (-56.36%)
Mutual labels:  brainfuck
BrainF.Net
A .NET brainfuck code parsing and execution library
Stars: ✭ 23 (-58.18%)
Mutual labels:  brainfuck
brainhug
A simple brainfuck translator crate in Rust
Stars: ✭ 14 (-74.55%)
Mutual labels:  brainfuck
brainfuck2wasm
A brainfuck-to-WebAssembly compiler
Stars: ✭ 36 (-34.55%)
Mutual labels:  brainfuck
ojisan f-ck
おじさん風文章を解釈して動く Brainfuck interpreter
Stars: ✭ 20 (-63.64%)
Mutual labels:  brainfuck
Headache
Programming Language that compiles to 8 Bit Brainfuck
Stars: ✭ 59 (+7.27%)
Mutual labels:  brainfuck
AshBF
Over-engineered Brainfuck optimizing compiler and interpreter
Stars: ✭ 14 (-74.55%)
Mutual labels:  brainfuck
bfpy
Python to Brainfuck transpiler
Stars: ✭ 39 (-29.09%)
Mutual labels:  brainfuck
BfBf
A Brainfuck interpreter written by Brainfuck.
Stars: ✭ 37 (-32.73%)
Mutual labels:  brainfuck
harbor
A language that ports⚓: examining the limits of compilation⚙️.
Stars: ✭ 81 (+47.27%)
Mutual labels:  brainfuck
FasterBrainfuckProgramming
This project is to make brainfuck language programming easier, faster and more powerful .. everything is made out of functions making it very easy to port to other languages
Stars: ✭ 19 (-65.45%)
Mutual labels:  brainfuck
Klipse
Klipse is a JavaScript plugin for embedding interactive code snippets in tech blogs.
Stars: ✭ 2,841 (+5065.45%)
Mutual labels:  brainfuck

Brainsuck

Brainsuck is an optimizing compiler prototype for the Brainfuck programming language. It's written in Scala using the same technologies used in Spark SQL's Catalyst optimizer. It's minimum, and only consists of 292 lines of code (test code not included). This project is designed for my QCon Beijing 2015 talk.

How to build

$ sbt stage

Run

Use the following command line to run the Hanoi tower example:

JAVA_OPTS=-Xss8m ./target/universal/stage/bin/brainsuck scripts/hanoi.b -O 2

The -O flag is used to specify optimization level (0, 1, or 2). -O 0 disables all optimizations.

Brainsuck uses recursion extensively for conciseness. That's why you need to specify stack size to avoid stack overflow. These recursions can be easily removed, but this makes the codebase unnecessarily bloated. Anyway, this is only a demo for a talk :^)

Acknowledgement

This project is inspired by brainfuck optimization strategies authored by Mats Linander.

Licence

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].