Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A brief introduction to esoteric programming languages (hillelwayne.com)
143 points by henrik_w on May 20, 2021 | hide | past | favorite | 44 comments


I really like You are Reading the Name of this Esolang[1] (pronounced "you are hearing the name of this esolang") as a concept. Essentially it's brainfuck, Huffman encoded into a stream of ones and zeroes, with brackets added that evaluate to 0 or 1 depending on whether the subprogram contained within the brackets halts or loops forever.

My favorite thing about esolangs is using them as a chance to try out a design choice that's interesting but not necessarily good. Like what does making gotos an expression do to a simple lisp-y language? Designing and implementing languages is what I was most interested in in programming for a while and esolangs are a nice low-stakes way to practice that for me.

[1] https://esolangs.org/wiki/You_are_Reading_the_Name_of_this_E...


My favorite esolang, not mentioned in the article, is Malbolge[1], simply because it's so difficult to write working programs in that it took two years for the first program to be found, which was discovered (not written) using a heuristic graph search algorithm.

[1] https://esolangs.org/wiki/malbolge


My favorite is BytePusher. It's a virtual machine with audiovisual support.

https://esolangs.org/wiki/BytePusher

To this day I wonder why this isn't a standard feature of every programming language virtual machine out there.


My favorite would have to be (Modular) SNUSP[1]. The combination of two-dimensional control flow with one-character recursion is completely irresistible to me. If it just had support for pointers, my life would be complete.

[1] https://esolangs.org/wiki/SNUSP


It’s in the article, but not the talk.


> I didn’t cover [INTERCAL] because the gags aren’t that interesting.

I'm fairly certain that INTERCAL introduced 'COME FROM'.

They later made a concurrency scheme based on multiple COME FROMs addressing the same label.


> I'm fairly certain that INTERCAL introduced 'COME FROM'

Yep. In fact, INTERCAL uses labelled COMEFROM, e.g. `COMEFROM foo`, in analogy to labelled GOTO like `GOTO foo`.

If you think that's silly, there are languages which have an unlabelled COMEFROM, which doesn't even specify where it's going to take over control from! This symbol is usually written `catch` or `except`.


Conditional threats: "If then, or else"


Being polite to the compiler, but not overly polite.


I was thinking of designing a language like that where you'd have to shift gears to make the program go at the right speed, otherwise it would stall.


In the actually used department of esoteric languages, there’s the TeX macro language. It’s Turing complete but also completely sui generis. Especially the whole cat code aspect of the language where any character can have any significance and it’s possible to make inaccessible token sequences.


Chef is an esoteric language where programs look like recipes. Someone made a "Hello World" that also produces an edible result: http://www.mike-worth.com/2013/03/31/baking-a-hello-world-ca...


That is absolutely hilarious. I'm trying to imagine a 50K line GUI program as some kind of 10 course meal for 30 people :)


What is the most esoteric programming language under the programming languages that were not intended to be esoteric? The first language that comes to my mind is APL. Any body having a better suggestion?


Hard to pick a winner, since the most esoteric languages will be those that were only ever used by their creators, and there are many of those :-) But listing candidates is fun anyway. Here are a few:

SNOBOL, an early string-based pattern-matching language

K, a database query/programming language

PROSE, a dynamic systems modeling language from the 1970s that introduced automatic differentiation

Among languages most people would have heard of, though, my vote for the most esoteric goes to Prolog.


C++ template metaprogramming is a purely functional language embedded in C++, which lets you do crazy things like embed λ-calculus[0] in it.

[0] https://matt.might.net/articles/c++-template-meta-programmin...


GNU Make.

It's actually a metaprogrammable functional programming language. It's possible to do a ridiculous amount of stuff in it. For example, I managed to write a pure GNU Make implementation of the find command. I tried to implement a small version autoconf as well but stopped because I could no longer understand what was going on.


All the C-like languages (probably Rust is the best modern example). Filled with random characters that means bunch of different stuff, instead of just having a lisp-like structure where most things are just normal function calls. Making conditions a separate syntax instead of just a function will never make sense to me.


Some arcane things not intended to be eso:

sendmail.cf configuration file.

text munging languages from the Unix environment, like ed and sed.

text munging languages from elsewhere like Teco.

nroff/troff.

Interactive Vi/Vim commands look like an esolang when you record them into a register and confront what that looks like.


Teco: reminds me of the macro to calculate PI by Stanley Rabonowitz http://stanleyrabinowitz.com/


I'd say Perl is the most esoteric, widely used language. Folks have gotten more verbose with it over the years, but I've encountered line noise in a professional context in perl more than any other.



CMake


There is also Redcode, a combative assembly language that destroys or takes over other programs:

https://en.wikipedia.org/wiki/Core_War

https://www.corewar.io

https://vyznev.net/corewar/guide.html


