Design and Implementation of a 256-Core BrainFuck Computer [pdf]
sigtbd.csail.mit.edu
sigtbd.csail.mit.edu
BrainFuck as a Service?
I assume the authors intended to mean "1 instructions per cycle" here, but even with that amendment isn't that pretty poor performance for modern CPU? I was under the impression that modern CPUs have peak performance way above 1 IPC, although if that is realizable with BF interpreter is another question. It would have been nice to see comparison to some reasonably high-performance BF compiler.
The Xbox 360's cores fit that model, as well as the original Pentium. They'll execute multiple instructions, but will serialize if there are dependencies (or other constraints that are uarch specific).
An optimizing compiler capable of generating the full gamut of x86 instructions would increase the IPC by at least one order of magnitude, the majority of BF code are boilerplate structures that set up loops, move data around, repeated increments to generate constants etc. Being a very simple language with limited and well defined side effects, it lends itself exceptionally well to reordering.
For reference. This would basically let you almost use BrainFuck. If you wanted to.
From what I can tell, the best bet is using it to to write the source code for another language and run that code since most examples seem to just print strings or increment values.
Is there a meaningful set of primitives one can incrementally build on the core language to make usable code?
An example of a compiler for an even more restricted environment might be
https://github.com/xoreaxeaxeax/movfuscator
Edit: in the same vein there's also
https://esolangs.org/wiki/Higher_Subleq
Further edit: The user Someone posted a link in this thread to several existing compilers that already target Brainfuck (!). That's awesome.
The issue of course is finding an evaluation strategy that doesn't explode the memory complexity as well.
It was doable, and matched security expectations, but it feels like twenty years ago.
The tooling isn't quite there, so you end up working around the compiler and injecting hand written bf, like we used to with assembly.
They gave me a choice of Malboge or Brainfuck, neither of which I knew before the contract.
Did they give you access to a super computer?
But the tooling really isn't there.
Ended up using 'make' and 'm4' as preprocessors to work around things.
I offered an equally crazy budget because of the time and effort for something this crazy, and they said yes on the spot.
+: inc byte [ebx]
-: dec byte [ebx]
>: inc ebx
<: dec ebx
[: cmp byte [ebx], 0
jz endlabel
startlabel:
]: cmp byte [ebx], 0
jnz startlabel
endlabel:
That's ignoring . and , which I expect do not occur very often. (If they did, their compute-focused architecture wouldn't be a good choice anyway.)This is more like 1.3 instructions per command. How did they get their "5"?
There's a reason why CPUs that can execute JVM bytecode directly never caught on: They cannot apply any of the optimizations that a JIT or compiler can.
[1] http://calmerthanyouare.org/2015/01/07/optimizing-brainfuck....
[1] http://www.zachtronics.com/tis-100/ [2] http://www.zachtronics.com/shenzhen-io/