Skip to content

LeMikaelF/mysql-brainfuck

Repository files navigation

MySQL Brainfuck Interpreter

This is an interpreter for the esolang Brainfuck that runs in a single MySQL query (see interpreter.sql). Since Brainfuck is turing-complete, this is part of an ongoing effort to rewrite MySQL in MySQL (just kidding).

It supports all of Brainfuck's operators, it even correctly executes nested loops. The only limitation is that it doesn't do interactive stuff (you give it all the input at the beginning, no interaction is possible during execution).

There is a small test harness with the following toy programs (sources for these programs are in the test file):

  • Generate the fibonacci series
  • Output a single letter (kind of dumb, used as a development aid)
  • Output "Hello, world!"
  • Fizzbuzz
  • Reverse the given input

To run tests

docker-compose up
# wait until DB is up
go test main_test.go -v

About

Brainfuck interpreter that runs as a MySQL query.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages