Quote:
|
Originally Posted by InfoGeek
I think compile humanly here means to understand what a program is doing just by looking at it.
|
No, I think it's more literal than that. Making a Befunge interpreter is fairly simple; it's relatively easy to see how one would do it. But compiling Befunge into machine code is a different matter entirely.
The main problem is that Befunge is self-modifying. Thus, if you were to translate Befunge into machine code, you'd need an index table to connect each set of machine code instructions with a two dimensional vector that points to the original Befunge cell. The next difficulty is that you'd need to be able to translate Befunge to machine code, and vice versa, in the compiled executable. There's also the problem of turning two dimensional Funge-space into one dimensional assembly - many jumps would be needed.
Indeed, once you're finished packing in all the things you need, you've got a compiler that is barely more than a glorified interpreter. I think this is what the Wikipedia article meant when it said Befunge was difficult to compile.
Quote:
|
Originally Posted by v0id
Arevos did show his version of a Brainf*ck interpreter in Python.
Here's mine in C.
|
Nice work!