Skip to content

hellerve-pl-experiments/obf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

obf

An optimizing compiler for Brainfuck in Pharo. Compiles to Pharo VM bytecode.

Usage

The easiest access to the compiler is done by accessing the (Glamorous Toolkit) views just by getting a live instance:

BrainfuckCompiler new

You can generate compiled code like this:

"a regular compile"
BrainfuckCompiler new compile: '++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.'.

"or enable optimizations"
BrainfuckCompiler new enableOptimizations compile: '++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.'.

The resulting code can be executed using valueWithReceiver: arguments:. It doesn’t take any arguments and the receiver does not matter, so I usually use self valueWithReceiver: 1 arguments: #().

Installation

Metacello new
	repository: 'github://hellerve/obf:main/src';
	baseline: 'Brainfuck';
	load

Have fun!

About

An optimizing Brainfuck compiler in Pharo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published