Hacker News new | past | comments | ask | show | jobs | submit login

Intercal is the reason I just chuckle when people say brainfuck is an esoteric programming language.

And also why I cry when people create languages that are one simple regex away from brainfuck and call those esoteric.

Soo also: Malbolge, so evil that the only non-stupid programs in it were generated by LISP scripts




To be fair, the point of Brainfuck was about interpreter size: the idea was to create an interpreter that could fit in 256 bytes or less of 68000 assembly language. Brainfuck and its ilk (and I'd include Malbolge/Dis in that) are simply just a branch of esoteric language: the minimalist languages. Intercal is in the weird family. Then you've the likes of Befunge, Q-BAL, and *W, and most of the stuff Chris Pressey has done over the years, which are in the experimental family.

It's a broad church.


My favorite weird language is SNOBOL. It is a dynamic language with utterly alien syntax. In some ways, the syntax is even more minimal than that of Lisp. It has very unusual control flow: each statement can succeed or fail, and at the end of a line you may specify a label to goto on success, on failure, both, or neither.

Embedded within this language is an incredibly powerful string pattern matching facility, which predated regex popularity. I think regex is probably as expressive, but I find SNOBOL more comprehensible.

One of my favorite books from the late 70s/early 80s was the SNOBOL book by Griswold, Poage and Polonsky: http://www.thriftbooks.com/w/snobol-4-programming-language-a.... Short, clear, and a great user guide and reference to this bizarre language. I rank it with K&R as one of the great programming language books. (Or maybe nostalgia is getting the better of me.)

I took two compiler courses from R. B. K. Dewar, who was on the team that built the SPITBOL implementation of SNOBOL for IBM mainframes, a really fantastic set of courses from a great teacher. He talked about implementing SPITBOL, in the days when you could get maybe one run a day from the mainframe. By being exceedingly thoughtful and careful, they got the compiler implemented and running in twenty compile/debug cycles.


Were you aware that the original 1972 INTERCAL compiler was written in SPITBOL?


No!


I appreciate Brainfuck for its originality, but I agree with the grandparent that its influence on "esoteric languages" is too strong. Not only are many "esoteric languages" just Brainfuck+something (eg. http://esolangs.org/wiki/Category:Brainfuck_derivatives ), but also having Brainfuck as the default "minimalist language" is also unfortunate. For example, a NASA study on self-replicating machines ( http://www.niac.usra.edu/files/studies/final_report/883Toth-... ) mentions it on page 43:

> ...we thought that our Controller subsystem should also be as simple as possible. We spent quite a bit of time looking at the simplest implementation of a Turing machine, running the simplest possible language, BrainF[uck] (also called BF) - the smallest Turing-equivalent language in existence, having only eight instructions.

As another example, the "minimalism" of Brainfuck has been used to minimise bias when measuring the performance of AI systems: http://arxiv.org/abs/1109.5951

However, when it comes to minimalism, Brainfuck is actually rather complicated. As mentioned above, it has 8 instructions ("+", "-", ",", ".", "<", ">", "[" and "]"), but there are several languages which only require one instruction http://esolangs.org/wiki/OISC

Brainfuck also separates code from data, which causes it to bloat (eg. we have an instruction pointer into the code and a cursor into memory). Many languages don't do this, for example Turing machines, lambda calculus, and even some of the languages on the OISC link above like BitBitJump http://esolangs.org/wiki/BitBitJump

Brainfuck also has built-in IO primitives ("," and "."), whereas other languages like Lazy K ( http://esolangs.org/wiki/Lazy_K ) encode their IO as streams or monads.

Brainfuck also requires arbitrary implementation decisions like word size and memory size, unlike eg. Flump ( http://esolangs.org/wiki/Flump ) which allows any amount of numbers of any size, written in unary (eg. "11111" for 5) and delimited by zeros (eg. "0111011" for 3 followed by 2).

Brainfuck requires an instruction pointer to keep track of which instruction it's up to in the program, unlike purely functional languages which can be evaluated in any order, like Binary Lambda Calculus http://en.wikipedia.org/wiki/Binary_lambda_calculus

There are also arbitrary implementation decisions like what happens when integers overflow, what happens when the cursor overflows the memory, etc. which are complete non-issues when there's no word size, no external memory, etc.

These other languages can also be easier to implement than Brainfuck. For example, I wanted a simple language to embed in a Javascript search algorithm ( http://chriswarbo.net/essays/optimisation/levin.html ) and chose BitBitJump.

The code is at http://chriswarbo.net/js/optimisation/levin_bbj.js and is mostly dedicated to the search algorithm. The BitBitJump implementation is just these two lines, inside one of the loops:

    mem[read_address(counter, m)] = mem[read_address(counter+m, m)];
    counter = read_address(counter+2*m, m);
`m` is the word size (constant during a program execution), `counter` starts at 0, `mem` is an array of bits and `read_address(x, y)` converts those bits into a Javascript int (reading `y` bits, starting at index `x`).


> Brainfuck is actually rather complicated. As mentioned above, it has 8 instructions [...] > but there are several languages which only require one instruction.

True enough, but I would say the crucial difference is that Brainfuck's eight instructions have no parameters, whereas all single-instruction languages use one or more operands in order for their lone instruction to have multiple effects.


Insofar as most Brainfuck derivatives are boring and it's had an excessive impact on the field, I agree with you entirely. Believe me, I'm quite aware of all this stuff: I used to be pretty active on Panu's esolang list back in the day; you're preaching to the choir here.


It's gotta be similar to the difference between esoteric art in a large museum, and esoteric art in a small gallery the size of a closet. Sometimes you get so far out in your studies that you can't even realize the people around you don't have the faintest clue of even how to get to your headspace, let alone understand it. There's esoteric languages that look different, but still follow some standardization of language, then there is esoteric that questions every standard convention through the realization of the absurd.


Here it is, genetic algorithm based malbolge generation : http://acooke.org/malbolge.html


tried Piet? it's a good looking esoteric programming language :)


As someone that dabbled in code golfing using Piet, it's no different from any other language: Your creation can be ugly or things of beauty.

I tend to produce ugly Piet programs :)




Registration is open for Startup School 2019. Classes start July 22nd.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: