vanheusden.com

Brainfuck compilersuite

After implementing a "Brainfuck to COBOL"-compiler I became inspired to implement other compilers as well.

Below you will find the whole collection of brainfuck compilers and how well the resulting code performs.
For each I tested the run-time of the brainfuck mandelbrot implementation. Where possible I used the "-flto -O3 -march=native -fomit-frame-pointer" compiler flags.
The compilers to do these compilations/conversions are in GitHub.

languagerun time (HH:MM:SS.hh)remarks
6502 asm (C64) Vice 3.0.0.dfsg-2
Ada00:00:02.65GNAT 6.1.1
ArduinoNano328: 00:18:14.89
ESP8266: 00:02:55.97
Nano328 with Arduino 1.0.5 environment
ESP8266-F with Arduino 1.6.6 environment
ARM asmRPI 1b: 00:00:26.98
RPI 2: 00:00:11.74
RPI 3: 00:00:07.54s
RPI 4: 00:00:03.71s
RPI = Raspberry Pi
Bash05:15:584.3.24(1)
C00:00:01.61GCC 5.3.1-14
C#00:00:04.32Mono C# 4.2.1.0
Cobolcobc: 00:02:54.37
cobc+gcc: 00:02:50.48
OpenCOBOL 1.1.0
GCC 5.3.1-14
Go00:00:03.58Go 1.6
HLASMIBM system z (mainframe)
Java00:00:10.66java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.2) (7u65-2.5.2-2)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
Javascript (nodejs)00:00:06.24nodejs 4.2.1~dfsg-1
Lualua: 00:03:07.18
luajit: 00:00:09.04
Lua 5.2.3
Lua jit 2.0.4
MIPS
Pascal00:00:03.73fpc 3.0.0+dfsg-6
compiler switch: -O4
PDP-1100:03:02simh V3.8-1
Perl 500:02:16.39perl 5.22.1
Perl 600:42:48.15
00:13:41
2016.05
2020.12+dfsg-1
PHP00:01:22.60PHP 5.6.16-2 (cli)
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
PL/100:04:32.780.9.9a (Iron Spring compiler)
PowerShell
Pythonnuitka: 00:02:11
python 2: 00:02:58.05
python 3: 00:03:11.86
pypy: 00:00:08.12
pyston: 00:01:59.84
shedskin: 00:00:01.95
py2many: 00:00:02.21
nuitka 0.5.25
python 2.7.9
python 3.4.2
pypy 5.3+dfsg-2
pyston 0.5.0
shedskin 0.9.4-1 (with -borsw switches)
py2many: C++ target
Ruby00:01:41.96ruby 2.1.2p95 (2014-05-08)
Rust00:00:01.30rust 1.14.0+dfsg1-3
Scala00:00:51.46Scala code runner 2.11.8
SDL Basic00:22:23.000.0.20070714-5
SPARCSunOS 5.6
x86 asm00:00:01.48x86 assembler, at&t syntax
Z80 asm (MSX)06:48:50OpenMSX 0.13.0-1+b1

changes

examples

Source file: mandelbrot-brainfuck-code.zip




For contact info, see this page.

mastodon icon toot this