Most programming languages are designed to give the programmer an easy-to-use interface for interacting with the computer. In general, they've only become more intuitive over the years - why spend hours shuffling bits around memory registers when you can write a snappy Python one-liner in a fraction of the time?
But not everyone cares about antiquated concepts like "ease-of-use". Let's make things a little harder for ourselves.
Welcome to the world of esoteric programming languages.
Actually, forget what I said about making things harder; we're going back to the basics. Let's try out the HQ9+ programming language, as always, by writing a hello world program.
> H
hello, world
Wow. This truly is the future of computing. HQ9+ includes some other built-in functions designed to solve popular programming problems, namely Q (quine, outputs the source code of the program) and 9 (outputs the lyrics to "99 Bottles of Beer").
As a bonus you can also increment an accumulator variable with the + command, with the unfortunate caveat that there's no way to output or otherwise interact with the accumulator.
HQ9+ is an example of a joke esolang; it's not very interesting apart from the novelty and it's not really possible to write a program that doesn't output some combination of hello world and the 99 bottles song.
Let's take a look at brainfuck (also known as bf or b****fuck), a language designed to be as simple as possible yet still Turing-complete. Turing-completeness implies the possibility of writing an implementation of a Turing machine, a device that can theoretically compute anything.
A Turing machine consists of an infinitely long tape divided into cells and a number of actions you can perform on the tape such as moving left or right and changing the value of the selected cell. Brainfuck is essentially a Turing machine simulator:
Seems simple enough. Let's try writing a hello world program.
> ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
Hello World!
Assembly language is starting to seem pretty great right about now. But like I mentioned, with these eight commands it's possible to computerliterally anything. (Which isn't the same as being able to do literally anything - without syscall support you probably won't be running any webservers.)
What if it did support system calls? Or functions? You're in luck - there are dozens of brainfuck variants to choose from that add new functionality to the language. Systemf is an example that implements the aforementioned system calls, and yes, you can write a web server in it.
Writing interpreters for esolangs is a fun programming exercise that I can highly recommend for learning a new programming language. It involves many of the basics you'll need: input, output, and string manipulation.
If you're feeling particularly unhinged, you can try writing an esolang interpreter in the language itself, such as this bf self-interpreter.
Despite also using single-character commands, Befunge is kind of the opposite of brainfuck in the sense that it was created to be as difficult to compile as possible. It accomplishes this by running programs on a 2-dimensional grid. That's right, we're moving up in the world (of dimensions)!
Befunge uses a pointer that points to a certain cell on the grid. By default, it moves left to right, but its direction can be changed with the arrow commands: < > ^ v
Unlike bf's tape, Befunge uses a stack data structure. Naturally, it comes with builtin commands to manipulate it:
And so on. Befunge's command list is quite extensive and you can get fairly creative with it. Here's an interactive calculator program:
Okay, it's easy to see why this concept never caught on, but it had a lot of untapped potential in the world of esolangs. What if you replaced characters with, say... RGB values?
This is a hello world program in Piet, another 2D language that doubles as an abstract art canvas. Esolangs aren't just limited to text - they can be practically anything as long as they process some manner of commands.
So far the esolangs I've covered have been fairly straightforward. Sure, they're not easy to use, but that's mostly due to the tedium of writing programs in them rather than any real difficulty on a conceptual level.
On the other hand you have Malbolge. It took two years and a custom search algorithm to write the first hello world and even then the result was a fucked-up case-insensitive version:
> (=<`$9]7<5YXz7wT.3,+O/o'K%$H"'~D|#z@b=`{^Lx8%$Xmrkpohm-kNi;gsedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:
9876543s+O<oLm
HEllO WORld
Malbolge uses ternary instead of more familiar binary digits, alters parts of its code mid-execution and involves something called a "crazy operation", which should tell you just about everything you need to know about the language.
What's the point of all this, you might ask? I don't know, but it sure is fun to talk about. This post covered the best-known esolangs, but there are thousands of them out there. I might write another post on some of the stranger ones I've found, but if you'd like to look into it yourself I can highly recommend the Esolangs wiki.
I'll finish this post with a gem I found on the Malbolge Wikipedia page: