4 ms·
So... The compiler itself is insanely efficient (I have heard that it is on the order of ~200 bytes). However, the compiled code is probably nowhere near as eff
by newt0311 18y ago
So... The compiler itself is insanely efficient (I have heard that it is on the order of ~200 bytes). However, the compiled code is probably nowhere near as efficient simply because the high level constructs are hidden from the compiler. Furthermore, the time that you will save in execution, you will lose many times over in writing the program (this by the way is why no one should ever develop in C/C++ unless it is absolutely necessary). BF is primarily a joke as well as an interesting exercise in what is needed for completeness.
- silentbicycle 18y agoIt's not "insanely efficient", it's just really small. Like Forth, but without the expressive power, conceptual elegance, efficiency, or speed of development. :) I wrote a bf interpreter a few weeks ago. (It's one of those things which is just tricky enough to be good for trying out languages, btw.) You can't call anything that makes you deal with strings by repeatedly incrementing cells to set ASCII codes efficient, seriously. One of my test programs was a rot-13 program, and it was slo-o-o-o-o-ow. Also (wear a helmet before you read this ;) ), there's an i386 native code brainfuck compiler, written in brainfuck: http://www.nada.kth.se/~matslina/awib/ http://www.nada.kth.se/~matslina/awib/