-<!doctype HTML public "-//W3O//DTD W3 HTML 3.2//EN">
+<!doctype HTML PUBLIC "-//W3O//DTD W3 HTML 3.2//EN">
<HTML>
<HEAD>
<link rev=made href=mailto:esr@snark.thyrsus.com>
<meta name="keywords" content="humor, satire, parody">
<TITLE>INTERCAL -- the Language From Hell</TITLE>
</HEAD>
-<table width="100%" cellpadding=0><tr>
+<table width="100%" cellpadding=0 summary="Canned page header"><tr>
<td width="30%">Back to <a href="index">Intercal Resources</a>
<td width="30%"align=center>Up to <a href="/~esr/sitemap.html">Site Map</a>
-<td width="30%" align=right>$Date: 1997-08-05 20:45:47 $
+<td width="30%" align=right>$Date: 2002-07-11 21:59:17 $
</tr></table>
<HR>
<H1 ALIGN=CENTER>Intercal -- the Language From Hell</H1>
-<I>Where would we be without effective programming languages?</I> <P>
+<p><I>Where would we be without effective programming languages?</I></p>
-Wait, don't turn the page; that was a rhetorical question. (The
+<p>Wait, don't turn the page; that was a rhetorical question. (The
answer isn't: word-processing on slide rules.) Every once in a while
it's worth thinking about the matter. Most of us (the lucky ones,
that is) don't come within spitting distance of programming from one
them: it's time to write that function so do it, in C or Cobol or
dBase whatever comes to hand. We don't waste time contemplating the
deeper significance of the tools we use to do the job. But what would
-we do without well-designed, efficient programming languages? <P>
+we do without well-designed, efficient programming languages? </p>
-Go back to slide rules, maybe.<P>
+<p>Go back to slide rules, maybe.</p>
-A computer, in a very real sense, is its language. The processor
+<p>A computer, in a very real sense, is its language. The processor
speaks in a native tongue, its own machine code: unreadable by humans
and next to impossible to program in, but nevertheless essential.
It's the existence of this language which makes the computer such a
humble 386 PC for example. Feed it one set of instructions and it
pretends to be a cute little Windows machine; feed it another set, and
something hairy happens -- it turns into a big, bad file server and
-starts demanding passwords and issuing threats. <P>
+starts demanding passwords and issuing threats. </p>
-This flexibility is not an accident. Almost from the start, the
+<p>This flexibility is not an accident. Almost from the start, the
feature which distinguished computers from their complex calculating
predecessors was the fact that they were programmable -- indeed,
universally programmable, capable of tackling any computationally
tractable problem. Strip away the programmability of the machine and
-you lose the universality. Not to mention the usefulness. <P>
+you lose the universality. Not to mention the usefulness.</p>
-Programming languages, as any fule kno, originated in the
+<p>Programming languages, as any fule kno, originated in the
nineteen-fifties as a partial solution to a major difficulty; machine
code is difficult to write and maintain and next to impossible to move
(or port) from one computer to another of a different type.
machine code) were an early innovation, but still failed to address
the portability issue. The solution that finally took off was the
concept of an abstract "high level" language: and the first to achieve
-widespread use was Fortran. <P>
+widespread use was Fortran.</p>
-A high level language is an artificial language with a rigidly
+<p>A high level language is an artificial language with a rigidly
specified grammar, which can be translated into machine code via a
program called a "compiler". Statements in the high level language
may correspond to individual statements, or whole series of
thing that makes compilation practical is the fact that all computer
language systems are effectively equivalent; any algorithm which can
be expressed in one language can be solved in any other, in principle.
-So why are there so many languages? <P>
-
+So why are there so many languages?</p>
<H2>A load of old cobol'ers</H2>
-There are several answers to the question of language proliferation.
+<p>There are several answers to the question of language proliferation.
Besides the facetious (some of us don't like Cobol) and the obvious
(designing languages looks like a Fun Thing to a certain type of
warped personality), there's the pragmatic reason. Simply put, some
device drivers in it. But, again, you'd need your head examining if
you set out to write a humongous database application in it. That's
what Cobol is for; or SQL. So to the point of this article ...
-INTERCAL. <P>
-
+INTERCAL.</p>
<H2>An icky mess</H2>
-INTERCAL is a programming language which is to other languages as
+<p>INTERCAL is a programming language which is to other languages as
elephants are to deep-sea fishing -- it has nothing whatsoever to do
with them. Nothing ... except that it's a programming language. And
it serves as a wonderful example of the fact that, despite their
theoretical, abstract interchangeability, not all languages are born
-equal. Here's a potted history of the offender: <P>
+equal. Here's a potted history of the offender:</p>
-INTERCAL is short for "Computer Language With No Readily Pronouncable
+<p>INTERCAL is short for "Computer Language With No Readily Pronouncable
Acronym". It was not so much designed as perpetrated at Princeton
University, on the morning of May 26th, 1972, by Donald R. Woods and
James M. Lyon. They have been trying to live it down ever since.
The current implementation, C-INTERCAL, was written by Eric S.
Raymond (also the author of The New Hacker's Dictionary), and -- god
help us -- runs on anything that supports C (and the C programming
-tools lex and yacc). <P>
+tools lex and yacc).</p>
-INTERCAL is, in its own terms, elegant, simple and concise. It is
+<p>INTERCAL is, in its own terms, elegant, simple and concise. It is
also flexible and forgiving; if the compiler (called, appropriately
enough, ick) encounters something it doesn't understand it simply
ignores it and carries on. In order to insert a comment, just type in
32-bit integers, denoted by .1 (for the 16-bit variable called "1") or
:1 (for the 32-bit variable named "1"); note that .1 is not equivalent
to :1 and definitely has nothing to do with 0.1 (unless it happens to
-be storing a value of 0.1). <P>
+be storing a value of 0.1).</p>
-INTERCAL supports two unique bitwise operators, interleave (or mingle)
+<p>INTERCAL supports two unique bitwise operators, interleave (or mingle)
and select, denoted by the "^" and "~" symbols respectively. You
interleave two variables by alternating the bits in the two operands;
you select two variables by taking from the first operand whichever
bits correspond to 1's in the second operand, then pack these bits to
the right in the result. There are also numerous unary bitwise
operators, and in order to resolve matters of precedence the pedantic
-may use sparks (') or rabbit-ears (") to group expressions (Don't
+may use sparks (') or rabbit-ears (") to group expressions (Don't
blame me for the silly names: INTERCAL has a character set which is
best described as creative.) It is not surprising that these operators
are unique to INTERCAL; the parlous readability of C would not be
-enhanced by the addition of syntax like: <P>
+enhanced by the addition of syntax like:</p>
-<TT>PLEASE DO IGNORE .1 <- ".1^C'&:51~"#V1^C!12~;&75SUB"V'V.1~</TT>
-<P>
+<p><TT>PLEASE DO IGNORE .1 <-".1^C'&:51~"#V1^C!12~;&75SUB"V'V.1~</TT></p>
-Like any other language, INTERCAL has flow-of-control statements and
+<p>Like any other language, INTERCAL has flow-of-control statements and
input and output statements. To write something or other into a
variable, you need the WRITE IN list statement, where list is a string
of variables and/or array elements. The format of the input data
printed, by default, in the form of "extended" Roman numerals (the
syntax of which I will draw a merciful veil over), although the
scholarly may make use of the standard library, which contains
-routines for formatting output in Sanskrit. <P>
+routines for formatting output in Sanskrit.</p>
-Like FORTRAN, INTERCAL uses line numbers which are optional and follow
+<p>Like FORTRAN, INTERCAL uses line numbers which are optional and follow
in no particular order. Unlike FORTRAN, INTERCAL has no evil,
unspeakable GOTO command, and not even an IF statement. However, you
would be wrong to ascribe this to INTERCAL being designed for
kernel data structures in C. Capisce?) Basically, the COME FROM
statement specifies a line, or lines, which -- when the program
executes them -- will jump to the COME FROM: effectively the opposite
-of GOTO. <P>
+of GOTO.</p>
-Because INTERCAL contains no equivalent of the NEXT statement for
+<p>Because INTERCAL contains no equivalent of the NEXT statement for
controlling whether or not some statement is executed, it provides a
creative, endearing and unique substitute; abstention. For example, you
can abstain from executing a given line of code with the ABSTAIN FROM
(label) form of the command. Alternatively, and more uselessly, you can
abstain from executing all statements of a specified type; for example, you
-can say <P>
+can say</p>
-<TT>PLEASE ABSTAIN FROM IGNORING + FORGETTING</TT>
-<P>
-or
-<P>
+<p><TT>PLEASE ABSTAIN FROM IGNORING + FORGETTING</TT></p>
+<p>or</p>
-<TT>DO ABSTAIN FROM ABSTAINING</TT>
-<P>
+<p><TT>DO ABSTAIN FROM ABSTAINING</TT></p>
-The abstention command is revoked by the REINSTATE statement. It is a
-Bad Idea to ABSTAIN FROM REINSTATING. It is also worth noting that the
-ABSTAIN syntax is rather confusing; for example, DO ABSTAIN FROM
+<p>The abstention command is revoked by the REINSTATE statement. It is
+a Bad Idea to ABSTAIN FROM REINSTATING. It is also worth noting that
+the ABSTAIN syntax is rather confusing; for example, DO ABSTAIN FROM
GIVING UP is not accepted, although a valid synonym for this is DON'T
GIVE UP. (GIVE UP is the statement that terminates execution of a
program. You are encouraged to use this statement at every
-opportunity. It is your only hope of escape.) <P>
+opportunity. It is your only hope of escape.)</p>
-The designers of the INTERCAL language believed that source code
+<p>The designers of the INTERCAL language believed that source code
should be easy to understand or, failing that, friendly; in extremis,
good old-fashioned politeness will do. Consequently, the syntax of
the language looks a bit odd at first. After the line label (if any)
(optionally) one of NOT, N'T, or %n, then a statement: the NOT or
N'T's meaning should be self-evident, while the %n is merely the
percentage probability that the following statement will be
-executed. <P>
+executed.</p>
-Of course, with only two binary and three unary operators, it is
+<p>Of course, with only two binary and three unary operators, it is
rather difficult for programmers to get to grips with the
language. Therefore, in a fit of quite uncharacteristic generosity,
the designers have supplied -- and even partially documented -- a
operations as addition, subtraction, logical comparison, and
generation of random numbers. The subroutines will be charmingly
familiar to those PDP-11 assembly-language hackers among you who are
-also fluent in FORTRAN and SPITBOL. <P>
+also fluent in FORTRAN and SPITBOL.</p>
<H2>Why you should program in Intercal</H2>
-INTERCAL, despite being afflicted with these unique features (which,
+<p>INTERCAL, despite being afflicted with these unique features (which,
arguably, should remain that way) has survived for twenty years and is
indeed thriving. The relatively recent C-INTERCAL dialect (which
introduced the COME FROM statement, among other things) has spread it
acceptance on the basis of elegance, comprehensibility or
necessity. Look at FORTRAN, Cobol or C; all of them spread despite the
fact that better alternatives were available. In fact, there are
-reasons to believe that INTERCAL is the language of the future.<P>
+reasons to believe that INTERCAL is the language of the future.</p>
-Firstly, INTERCAL creates jobs. Yes, it's true. In general, if a
+<p>Firstly, INTERCAL creates jobs. Yes, it's true. In general, if a
particular programming tool is unfriendly, ugly, and absolutely
essential, the response of management is to throw more programmers at
it instead of replacing it. INTERCAL is so monumentally difficult to
use for anything sensible that it is surely destined to be the cause
of full employment, massive increases in the DP budget of every
-company where it is used, and general prosperity for programmers. <P>
+company where it is used, and general prosperity for programmers.</p>
-Secondly, once you have learned INTERCAL you will be able to win
+<p>Secondly, once you have learned INTERCAL you will be able to win
friends and influence people. As the authors point out, if you were to
state that the simplest way to store a value of 65536 in a 32-bit
-variable is <P>
+variable is</p>
-<TT>DO :1 <- #0$#256</TT>
-<P>
+<p><TT>DO :1 <- #0$#256</TT></p>
-any sensible programmer would say that this was absurd. Since this is
+<p>any sensible programmer would say that this was absurd. Since this is
indeed the simplest way of doing this, they'd be made to look like a
fool in front of their boss (who, by Murphy's law, would have turned
up at just that moment). This will have a devastating effect on their
ego and simultaneously make you look brilliant (until they realise
-that you cribbed this example from the manual, like me. Deep shame.) <P>
+that you cribbed this example from the manual, like me. Deep shame.)</p>
-Thirdly, INTERCAL helps sell hardware. There's been a lot of fuss
+<p>Thirdly, INTERCAL helps sell hardware. There's been a lot of fuss
recently about big corporations inventing gigantic, bloated windowing
and operating systems that require monstrously powerful computers to
run on; some cynics suggest that this is because personal computers
program, in C, took less than 0.5 seconds -- thus proving, quite
clearly, that INTERCAL software is so slow that you absolutely must
buy a CRAY-3 or equivalent in order to have any hope of getting any
-work out of it. <P>
+work out of it.</p>
-Consequently, it is quite clear that INTERCAL represents a major
+<p>Consequently, it is quite clear that INTERCAL represents a major
alternative to conventional programming languages. Anyone who learns
this language is going to go far -- at least as far as the nearest
psychiatric institution. Rumour has it that INTERCAL was not entirely
restore hair loss! So we warmly advise you to take this utterly
unbiased report at face value and go forth and get your friendly
neighbourhood software company to switch to INTERCAL, wherever or
-whatever they may be using right now. You know it makes sense ... <P>
+whatever they may be using right now. You know it makes sense ...</p>
<HR>
-<table width="100%" cellpadding=0><tr>
+<table width="100%" cellpadding=0 summary="Canned page footer"><tr>
<td width="30%">Back to <a href="index">Intercal Resources</a>
<td width="30%"align=center>Up to <a href="/~esr/sitemap.html">Site Map</a>
-<td width="30%" align=right>$Date: 1997-08-05 20:45:47 $
+<td width="30%" align=right>$Date: 2002-07-11 21:59:17 $
</tr></table>
-<P><ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
+<br clear="left">
+<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
</BODY>
</HTML>