|
INTERCAL occurs as programming language parody, the canonical esoteric programming language. It satirizes aspects of the FORTRAN and COBOL programming languages, when well as a proliferation of projected language constructs & notations in the Sixties. Consequently, a humour can pop higher like dated to modern readers brought up by owning C or Java.
INTERCAL was created by Don Woods and James Lyon, two Princeton University students, in 1972. A todays version, C-INTERCAL, is maintained by Eric S. Raymond. INTERCAL is said per original authors to have for "Compiler Language With No Pronounceable Acronym".
INTERCAL is by choice different from either whole more computer-oriented language. Most common operations inside more languages use cryptic & redundant syntax inside INTERCAL. From either a INTERCAL Information Manual:
A INTERCAL manual as well contains several self-contradictory, nonsensical, or even otherwise humourous videos:
INTERCAL has numerous additional features designed to produce it potentially more esthetically graceless to the coder: it utilizes statements like "READ OUT", "IGNORE", "FORGET" & "PLEASE". A INTERCAL manual gives unusual list for a lot non-alphanumeric ASCII characters: single & double quotes come "sparks" & "rabbit ears" severally. the same of a "half mesh" or even match sign around virtually all programing language is 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 [http://groups.google.com/groups?q=alt.lang.intercal 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 obfuscation by design.
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.
Dialects
The original Woods-Lyon INTERCAL was very limited in its input/output capabilities: the only acceptable input was numbers with the digits spelled out, and the only output was an extended version of Roman numerals.
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.
Hello, world
The traditional "Hello, world!" program demonstrates how different INTERCAL is to standard programming languages. In C, it reads as follows:
#include
int main(void)
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
|