
Esoteric Topics in Computer Programming (2002) - pmoriarty
http://web.archive.org/web/20020609152409/www.catseye.mb.ca/esoteric/index.html
======
exDM69
I've said it before and I'll say it again: go and learn Brainfuck. Just write
a program that outputs your name or does FizzBuzz or something trivial, that's
enough to get a grasp of it.

Brainfuck is to Turing machines what Lisp is to Lambda calculus. Minimum
viable amount of syntactic sugar (and a bit of "semantic sugar" as well, it's
nicer to work in bytes than bits) to make it usable as a programming language.

Lambda calculus is just a bit more practical formalism than Turing machines,
that's why Lisp is genuinely useful as a programming language, unlike
Brainfuck. That doesn't make learning about Turing machines any less useful as
a brain teaser exercise.

~~~
YeGoblynQueenne
>> Brainfuck is to Turing machines what Lisp is to Lambda calculus.

Indeed, the lambda calculus was never meant as a real programming language.

~~~
joelg
> Indeed, the lambda calculus was never meant as a real programming language.

In fact, not even Lisp itself was originally meant as a real programming
language! McCarthy invented it as a notation for mathematical proofs, and one
of his grad students thought it might make a good language.

~~~
nickpsecurity
Never knew that. That's a trip. Great accident to have in one's career given
all that came of it.

~~~
AnimalMuppet
[http://www.paulgraham.com/icad.html](http://www.paulgraham.com/icad.html)

Look for the section heading "Catching Up with Math".

~~~
nickpsecurity
That was a good read. Appreciate the link.

------
talideon
Chris' site didn't go anywhere, it just changed URLs:
[http://catseye.tc/](http://catseye.tc/)

~~~
yoha
Thanks for the link!

However, it seems like the page linked in the post is not available anymore.

~~~
talideon
Well, you are talking about a gap of 14 years: the site's been reorganised
since then, but all the content is still there.

------
robert_tweed
One of my favourite examples is the blank C program that won the "Worst Abuse
of the Rules" award in the 1994 Obfuscated C Code contest (last entry here):

[http://web.archive.org/web/20020615054101/http://www.nyx.net...](http://web.archive.org/web/20020615054101/http://www.nyx.net/~gthompso/self_c.txt)

It's a Quine, a Palindrome and a Null Program all in one!

------
jnordwick
I'm surprised no APL or its successors: K and J

[https://en.wikipedia.org/wiki/K_%28programming_language%29](https://en.wikipedia.org/wiki/K_%28programming_language%29)

[https://en.wikipedia.org/wiki/J_%28programming_language%29](https://en.wikipedia.org/wiki/J_%28programming_language%29)

------
JoeDaDude
I'm disappointed LOLCODE [1][2] is not on the list. [1]
[http://lolcode.org/](http://lolcode.org/) [2]
[https://en.wikipedia.org/wiki/LOLCODE](https://en.wikipedia.org/wiki/LOLCODE)

------
no_protocol
Can someone provide examples of programming forms, practices, or languages
intentionally born esoteric that eventually turned mainstream? Nothing from
this page popped out to me. It seems like sometimes an idea is so odd that it
gets widespread attention just due to its oddness.

~~~
prof_hobart
There's at least one on that list that's (at least in my experience) gone from
relatively mainstream to esoteric - self-modification.

Back in the day when both memory and clock cycles were very precious, it
wasn't unknown to use self-modifying code as a performance optimisation trick.
I did it at least once in the late 80s, when I was working on comms software
that had to be as fast as possible in order to avoid missing incoming data.

There was a check that needed to be done on every byte - I think it was
whether I was now processing graphics characters or not - but the check was
taking valuable time, and the value didn't change very often.

So the most efficient way I found to do it was to wait until I got a "switch
to/from graphics" byte in the input stream and then update the instruction at
a given location to either be "unconditional jump to graphics routine" or a
"no operation (NOP)", which passed straight through to the routine for normal
characters.

It was a horrible hack, but it worked.

Thankfully, I've not felt the need to even consider this approach for the past
20 years.

~~~
userbinator
That eventually turned into JITs, and it's still a very powerful technique for
tight loops on modern processors, although the pipeline means the benefit
happens with more iterations than on the old non-pipelined/cacheless CPUs. It
can even be done across multiple cores, as I coincidentally explained here a
short while ago:

[https://news.ycombinator.com/item?id=12485205](https://news.ycombinator.com/item?id=12485205)

I don't think SMC has ever been "relatively mainstream", at least after HLLs
gained popularity over Asm. But in Asm, it still has its uses where a full JIT
would be far too much overhead.

------
defen
Missing from this list: FRACTRAN, a turing-complete language based on
fractions, invented by John Conway.

[https://en.wikipedia.org/wiki/FRACTRAN](https://en.wikipedia.org/wiki/FRACTRAN)

------
JD557
On the palindrome section:

> I'd like to see one where the entire code is executed, or one done in
> Brainf*ck, as well.

I might be wrong, but this seems a really bad example for palindromes. Aren't
all palindrome strings made of `+-.,<>` valid brainfuck programs? I know that
this subset is not turing-complete, but I also think that any valid brainfuck
program with `[]` can't be a palindrome, which again would make this language
a bad example.

------
yiyus
No love for ternary computers?

~~~
talideon
You're looking for Malbolge:
[https://esolangs.org/wiki/malbolge](https://esolangs.org/wiki/malbolge)

~~~
yiyus
I was actually thinking in the Setun:
[https://en.wikipedia.org/wiki/Setun](https://en.wikipedia.org/wiki/Setun) and
DSSP. But thanks for the reference, I did not know Malbolge (though it looks
like it uses the set 0, 1, 2 instead of the IMO more useful -1, 0, 1).

~~~
talideon
Malbolge (and Dis) are the classic ternary esolangs. I fiddled around with
that in a long lost esolang back in the day.

Keep in mind that Malbolge is _meant_ to be awkward, so while (-1, 0, 1) might
be more useful, (0, 1, 2) suit Malbolge's perverseness much better, though I
doubt that was a conscious decision.

------
anotheryou
templeOS should be mentioned here :) (written by a genuine bigot)

~~~
exDM69
Not to give excuses to his occasional behavior but he has his good moments.
Some of his writings and interviews are pretty genious. Not to mention his
projects, I sometimes enjoy studying them.

You gotta give him some benefit of doubt. He has a genuine, diagnosed mental
illness. And even if he did say racist, misogynist and other derogatory
things, some of it was years ago and he might have changed as a person (and
hopefully for the better). The memory of the Internet is sometimes too long.

I gotta agree with him about one thing: computers are best when they have 16
colors (I spend most of my time in xterm with my favorite sixteen colors).

~~~
JadeNB
> And even if he did say racist, misogynist and other derogatory things, some
> of it was years ago and he might have changed as a person (and hopefully for
> the better). The memory of the Internet is sometimes too long.

While this charitable impulse is to be admired, I'm not sure "that was a long
time ago and he _might_ have changed" is inherently exculpatory.

~~~
okwhatthe2
> exculpatory

........

~~~
talideon
It means 'tending to clear of charges'. Google (or a dictionary) is your
friend.

------
tener
Funny how non-imperative programming languages, so for example FP, are in the
"esoteric" group. Looking at the industry today it no longer seems to be true.

------
rajandatta
Beautiful and lots of fun. Thanks for sharing.

