INTERCAL programming language

INTERCAL is a programming language parody, the canonical esoteric programming language. 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.

INTERCAL was created by Don Woods and James Lyon, two Princeton University students, in 1972. 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:

It is a well-known and oft-demonstrated fact that a person whose work is incomprehensible is held in high esteem. For example, if one were to state that the simplest way to store a value of 65536 in a 32-bit INTERCAL variable is:
DO :1 <- #0$#256
any sensible programmer would say that that was absurd. Since this is indeed the simplest method, the programmer would be made to look foolish in front of his boss, who would of course have happened to turn up, as bosses are wont to do. The effect would be no less devastating for the programmer having been correct.

The INTERCAL manual also contains many paradoxical, nonsensical, or otherwise humorous instructions:

Caution! Under no circumstances confuse the mesh with the interleave operator, except under confusing circumstances!

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 equivalent of a "half mesh" or equals sign in most programming languages is a "<-", referred to as "gets" and made up of an "angle" and a "worm".

The Usenet newsgroup alt.lang.intercal (http://groups.google.com/groups?q=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 <stdio.h>
        int main(void) {
          printf("hello, world\n");
          return 0;
        }

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

External links


Part of an earlier version of this article contains text from The Jargon File 4.2.3 Mar 2001 (http://www.catb.org/~esr/jargon/). Template:Esolangsde:INTERCAL et:INTERCAL es:INTERCAL eo:INTERCAL (programlingvo) ko:INTERCAL pl:InterCal ru:INTERCAL sk:Intercal sv:INTERCAL

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools