From: Eric S. Raymond Date: Fri, 12 Jul 2002 01:59:17 +0000 (-0400) Subject: Tidy corrections. X-Git-Tag: 0.21~10 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=ae65b832bc8ef3154196e42986f83f5d0bbf362a;p=intercal.git Tidy corrections. --- diff --git a/website/stross.html b/website/stross.html index 4d0c476..dba1f3a 100644 --- a/website/stross.html +++ b/website/stross.html @@ -1,4 +1,4 @@ - + @@ -6,10 +6,10 @@ INTERCAL -- the Language From Hell - +
Back to Intercal Resources Up to Site Map -$Date: 1997-08-05 20:45:47 $ +$Date: 2002-07-11 21:59:17 $

@@ -18,9 +18,9 @@ of that name, not the Ziff-Davis title) around September 1992.

Intercal -- the Language From Hell

-Where would we be without effective programming languages?

+

Where would we be without effective programming languages?

-Wait, don't turn the page; that was a rhetorical question. (The +

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 @@ -28,11 +28,11 @@ day to the next. Those who do, usually don't give any thought to 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?

+we do without well-designed, efficient programming languages?

-Go back to slide rules, maybe.

+

Go back to slide rules, maybe.

-A computer, in a very real sense, is its language. The processor +

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 @@ -43,16 +43,16 @@ correct expressions in the computer's internal language. Take the 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.

+starts demanding passwords and issuing threats.

-This flexibility is not an accident. Almost from the start, the +

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.

+you lose the universality. Not to mention the usefulness.

-Programming languages, as any fule kno, originated in the +

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. @@ -61,9 +61,9 @@ relatively simple mnemonic commands (which were then "assembled" into 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.

+widespread use was Fortran.

-A high level language is an artificial language with a rigidly +

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 @@ -71,12 +71,11 @@ statements, in the machine language ofthe computer. Indeed, the only 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?

- +So why are there so many languages?

A load of old cobol'ers

-There are several answers to the question of language proliferation. +

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 @@ -95,28 +94,27 @@ that will execute on your toaster. Yes, you can write wonderful 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.

- +INTERCAL.

An icky mess

-INTERCAL is a programming language which is to other languages as +

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:

+equal. Here's a potted history of the offender:

-INTERCAL is short for "Computer Language With No Readily Pronouncable +

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).

+tools lex and yacc).

-INTERCAL is, in its own terms, elegant, simple and concise. It is +

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 @@ -126,25 +124,24 @@ compile it. There are only two variable types: 16-bit integers, and 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).

+be storing a value of 0.1).

-INTERCAL supports two unique bitwise operators, interleave (or mingle) +

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:

+enhanced by the addition of syntax like:

-PLEASE DO IGNORE .1 <- ".1^C'&:51~"#V1^C!12~;&75SUB"V'V.1~ -

+

PLEASE DO IGNORE .1 <-".1^C'&:51~"#V1^C!12~;&75SUB"V'V.1~

-Like any other language, INTERCAL has flow-of-control statements and +

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 @@ -155,9 +152,9 @@ statement, where list again consists of variables. Numbers are 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.

+routines for formatting output in Sanskrit.

-Like FORTRAN, INTERCAL uses line numbers which are optional and follow +

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 @@ -178,33 +175,30 @@ hacker-ish, involving a triple-indirect pointer to a union of UNIX 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.

+of GOTO.

-Because INTERCAL contains no equivalent of the NEXT statement for +

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

+can say

-PLEASE ABSTAIN FROM IGNORING + FORGETTING -

-or -

+

PLEASE ABSTAIN FROM IGNORING + FORGETTING

+

or

-DO ABSTAIN FROM ABSTAINING -

+

DO ABSTAIN FROM ABSTAINING

-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 +

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.)

+opportunity. It is your only hope of escape.)

-The designers of the INTERCAL language believed that source code +

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) @@ -217,9 +211,9 @@ prejudice. The DO, PLEASE or PLEASE DO is then followed by (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.

+executed.

-Of course, with only two binary and three unary operators, it is +

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 @@ -227,11 +221,11 @@ library of rather outre subroutines that carry out such esoteric 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.

+also fluent in FORTRAN and SPITBOL.

Why you should program in Intercal

-INTERCAL, despite being afflicted with these unique features (which, +

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 @@ -241,32 +235,31 @@ no computer language has ever succeeded in gaining widespread 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.

+reasons to believe that INTERCAL is the language of the future.

-Firstly, INTERCAL creates jobs. Yes, it's true. In general, if a +

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.

+company where it is used, and general prosperity for programmers.

-Secondly, once you have learned INTERCAL you will be able to win +

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

+variable is

-DO :1 <- #0$#256 -

+

DO :1 <- #0$#256

-any sensible programmer would say that this was absurd. Since this is +

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.)

+that you cribbed this example from the manual, like me. Deep shame.)

-Thirdly, INTERCAL helps sell hardware. There's been a lot of fuss +

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 @@ -280,9 +273,9 @@ INTERCAL, clocked over seventeen hours on a SPARCStation-1. The same 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.

+work out of it.

-Consequently, it is quite clear that INTERCAL represents a major +

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 @@ -291,16 +284,17 @@ Apollo missions. It is even reported to improve your sex life and 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 ...

+whatever they may be using right now. You know it makes sense ...


- +
Back to Intercal Resources Up to Site Map -$Date: 1997-08-05 20:45:47 $ +$Date: 2002-07-11 21:59:17 $
-

Eric S. Raymond <esr@snark.thyrsus.com>
+
+
Eric S. Raymond <esr@snark.thyrsus.com>