ESOTERIC LANGUAGES
Esoteric programming languages are a particular kind of programming languages, that are not created for a purpose of utility. There are two main purpose that push someone to create (or learn) an esoteric language:
1) challenge: most esoteric languages are intentionally complex and difficult to read (and write), they try to be as complicate as possible just for the purpose of being difficult (for example: Malbolge)
Malbolge for printing the classic output "Hello World!":
2) Fun/joke: some other esoteric languages try to be funny, more than actually difficult (they are also difficult) for example LOLCODE is a language that imitates lolcats
and this is example for printing the sentence "Hello world!":
...Just for reference for people who are not programmers, and maybe this looks to them like any other code, i'll write also the same task (printing "Hello World!") in both c++ and python, so you can see by yourself the difference between a "normal" language and an esoteric language.
C++ code:
[ok, maybe to non-programmers, c++ might look a bit like an esoteric language as well, but i swear it is not, it is kinda simple]
And Python code:
Now the python code should be the one that actually make you see the difference
INTERCAL
INTERCAL is an esoteric programming language created in 1972 by Don Woods and James M. Lyon, two Princeton University students. It doesn't seem to be super hard (compared to other esoteric programming languages) but mostly it's weird and tricky.
In fact the purpose of the INTERCAL language is to create a compiler that is the most far away as possible from all other programming languages, while still being usable to create programs.
In this series i will try to learn this language and tell you the difficulties i encounter
day 0:
If today is day 1, yesterday was day 0, and actually the journey started yesterday, when i tried to get the compiler for the intercal language to work
- The compiler is for linux operating system:
And so linux lubuntu i did download, created a Virtual Machine to run the Lubuntu OS, and then tried to figure out how to build the compiler
-The linux "make" command:
So after getting the linux system on, downloaded the files for the compiler, and read the "README" file that i suppose explains how to build the compiler.
The readme file is, exactly in the same style as ALL the documentation, the site, and the error messages from the compiler: weird, confusing (even more for a non native-english speaker), contradictory i think sometimes? it's very much ironic.
So the readme tells to run the make command "like in any other software distribution", however i've never used the command, not being a linux user, so i have no idea what that means. So i did research, i did use sudo apt install for the components needed, i did the ./configure command, wich did something, but for some reason it didn't do everything, so the "make" command was still having problems. Also i tried to directly download the compiler with sudo apt install intercal, wich started to download, with my great relief...but not, it just encountered errors along the way.
End of day 0:
At the end of day 0 i surrender (for the first of many times probably during this journey) and i decide (for now) to use an online compiler and start coding, i will keep trying to make the local compiler work eventually
-------------------------------------------------------------------------------------------------------------
Day 1:
So today i started actually coding, my first try was, reasonably, to read the documentation! Wich is, again, confusing to say the least. The manual itself says (in a sneaky way, careful not to be noticed) that it is actually its clear intention to make the reader even MORE unfamiliar with the language:
"The examples of INTERCAL programming which have appeared in the preceding sections of this manual have probably seemed highly esoteric to the reader unfamiliar with the language. With the aim of making them more so, we present here a description of INTERCAL."
The instructions are a mix of actual useful informations, weird sentences that need a very careful reading in order to be understood:
"The interleave operator takes two 16-bit values and produces a 32-bit result by alternating the bits of the operands. Thus, #65535c/#0 has the 32-bit binary form 101010....10 or 2863311530 decimal, while #0c/#65535 = 0101....01 binary = 1431655765 decimal, and #255c/#255 is equivalent to #65535."
[NOTE: this is the middle of the THIRD page, so no, it didn't explain beforehand what we're talking about]
and also very personal author digressions like:
"INTERCAL recognizes 5 operators—2 binary and 3 unary. Please be kind to our operators: they may not be very intelligent, but they’re all we’ve got. In a sense, all 5 operators are binary, as they are all bit-oriented, but it is not our purpose here to quibble about bits of trivia."
--------
Coding:
So after a quick read of the manual i decide i didn't really understand too much and let's just see how it works.
So what do i do? copy an example code FROM THE MANUAL and...it doesn't work
i try to make it work, try to understand, the compiler clearly laughs at me, and than i start to suspect that the author of the manual, purposedly wrote non-working code to trick me into surrender, so i erased everything, wrote the code by myself and did something that did, in fact work.
The code does this: creates a 16-bit unsigned int variable, assign the value 15 to the variable, print the variable as output, end the program, and the code is this
The output is
The output might seem weird to some, but i imagine the numbers are outputted in the ancient Roman numerical system, so X is 10, V is 5 and hence: XV is 10+5 = 15 wich is in fact what i wanted
Note: if the code was instead:
the output would have been an error message like this:
So, while writing intercal, one should not be too rude, but not too polite either!!
------------
Last thing of today, the manual says that commands that start with * are interpreted as comments, but if the comment starts with DO or PLEASE DO or PLEASE it is still interpreted as a command, regardless of the * symbol.
However since if you add NOT to a command, the command is (weirdly coherently) not done, one could use the NOT command as a way to insert "safe" comments, for example, in the previous code i could also write
this would work exactly as the code of before, and the "DO NOT" lines are not gonna be interpreted as commands, so effectivly they are comments.
However notice 2 important things:
1) these "comment" lines, are still capable of upsetting the compiler, in fact notice how i added a PLEASE at line 2, it is because if that please is not added, the compiler will refuse to compile, and tell you how you have not been polite enough, so you can add comments in this way, but remember to be polite (but not too much)
2)These "comments" if used too much, tend to break the program! i'm not yet sure why, but in the code with the comments, there were actually 4 comment lines, but one of them, for some unknown reason, wouldn't work, it kept throwing an error message...so i just deleted it and everything is fine. I noticed, with the use of comments, this is not rare, so they should be used with caution
Bonus: the "do not" start of the sentence might be confusing to future readers, so try to make it even more confusing if possible, so if they understand, good! they are enough intelligent to touch your code, if they are confused, still good, they won't touch the code out of fear!
To quote The Manual, at page 2, it says:
"It is a well-known and oft-demonstrated fact that a person whose work is incomprehensible is held in high esteem."
and with this quote of the day. see you tomorrow with more INTERCAL!!!
Comments
Displaying 1 of 1 comments ( View all | Add Comment )
deathletterz.c0m
fun read, please and do not sounds really funny like basically talking to pc itself cant wait for day 2!
It feels like talking to someone who doesn't speak your same language, but more importantly he doesn't want to speak to you in the first place, and will find any reason to not answer. Sometimes the compiler will randomly decide to make up a fake error just to drive you mad lol, or even tell you there is some error but telling you "there error is in the code somewhere" so you have to figure out yourself.
Btw, if you find this "talking to a funny computer" thing cool but you don't know how to code, you can try "Amulet of Yendor", it's a game from 1985, you would need a DOS machine (or emulator) however if you want to just play, you can play it online on MyAbandonware site (it is legal, the game is very old so the copywrite is not really claimed by nobody anymore)
by Barthel; ; Report