I wouldn't really describe Redcode as an esolang, though. It was specifically designed for the MARS environment to build battle programs.


One recent favorite of these mentioned in the article is ORCA [1], which is really an incredible little thing. It is essentially a live coding environment for generating MIDI you can send into a synth, with some influence from 2D esoteric languages like Befunge.

It's almost unfair to put it on this list, because it's a genuinely cool and fun way to create music, especially if you're inclined to programming. This video [1] shows off the basic idea very nicely, and you can find lots more examples of it on YouTube. I highly recommend playing around with it if this is the kind of thing you find cool.

[1]: https://github.com/hundredrabbits/Orca

[2]: https://www.youtube.com/watch?v=gSFrBFBd7vY


No matter how cool it is, it is an esoteric way to do programming, hence the classification. (Not just Orca but there are several esoteric languages that are still useful from time to time.)


Some idioms from the golf langs are quite neat. Common string, array, date and control flow operations are often quite verbose in normal languages (while doing very little) so I wouldn't mind to have some super-compact options in normal languages for that.


Ruby does ship with an optional interpreter executable named goruby [1], that automatically abbreviates every method name and adds otherwise unwanted method aliases so that you can drastically shorten the code.

[1] https://rbjl.janlelis.com/34-do-you-know-the-official-ruby-i...


My favorite is FizzBuzzLang[0] it uses combinations of FIZZ and BUZZ to write programs.

I found it last year and planned to contribute to the interpreter.

[0] https://fizzbuzzlang.com/


Haha...thank you! I made FizzBuzzLang. All contributions to the interpreter or the spec are welcome.


One of my favorite esolangs is FRACTRAN[0], because at first glance it seems impossible to write any programs in, but a little insight from number theory (concerning prime factorization) makes it tractable. I even wrote a compiler for FRACTRAN in Haskell[1].

[0] https://en.wikipedia.org/wiki/FRACTRAN

[1] https://github.com/siraben/hasktran


They should extend the Shakespeare language to make all his plays compile. Computers would be the first entities to fully understand King Lear.



One of my favorites is "Whitespace" which could used as a polyglot esoteric language (e.g. to deliver "hidden" code): https://esolangs.org/wiki/Whitespace


I really like "minimalist" languages, and wrote about a few examples (and why Brainfuck is overly complicated) at http://chriswarbo.net/blog/2014-12-22-minimal_languages.html

My favourite language is SK (combinatory logic), which is both tiny (two symbols + parentheses; one rewrite rule each) and reasonably sane (unlike, say, Iota). It's also useful, since it's basically just function definition and application, which is applicable to pretty much every "proper" programming language. Hence the 'puzzle solving' we do in SK can give real insights into day-to-day understanding of programming. For example, to make an if/then/else branch in SK we end up using Church encoding, which was quite enlightening to me.

In particular, I always thought of booleans as bits: a fundamental component of our computers; and of languages "sitting above" those bits, controlling them (and, in turn, being controlled by them; since programs are stored as bits, and we can write self-modifying code). From that perspective, the idea of representing booleans as functions seems backwards.

However, I found it intriguing to go down this "backwards" rabbit-hole: if Church-booleans are functions/programs that make a choice, then a bit is also a program that makes a choice. Passing around bits, in a language like C, is just like passing around higher-order functions in a language like SK (or lambda calculus, or whatever). The main difference is that booleans/bits aren't "native": we can't call them directly. They must be interpreted, and the interpreter is called 'if/then/else'.

On the topic of Church-booleans, it can be similarly enlightening to see how Smalltalk implements branching using polymorphism, with a 'True' class and a 'False' class which override the 'ifTrue:ifFalse:' method of the 'Boolean' class in different ways. After a little pondering, we realise that those method definitions are the Church-booleans; and hence polymorphism/dynamic-dispatch is a higher-order function call. Then we find that objects are a poor man's closures, and that closures are a poor man's object. The deeper we go, the more blurred our once-crisp distinctions become, the more of our unconscious assumptions fall away, until everything can be twisted into anything else, and it all becomes a matter of perspective.

None of these perspectives are "more correct" than any other, although some are certainly more consistent and practical than others. Hence playing with esoteric/minimalist languages can force us to learn unfamiliar mechanisms, and learn new uses for familiar mechanisms. This can give us more flexibility and insight when approaching real-world challenges, where a shift in perspective might turn an unsolvable/incompatible mess into a straightforward solution.


By the way, regarding Smalltalk: https://news.ycombinator.com/item?id=27261379


Is orca an esolang? people do use it to make music and are productive with it.


Any example of "testing primes" should be run on 8675309.



For a good prime call.

Also, it's the first of a twin prime. 8675311 is also prime.


My first progrmming language: XSLT. #ouch


I use XQuery for everything. It has a much better syntax


But that's only a derivative of SGML.




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

Search: