Skip to content

brianquinlan/brainfuck-jit

Repository files navigation

Brainfuck JIT

Introduction

I started this project to help myself gain a practical understanding of interpreting, compilation and Just-In-Time compilation (JIT). I chose Brainfuck (http://en.wikipedia.org/wiki/Brainfuck) as the source language because it is simple.

The total size of the entire project (including the interpreter, compiler and JIT) is <1,000 lines of C++ code.

Getting Started

To get the source code, build it and run the "Hello, world!" example:

git clone https://github.com/brianquinlan/brainfuck-jit.git
cd brainfuck-jit
make test
./bf --mode=cag examples/hello.b  # Run ./bf --help for a list of execution options.

First Steps

The first step is to acquire a basic understanding of the Brainfuck language. The ability to write programs in it is optional :-)

Then look at the interpreter implementation:

Once you understand the interpreter implementation, the JIT implementation should then be understandable:

The compiler implementation requires a bit of assembly knowledge to understandable:

About

A simple Brainfuck JIT written as a learning exercise.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published