INTERCAL, programming language parody, is the canonical esoteric programming language created by Don Woods and James Lyon, two Princeton University students, in 1972. It satirizes aspects of the FORTRAN and COBOL programming languages, as well as the proliferation of proposed language constructs and notations in the 1960s. Consequently, the humour may appear rather dated to modern readers brought up with C or Java.
The current version, C-INTERCAL, is maintained by Eric S. Raymond. INTERCAL is said by the original authors to stand for "Compiler Language With No Pronounceable Acronym".
INTERCAL is purposely different from all other computer languages. Common operations in other languages have cryptic and redundant syntax in INTERCAL. From the INTERCAL Reference Manual:
DO :1 <- #0¢#256
The INTERCAL manual also contains many paradoxical, nonsensical, or otherwise humorous instructions:
INTERCAL has many other features designed to make it even more aesthetically unpleasing to the programmer: it uses statements such as "READ OUT", "IGNORE", "FORGET" and "PLEASE". The INTERCAL manual gives unusual names for all non-alphanumeric ASCII characters: single and double quotes are "sparks" and "rabbit ears" respectively. The assignment operator, represented as a "half mesh" or equals sign in many other programming languages, is in INTERCAL a "<-", referred to as "gets" and made up of an "angle" and a "worm".
The original Princeton implementation used punched cards and the EBCDIC character set. In order to allow INTERCAL to run on computers using ASCII, substitutions for two characters had to be made: $ substituted for ¢ as the mingle operator to "represent the increasing cost of software in relation to hardware" and ? was substituted for ∀ as the unary exclusive-or operator to "correctly express the average person's reaction on first encountering exclusive-or".
The Usenet newsgroup alt.lang.intercal is devoted to the study and appreciation of INTERCAL and other esoteric languages.
Despite the language's being intentionally obtuse and wordy, INTERCAL is nevertheless Turing-complete: given enough memory, INTERCAL can solve any problem that a universal Turing machine can solve. It does this very slowly, however. A Sieve of Eratosthenes benchmark, computing all prime numbers less than 65536, was tested on a Sun SPARCStation-1. In C, it took less than 0.5 seconds; the same program in INTERCAL took over seventeen hours. (Stross, 1992)
It should be noted that almost any programming language allows notational horrors as great as or greater than INTERCAL's, as demonstrated in contests such as the International Obfuscated C Code Contest. However, these are generally intentional efforts to create unreadable code, in contrast to INTERCAL's design forcing virtually all code to be unreadable.
According to the INTERCAL manual, "the aim in designing INTERCAL was to have no precedents", supposedly neither in flow control features, nor in data manipulation operators. The designers were partially successful; the only known precedent is a machine instruction * in a Soviet mainframe computer BESM-6, released in 1967, that is effectively equivalent to INTERCAL's "select" operator.
The C-INTERCAL reimplementation, being available on the Internet, has made the language more popular with devotees of esoteric programming languages. The C-INTERCAL dialect has a few differences from original INTERCAL and introduced a few new features, such as a COME FROM statement and a means of doing text I/O based on the Turing Text Model.
The authors of C-INTERCAL also created the TriINTERCAL variant, based on the ternary system and generalising INTERCAL's set of operators.
A more recent variant is Threaded Intercal, which extends the functionality of COME FROM to support multithreading.
The traditional "Hello, world!" program demonstrates how different INTERCAL is from standard programming languages. In C, it could read as follows:
main() {
printf("Hello, world!\n");
}
The equivalent program in C-INTERCAL is longer and harder to read:
DO ,1 <- #13
PLEASE DO ,1 SUB #1 <- #234
DO ,1 SUB #2 <- #112
DO ,1 SUB #3 <- #112
DO ,1 SUB #4 <- #0
DO ,1 SUB #5 <- #64
DO ,1 SUB #6 <- #194
DO ,1 SUB #7 <- #48
PLEASE DO ,1 SUB #8 <- #22
DO ,1 SUB #9 <- #248
DO ,1 SUB #10 <- #168
DO ,1 SUB #11 <- #24
DO ,1 SUB #12 <- #16
DO ,1 SUB #13 <- #214
PLEASE READ OUT ,1
PLEASE GIVE UP
INTERCAL | INTERCAL | INTERCAL | INTERCAL (programlingvo) | INTERCAL | INTERCAL | InterCal | INTERCAL | Intercal | INTERCAL
This article is licensed under the GNU Free Documentation License.
It uses material from the
"INTERCAL".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world