Programming languages have their own jokers and their own jokes. Actually, most esoteric programming languages were conceived precisely as jokes (of course, if not as a challenge to the public, like F * ckf * ck, or as an exercise for the mind, like Brainfuck). But there is one language that rightfully deserves the honorary title of the First Joke. Back in 1972, when all existing programming languages were extremely expedient and deadly serious, in the early morning of May 26, a pair of pranksters pushed the limits of reality and came up with a fundamentally new language. They dubbed it Compiler Language With No Pronounceable Acronym, which
for obvious reasons was reduced to
INTERCAL .
Almost 40 years have passed since then. INTERCAL has long ceased
to have nothing to do with any mainstream language , as the developers wanted it. Agree, an ordinary imperative language, in which there are named variables, arrays, an assignment operation, as many as 5 operators and a standard library that implements the missing arithmetic operations, has much more in common with normal languages than the same Brainfuck, not to mention two-dimensional languages that are not deterministic languages, paranoid languages, languages with a single instruction and other exhibits of our vivarium. But he continues to be a pioneer of the genre, unique in many ways.
First of all, a reference guide. Later esoteric languages concentrate their singularity in the very essence of the language, their guides are limited to dry factual descriptions of commands and features.
The INTERCAL Programming Language Reference Manual is a unique description of a programming language, with epigraphs from “Alice in Wonderland” and snide comments made in a very serious tone. In addition, especially for this language, the authors developed a system of euphemisms for the service characters used: '- spark, "- rabbit ears,. - spot,: - double spot,, - tail,; - hybrid (although it would be more logical to have a" spotted tail " ), $ - big money, ~ - zagogulina, etc. (the full list is attached to the manual.) Combining
rabbit ears with a
spot to get a rabbit is prohibited!
')
Next, error messages. In decent languages, error messages are informative and accurately indicate the causes of the incident. In dishonesty, on the contrary, the messages are either universal or they throw up the wrong reasons for the error. INTERCAL errors are as malicious as a manual, and without a reference book they are not deciphered in principle. In fact, you can guess that E252 “I forgot what I was going to say” is a memory overflow error during I / O operations, and E182 “It seems you like this tag very much” is an error using the same label several times. But to whom in their right mind and hard memory would it come to mind that E405 “The program was rejected for mental health reasons” signals the use of multithreading commands or calculations with rollbacks without the appropriate compiler option, E017 “What do I really have to deal with?” using the constants of the wrong range, and E127 “Talking“ abracadabra ”without a magic wand is completely useless” - that the standard library is not connected?
Some errors do not have analogues in other languages. Thus, the pair E079 “Programmer is not polite enough” and E099 “Programmer is too polite” refers to the number of PLEASE command identifiers in the program (by the way, the PLEASE identifier does not carry any other meaning). Error E774 “Random compiler bug” fully corresponds to its name - it occurs randomly and usually disappears when recompiled. E995 “What, did I really have to implement it?” Occurs when trying to execute code that has not yet been written (just don’t ask how you can do it!).
Finally, the language itself. You can talk about it for a long time, but it is better to read the
Revised Reference Manual , which preserves the style of the original manual, but uses modern implementations of the language. Here are some of my favorite places:
- INTERCAL is a very easy to learn language, and one would assume that it would be good for initiating novice programmers. In fact, he will rather push the programmer to search for another job.
- The examples of programs given in the previous sections may seem rather esoteric to a reader unfamiliar with the language. To enhance this impression, we provide a description of the language.
- In INTERCAL there are 5 operators - 2 binary and 3 unary. However, in a sense, all operators are binary, since they all operate on the binary representation of the arguments, but this word-play leads us away from the presentation.
- The operators' priority is determined as follows: (the rest of the page is purposefully left blank - do not forget that the creators of INTERCAL set as their goal the absence of priorities).
- Each program command can be given the probability with which it will be executed when the program is started. In addition, there are commands that block the execution of subsequent commands of a certain type or change variables.
- Numbers are displayed in the Roman notation, and are entered in words one digit at a time in any language that the compiler supports. Input / output characters are implemented differently in different compilers, and in any case, too terrible to describe it here.
And nowadays there are people who are loyal to INTERCAL and proud of their title as techno-masochists - some of them throw the operating system's source code into this wonderful language for competitors, others
argue that INTERCAL is better than Perl:
- more readable variable names (in INTERCAL, variables have no names, only numbers);
- exact prefix indication of a variable of its type (. and: - 16 and 32-bit integers,, and; - arrays of 16 and 32-bit integers);
- no nail clippings (i.e. brackets - single and double quotes in INTERCAL instead);
- very simple rules of priority of operations (what could be simpler than their absence?);
- INTERCAL contains things that require extensions in Perl — for example, Roman numbers;
- orientation to the user, but not to the program (unlike most languages, input is performed by the WRITE IN command, output is READ OUT);
- Finally, the programming process itself should be fun; a program that can be written in Perl in 15 minutes, it will take several days to INTERCAL - it is clear which language is better ;-)