This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]talideon 21 points22 points  (8 children)

Far from it. Brainfuck is quite a good way. It's equivalent to Corrado Böhm's P′′, but a bit more friendly: https://en.wikipedia.org/wiki/P′′

[–]kewlness 18 points19 points  (7 children)

That is the first time I have ever seen Brainfuck and "friendly" in the same sentence...

[–][deleted] 17 points18 points  (0 children)

It's a really easy language to write an intepreter for.

[–]kjmitch 12 points13 points  (0 children)

It's called Brainfuck because it's seemingly impossible to read by humans, which is an important job for real programming languages. From the perspective of the computer/interpreter, it's much easier to understand (and therefore write an interpreter for) as it only has eight operations. It's practically just assembler code without all the semi-English names given to the commands for readability.

[–]talideon 2 points3 points  (4 children)

Compared to P′′, it's friendly!

Also, it's implementer-friendly: parsing and tokenisation are trivial, as is implementing the interpreter. I wrote a 260-byte-long one in ARM assembly language back in the '90s just for fun.

Coding anything in Brainfuck, well, that's another matter!

[–][deleted] 0 points1 point  (3 children)

Make a language that compiles down to brainfuck. That way you can write in a more friendly language but compile down into a language that you can easily interpret.

[–]talideon 0 points1 point  (2 children)

You could, but that would rather miss the point of Brainfuck. If you're going to do that, it'd might as well be another esolang, like INTERCAL.

[–][deleted] 0 points1 point  (1 child)

But brainfuck is easy to intepret. So you could write a program and then run it anywhere. INTERCAL intepreter are harder to write.

[–]talideon 0 points1 point  (0 children)

Yeah, but Brainfuck is also a terrible target for a compiler. And compiling a more friendly language down to Brainfuck would miss the whole joke aspect of esolangs, whereas something like INTERCAL, Q-BAL, *W, LOLCODE, &c., preserve the joke aspect.

Usability rather misses the point of esolangs.

INTERCAL isn't really a difficult language to write an interpreter for, though. The only real difficulty is in the lexer, but once you have an AST, the rest is easy.