Bukkake

From Esolang
Jump to: navigation, search

Bukkake is an esoteric programming language extending brainfuck with primitives for multithreading. It adds three characters for spawning, blocking, and declaring another procedure. The comparability of procedures to C or Java procedures is limited because in order to "call" such a procedure, one must spawn another thread.

Structure

A file is a series of lines, and each line is a procedure; thus the newline character has meaning in Bukkake, both as a separator and as an exit. The asterisk character spawns a thread relative to the current line according to the current byte. The vertical bar waits until all threads with a vertical bar in their line have reached the bar.

Examples

A forkbomb can be written in two characters:

 **

The initial thread will create two new copies of itself and terminate, but each new copy will also create two copies, consuming the resources of the host machine.

Deadlock can be achieved in three characters:

 |*|

The initial thread will pass the first barrier because it will be the only thread but after spawning another thread it will wait at the second barrier while the new thread waits at the first, causing deadlock.

Futures

A future procedure call could be created by spawning a relative thread and later waiting for that thread to set a byte to zero.

Backwards Compatibility

A bukkake interpreter can run any brainfuck program (so long as it lacks all of the three new characters) without any change in behavior.

Further reading

Bukkake JIT Compiler/Interpreter