Skip to content

The World Famous Optimizing Brainfk Interpreter (With a JIT) ™

Notifications You must be signed in to change notification settings

Headline/brainfk

Repository files navigation

Brainfuck JIT VM

This project started as a result of my boredom, but has become a friendly competition between some folks.

I'd like to say that it's fast, but it does not have a jit (yet). and that's because it is. The execution of the Mandelbrot BF application went from 11 seconds to 1.3 seconds. Scroll down if you'd like to see the comparison.

JIT Optimizations

Of course, multiple basic operations such as >>> and +++ are summed together. This happens at the parsing stage and results in a free speed bonus. The JIT, if enabled, takes these summed operations and compiles them down to machine code (only windows for now). After a majority of the machine code is built, a peephole optimizer scans for any improvements. For now there is only one pattern that will result in a noticeable speed improvement (7%), but more can be added later.

Lets get onto actually seeing the speed difference.

Here's a comparison

License

Public domain. Do what you want.

About

The World Famous Optimizing Brainfk Interpreter (With a JIT) ™

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published