I would have to assume because it's neither a high-level language, nor a practical low-level one. True in the sense of a language being a labor-saving device.
Ok, that matches my understanding of it then - it is a language, just not one you'd actually want to do anything in. I was thinking that the author was saying it wasn't a programming language in the sense that HTML is not a programming language.
Well… I believe it was James Gosling who said that there are two types of computer languages: “ones people complain about and ones nobody uses”. So if you’re complaining about Brainfuck then it must be a language people use by process of elimination ; )
Author here. We anticipated this as a possible criticism of our "we built the world's tiniest programming language" claim. That's why we wrote the Brainfuck interpreter too. As far as I know, the 99 byte Brainfuck interpreter that's included in this blog post is the tiniest one to date. So even if that invalidates our tiny LISP victory, it'd still be a victory for the team since we built the competition too.
Author here. You know it when you see it. LISP is a tool that people want to use. People write production software using it. For example, this website (Hacker News) was written in LISP. Languages like BrainFuck are usually only called programming languages if the word "esoteric" is attached. There's a real consensus of opinion around this this being a generally held view.
There should ideally be a more compelling explanation of why Brainfuck is an esoteric toy and LISP isn't, than me simply saying "but that's what people believe". I considered going into more depth on this subject. I found a C to Brainfuck compiler written in OCaml and used it to compile a Brainfuck metacircular evaluator into Brainfuck. It ended up being 88,439 bytes of code, and it sadly didn't work, because the compiler isn't very polished. Let's compare ratios. Brainfuck is 99 bytes, whereas Brainfuck written in Brainfuck is 88439 bytes. That's 893x larger. On the other hand, LISP is 436 bytes of systems code and LISP written in LISP is 1370 bytes of LISP. That's 3.14x larger. It's cool that the ratio between layers of simulation with LISP is pretty close to pi. It helps explain why LISP is viewed by human beings as being such a powerful tool, since it lets you accomplish more impact with less effort, without having the castles you build turn into a leaning tower of pisa. Since after all, the purpose of tools since prometheus has been to give people more power.
Would you consider binary lambda calculus [1] [2] a real language?
The 650 byte interpreter written in obfuscated C also sports garbage collection and might fit in a bootsector when translated to x86 code.
Its metacircular interpreter is only 29 bytes (232 bits),
and looks somewhat readable with some syntactic sugar [4]
(analogous to how x86 looks more readable as assembler source).
To me it's missing the point to describe that as Brainfuck versus Lisp. It just turns out that lambda functions and linked lists are higher level abstractions than arrays and pointers. I'd like to see some more variations on that concept and what the size is if using another esolang that has lambda functions.
Counter argument: ever seen the proof for simple addition in English? The verbosity and/or opacity of the definition of a system isn't a great proxy for value or ease of use. Principia Mathematica uses over 1000 pages to reach the proof that 1+1=2, formally defining and explaining everything needed along the way, establishing fundamentals and primitive types and so on.
Brainfuck isn't a great interpreter language. It is a great perspective language. If you can break your tasks down sufficiently that you can express your program in brainfuck, you can take that understanding back to a more performant and expressive language. Doing Rosetta code exercises in esoteric languages forces your brain to model programs with more nuance and detail. If raw machine level performance was the only thing that mattered, we'd be writing everything in assembly. Different languages can have different utility, though, and while brainfuck is less useful as software, it is an excellent tool, not just a toy.
Isn't the distinction as simple as "does the language let you define anything and use recursion?", where I'm going to be a bit handwavy with "define anything" but I think we all get what I mean.
You can't name functions in Brainfuck or recursively call them. You can do so in LISP and Forth. That is also the entire reason Brainfuck explodes in size: it lacks the "semiotic" capabilities required to compress source code (and therefore, structure and refactor code, which is what humans need).
It's almost the opposite of a language, in that it's probably harder to do anything with than just using whatever the native assembly instructions of the machine are. It's explicitly designed to be annoying, an example of a Turing tarpit:
I had this argument once -- I also believe Brainfuck is more of a machine than a language. Whereas Lisp is a language.
The main reason is that Brainfuck lacks composition, so what happens in practice is that people GENERATE Brainfuck code rather than writing it. When you write code, you rely heavily on your programming language's mechanisms for composition in order to make something that works. Someone pointed me to people who DO actually program by hand in Brainfuck. There are some pretty big programs that are hand-written, not generated. Still I'm not entirely convinced, as they seem to be have been constructed through mental feats, not compositional language. It's a curious fact that human languages and programming languages compose in a way that can be leveraged to build very large things that "work". I guess there is some equivalence between building up a large body of knowledge through language and making a program that works. Brainfuck doesn't seem to have this property. The demonstrations of arithmetic and calculus in the post are nice examples of this in Lisp, and from there you have the rest of the world as your disposal (which is well documented in many books). With Brainfuck you're left crawling on your hands and knees, occasionally finding something that works, so to speak.
> A powerful programming language is more than just a means for instructing a computer to perform tasks. The language also serves as a framework within which we organize our ideas about processes. Thus, when we describe a language, we should pay particular attention to the means that the language provides for combining simple ideas to form more complex ideas. Every powerful language has three mechanisms for accomplishing this: > * primitive expressions, which represent the simplest entities the language is concerned with, > * means of combination, by which compound elements are built from simpler ones, and > * means of abstraction, by which compound elements can be named and manipulated as units. Brainfuck is missing any sort of means of abstraction. The primitives are instructions, and the only means of combination is writing instructions in sequence, but there's no way in the language to refer to any sequence of instructions --- no functions, no subroutines, not even labels. This makes it utterly useless as a way to organize your thoughts on how to compute something. [0] http://sarabander.github.io/sicp/html/1_002e1.xhtml#g_t1_002...
As someone who’s spent their career gluing react libraries together, something like this does make me wonder how good some people really are with computers. It’s all the same assembly instructions in the end
Sometimes that kind of work has a lot of impact. For example, people at Google used to joke around about how they hire PhDs to write HTML, but it was important HTML. Just like I'm sure the React libraries you're gluing together are being used for important things. The work I'm doing right now is flashier, but I had to make a lot of personal sacrifices in order to be able to do it.
There quite a few outliers and 10x programmers when you consider that there are millions of programmers. most of us are somewhere in those two quartiles in the middle. Be happy with what you can do and always try to improve don't try to compare yourself to the Einsteins of the world, you'll always be disappointed. be happy that you're good enough to be a professional but always be a little bit restless.
I have sent this article to some folks and plenty of them had the same reaction. A bit like math envy, it is normal to have when you lack a formal education and all you did professionally was writing CRUD apps. It does _not_ mean your work is in any way less meaningful though.
And yeah it is indeed impressive and maybe the coolest thing I've seen this year.
Crazy, DNA uses this trick! "-Os" should search for possibilities here.. I'm wondering if such code breaks any CPUs. I could imagine that it could confuse the code translation that modern x86s do. I mean I bet they don't test this particular corner case...
That's cool. I didn't know. It's nice how having fun hacking on boot sectors can help us discover things mother nature figured out a long time ago. Do you have links you could share where I could learn more about dna coding hacks? For example, I've been reading some of the stuff written by Bert Hubert (known for his work on PowerDNS) who got into biology recently and wrote blog posts like this https://berthub.eu/articles/posts/amazing-dna/
> These comments are fascinating in their own right. Like C comments they have a start marker, like /*, and a stop marker, like */. But they have some more structure. Remember that DNA is like a tape - the comments need to be snipped out physically! The start of a comment is almost always indicated by the letters ‘GT’, which thus corresponds to /*, the end is signaled by ‘AG’, which is then like */. I don't know a whole lot about biology, but learning cool facts like that makes me wonder what would happen if those comment markers were used as parenthesis.
Comments (131) 24 threads
Earlier commentsOh yeah. Who wouldn't splurge if you have a massive 40 bytes left. Beautiful.
Curious why that might be, and TFA doesn't expound. What makes it not a "true" language?
Continue this thread — 2 replies
There should ideally be a more compelling explanation of why Brainfuck is an esoteric toy and LISP isn't, than me simply saying "but that's what people believe". I considered going into more depth on this subject. I found a C to Brainfuck compiler written in OCaml and used it to compile a Brainfuck metacircular evaluator into Brainfuck. It ended up being 88,439 bytes of code, and it sadly didn't work, because the compiler isn't very polished.
Let's compare ratios. Brainfuck is 99 bytes, whereas Brainfuck written in Brainfuck is 88439 bytes. That's 893x larger. On the other hand, LISP is 436 bytes of systems code and LISP written in LISP is 1370 bytes of LISP. That's 3.14x larger. It's cool that the ratio between layers of simulation with LISP is pretty close to pi. It helps explain why LISP is viewed by human beings as being such a powerful tool, since it lets you accomplish more impact with less effort, without having the castles you build turn into a leaning tower of pisa. Since after all, the purpose of tools since prometheus has been to give people more power.
[1] https://www.ioccc.org/2012/tromp/hint.html
[2] https://tromp.github.io/cl/Binary_lambda_calculus.html
[3] https://github.com/tromp/AIT/blob/master/int.lam
Brainfuck isn't a great interpreter language. It is a great perspective language. If you can break your tasks down sufficiently that you can express your program in brainfuck, you can take that understanding back to a more performant and expressive language. Doing Rosetta code exercises in esoteric languages forces your brain to model programs with more nuance and detail. If raw machine level performance was the only thing that mattered, we'd be writing everything in assembly. Different languages can have different utility, though, and while brainfuck is less useful as software, it is an excellent tool, not just a toy.
You can't name functions in Brainfuck or recursively call them. You can do so in LISP and Forth. That is also the entire reason Brainfuck explodes in size: it lacks the "semiotic" capabilities required to compress source code (and therefore, structure and refactor code, which is what humans need).
https://en.wikipedia.org/wiki/Turing_tarpit
The main reason is that Brainfuck lacks composition, so what happens in practice is that people GENERATE Brainfuck code rather than writing it. When you write code, you rely heavily on your programming language's mechanisms for composition in order to make something that works.
Someone pointed me to people who DO actually program by hand in Brainfuck. There are some pretty big programs that are hand-written, not generated. Still I'm not entirely convinced, as they seem to be have been constructed through mental feats, not compositional language.
It's a curious fact that human languages and programming languages compose in a way that can be leveraged to build very large things that "work". I guess there is some equivalence between building up a large body of knowledge through language and making a program that works. Brainfuck doesn't seem to have this property.
The demonstrations of arithmetic and calculus in the post are nice examples of this in Lisp, and from there you have the rest of the world as your disposal (which is well documented in many books). With Brainfuck you're left crawling on your hands and knees, occasionally finding something that works, so to speak.
> A powerful programming language is more than just a means for instructing a computer to perform tasks. The language also serves as a framework within which we organize our ideas about processes. Thus, when we describe a language, we should pay particular attention to the means that the language provides for combining simple ideas to form more complex ideas. Every powerful language has three mechanisms for accomplishing this:
> * primitive expressions, which represent the simplest entities the language is concerned with,
> * means of combination, by which compound elements are built from simpler ones, and
> * means of abstraction, by which compound elements can be named and manipulated as units.
Brainfuck is missing any sort of means of abstraction. The primitives are instructions, and the only means of combination is writing instructions in sequence, but there's no way in the language to refer to any sequence of instructions --- no functions, no subroutines, not even labels. This makes it utterly useless as a way to organize your thoughts on how to compute something.
[0] http://sarabander.github.io/sicp/html/1_002e1.xhtml#g_t1_002...
Continue this thread — 2 replies
And yeah it is indeed impressive and maybe the coolest thing I've seen this year.
Crazy, DNA uses this trick!
"-Os" should search for possibilities here..
I'm wondering if such code breaks any CPUs. I could imagine that it could confuse the code translation that modern x86s do. I mean I bet they don't test this particular corner case...
> These comments are fascinating in their own right. Like C comments they have a start marker, like /*, and a stop marker, like */. But they have some more structure. Remember that DNA is like a tape - the comments need to be snipped out physically! The start of a comment is almost always indicated by the letters ‘GT’, which thus corresponds to /*, the end is signaled by ‘AG’, which is then like */.
I don't know a whole lot about biology, but learning cool facts like that makes me wonder what would happen if those comment markers were used as parenthesis.
All comments shown.
Couldn't load more comments. Check your connection and try again.