Here’s a multilingual dictionary that lets you translate 19 languages. For example, it shows that QBasic says “DIM x(4)” but Fortran says “DIMENSION X(4)” instead.
The dictionary clumps the languages into groups. For example, look at the languages in the second group: Algol, Pascal, Modula, and Ada. hose 4 languages are almost identical to each other. For example, in each of them you say “J:=K+2”.
The bottom group (Logo, Lisp, Snobol, and Pilot) differs wildly from the others. For example, look at how those 4 languages translate “IF x = 4.3 THEN” and “j = k + 2”. They’re called radical languages; the other 15 languages are called mainstream.
Two other radical languages are APL and Forth. They’re so weird they won’t fit in that chart!
Here’s how to make the computer do 2+2 and print the answer (4), using each of those languages:
Notice that APL’s the briefest (just say 2+2), and Cobol’s the most verbose (it requires 9 lines of typing).
Each of those 20 languages is flexible enough to program anything. Which language you choose is mainly a matter of personal taste.
Other languages are more specialized. For example, a language called GPSS is designed specifically to analyze how many employees to hire, to save your customers from waiting in long lines for service. Dynamo analyzes social interactions inside your company and city and throughout the world; then it graphs your future. SPSS analyzes tables of numbers, by computing their averages, maxima, minima, standard deviations, and hundreds of other measurements used by statisticians. Apt helps you run a factory by controlling “robots” that cut metal. Prolog lets you store answers to your questions and act as an expert system. RPG spits out long business reports for executives who don’t have enough time to program in Cobol.
The following table reveals more details about all those languages. Within each category (“mainstream”, “radical”, and “specialized”), the table lists the languages in chronological order. QBasic and Visual Basic are considered variants of Basic.
Of those 26 languages, 5 were invented in Europe (Algol, Pascal, Modula, Ada, and Prolog). The rest were invented in the U.S.
5 were invented at IBM’s research facilities (Fortran, PL/I, APL, GPSS, and RPG), 3 at MIT (Lisp, Apt, and Dynamo), 3 at Bell Labs (C, C++, and Snobol), 2 at Stanford University (Forth and SPSS), and 2 by Professor Niklaus Wirth in Switzerland (Pascal and Modula). The rest were invented by geniuses elsewhere.
The first mainstream languages were Fortran, Algol, and Cobol. They were the big 3.
Beyond the big 3
Other mainstream languages came after the big 3 and were just slight improvements of the big 3. This family tree shows how the mainstream languages influenced each other:
In that tree, a vertical line means “a direct influence” (like a parent); a slanted line means “an indirect influence” (like an aunt or uncle). For each language, I show the year when the language’s first version was complete. As each language grew, it stole features from other languages (just like English stole the word “restaurant” from French); the tree shows just history’s main thrust. Now let’s dig into the details.…
Why Basic? Two professors at Dartmouth College combined Fortran with Algol, to form Basic. It was designed for students, not professionals: it included just the easiest parts of Fortran and Algol. Students liked it because it was easy to learn, but professionals complained it lacked advanced features.
Why PL/I? After inventing Fortran and further improvements (called Fortran II, Fortran III, Fortran IV, and Fortran V), IBM decided to invent the “ultimate” improvement: a language that would include all the important words of Fortran V and Algol and Cobol. At first, IBM called it “Fortran VI”; but since it included the best of everything and was the first complete language ever invented, IBM changed its name to Programming Language One (written as PL/I). IBM bragged about how PL/I was so eclectic, but most programmers considered it a confusing mishmash and continued using the original 3 languages (Fortran, Algol, and Cobol), which were pure and simple.
Why Pascal and Modula? Among the folks who disliked PL/I was Niklaus Wirth, who preferred Algol. At a Swiss university, he invented an improved Algol and called it Pascal. Then he invented a further improvement, called Modula. Algol, Pascal, and Modula are all very similar to each other. He thinks Modula’s the best of the trio, but critics disagree. Today, Pascal is still the most popular of that trio; hardly anybody uses the original Algol anymore, and Modula is considered a controversial experiment.
While Wirth was developing and improving Modula, other researchers were developing 4 competitors: C, Ada, DBase, and Easy. Here’s why.…
Why C? Fancy languages, such as PL/I and Modula, require lots of RAM. At Bell Labs, researchers needed a language small enough to fit in the tiny RAM of a minicomputer or microcomputer. They developed the ideal tiny language and called it C. Like PL/I, it borrows from Fortran, Algol, and Cobol; but it lacks PL/I’s frills. It’s “lean and mean” and runs very quickly. Later, Bell Telephone Labs invented an improved C, called C++, which includes extra commands. Then Sun invented a C++ variant, called Java, to handle animation on Web pages.
Why Ada? The Department of Defense, which was happily using Cobol to run the military’s bureaucracy, needed to invent a second kind of language, to control missiles and other military equipment. The Department held a contest to develop such a language and said it wanted the language to resemble PL/I, Algol, and Pascal. (It didn’t know about Modula, which was still being developed.) The winner was a French company. The Department adopted that company’s language and called it Ada. It resembled Modula but included more commands — and therefore consumed more RAM and was more expensive. Critics complain that Ada like PL/I, is too large and complex.
Why DBase? Inspired by languages such as Basic and PL/I, Wayne Ratliff invented DBase. Like Basic, DBase is easy; like PL/I and Pascal, DBase creates loops by saying WHILE instead of GO TO. What makes DBASE unique is its new commands for manipulating databases.
Why Easy? My own attempt to create the ideal language is called Easy. It’s even easier to learn than Basic, yet includes the power of languages such as Pascal. But since I don’t have the time to put Easy onto a computer, Easy’s remained just an idea whose time should have come.
Dig in! Here are the inside secrets about all those mainstream languages.…
During the early 1950’s, the only available computer languages were specialized or awkward. Fortran was the first computer language good enough to be considered mainstream. Algol and Cobol came shortly afterwards. Fortran, Algol, and Cobol were so good that they made all earlier languages obsolete.
Fortran’s nature On pages 370-438, I explained how to program in QBasic. Fortran resembles QBasic but is weirder — because Fortran was invented before programmers learned how to make programming languages pleasant.
For example, suppose you want to add 2+2. In QBasic, you can say just:
In Fortran, you must lengthen the program, so it looks like this instead:
That’s how the typical version of Fortran works. Some versions are different. For example, some versions require you to say STOP above END, like this:
Some versions want you to say TYPE instead of PRINT.
Some old versions won’t accept “no comment” about printing. They require you to say:
That PRINT line means: PRINT, using the FORMAT in line 10, the value of N. In line 10, the 1X means “normal”; the I1 means “an integer that’s just one digit”. Those details drive beginners nuts, but experienced Fortran programmers are used to such headaches and take them in stride, just like Frenchmen are used to conjugating French verbs and Germans are used to conjugating German adjectives (yuck!).
Like QBasic, Fortran lets you do math by using these symbols:
But Fortran is harder to learn than QBasic:
Fortran did a good job of handling math functions (such as SQR) and subroutines (for handling statistics, calculus computations, and other math challenges). Many programmers created libraries full of math functions and subroutines and sold them to other programmers. A whole culture developed of programmers writing Fortran routines. If you didn’t know Fortran, you weren’t part of the “in” crowd.
How Fortran arose In 1954, an IBM committee said it was planning a new computer language that would help engineers make the computer handle math formulas. The committee called the language Fortran, to emphasize that the language would be particularly good for translating formulas into computer notation.
Those original plans for Fortran were modest:
Then came improvements:
The original plans said you’d be able to add an integer to a real. That didn’t work in Fortran I, Fortran II, and Fortran IV, but it works today.
The original plans said an IF statement would compare any two numbers. Fortran I and Fortran II required the second number no be zero, but Fortran IV removed that restriction.
IBM waged a campaign to convince everyone that Fortran was easier than previous methods of programming. IBM succeeded: Fortran became immediately popular. Fortran was easy enough so that, for the first time, engineers who weren’t computer specialists could write programs.
Other manufacturers sold imitations of IBM’s Fortran, but with modifications. The variety of modifications from all the manufacturers annoyed engineers, who wished manufacturers would all use a single, common version of Fortran. So the engineers turned to the American National Standards Institute (Ansi), which is a non-profit group of engineers that sets standards.
In 1966, Ansi decided on a single version of Fortran IV to be used by all manufacturers. Thereafter, each manufacturer adhered to the Ansi standard but also added extra commands, to try to outclass the other manufacturers.
After several years had gone by, enough extra commands had been added by manufacturers so engineers asked Ansi to meet again and develop a common standard for those extras. Ansi finished developing the standard in 1977 and called it Fortran 77.
Now each major manufacturer adheres to the standard for Fortran 77, so you can run Fortran 77 programs on most maxicomputers, minicomputers, and microcomputers. Each manufacturer adds extra commands beyond Fortran 77.
In 1984, an Ansi committee developed a “Fortran 88”. 40 members of the committee approved it, but the other 2 members — IBM and DEC — refused to endorse it. In 1991, a variant called Fortran 90 was finally approved by all.
Fortran’s popularity Fortran became popular immediately because it didn’t have any serious competitors. Throughout the 1960’s and 1970’s, Fortran remained the most popular computer language among engineers, scientists, mathematicians, and college students. Colleges required all freshman computer-science majors to take Fortran.
But at the end of the 1970’s, Fortran’s popularity began to drop.
But in some ways, Fortran’s still better for engineering that Basic, Pascal, or C++. Here’s why:
In 1955, a committee in Germany began inventing a computer language. Though the committee spoke German, it decided the computer language should use English words instead, since English was the international language for science.
In 1957 those Germans invited Americans to join them. In 1958 other European countries joined also, to form an international committee, which proposed a new computer language, called “IAL” (International Algebraic Language).
The committee eventually changed the language’s name to Algol 58 (the Algorithmic language invented in 1958), then created an improved version called Algol 60, then created a further revision called Algol 60 Revised, and disbanded. Today, programmers who mention “Algol” usually mean the committee’s last report, Algol 60 Revised.
Algol differs from Fortran in many little ways.…
How to end a statement At the end of each statement, Fortran requires you to press the Enter key. Algol requires you to type a semicolon instead.
Algol’s advantage: you can type many statements on the same line, by putting semicolons between the statements. Algol’s disadvantage: those ugly semicolons are a nuisance to type and make your program look cluttered.
Integer variables To tell the computer that a person’s AGE is an integer (instead of a real number), Fortran requires you to put the letter I, J, K, L, M, or N before the variable’s name, like this: IAGE. Algol requires you to insert a note saying “INTEGER AGE” at the top of your program instead.
Algol’s advantage: you don’t have to write unpronounceable gobbledygook such as “IAGE”. Algol’s disadvantage: whenever you create a new variable, Algol forces you to go back up to the top of your program and insert a line saying “INTEGER” or “REAL”.
Assignment statements In Fortran, you can say J=7. In Algol, you must insert a colon and say J:=7 instead. To increase K by 1 in Fortran, you say K=K+1. In Algol, you say K:=K+1.
Algol’s disadvantage: the colon is a nuisance to type. Fortran’s disadvantage: according to the rules of algebra, it’s impossible for K to equal K+1, and so the Fortran command K=K+1 looks like an impossibility.
Algol’s beauty Here’s how Algol avoids Fortran’s ugliness:
Algol’s popularity When Algol was invented, programmers loved it. Europeans began using Algol more than Fortran. The American computer association (called the Association for Computing Machinery, ACM) said all programs in its magazine would be in Algol.
But since IBM refused to put Algol on its computers, most American programmers couldn’t use Algol.
Critics blamed IBM for Algol’s demise. But here’s IBM’s side of the story:
When asked why it didn’t support Algol, IBM replied that the committee’s description of Algol was incomplete. IBM was right; the Algol 60 Revised Report had 3 loopholes:
Attempts to improve Algol Long after the original Algol committee wrote the Algol 60 Revised Report, two other Algol committees were formed.
One committee developed suggestions on how to do input and output, but its suggestions were largely ignored.
The other committee tried to invent a much fancier Algol. That committee wrote its preliminary report in 1968 and revised it in 1975. Called Algol 68 Revised, that weird report requires you to spell words backwards: to mark the end of the IF statement, you say FI; to mark the end of the DO statement, you say OD. The committee’s decision was far from unanimous: several members refused to endorse the report.
Algol today Few programmers still use Algol, but many use Pascal (which is very similar to Algol 60 Revised) and Basic (which is a compromise between Algol and Fortran).
If you’re a student who’s going to give a speech or write a paper, teachers recommend that you organize your thinking by creating an outline. Back in the 1950’s, managers of computer departments got together and decided programmers should organize programs in the same way, by creating an outline before writing the program, especially since a well-organized program is easier to analyze and improve if the original programmer gets fired.
Those managers invented a computer language that lets the programmer just fill in an outline and feed the outline to the computer. The outline itself acts as the program. No further programming is necessary.
That outline-oriented computer language is used especially for handling tough programming problems in business accounting (such as payroll, inventory, accounts payable, and accounts receivable), so it was named the Common Business-Oriented Language (whose abbreviation is Cobol, which is pronounced “koe ball”). But cynics complain that “Cobol” also stands for Completely Obsolete Business-Oriented Language and Compiles Only Because Of Luck.
4 parts To write a program in Cobol, just fill in an outline that has 4 parts:
Unfortunately, that idea of dividing a program into 4 divisions is wrong-headed: when you write or read a Cobol program, your eye must keep hopping between the PROCEDURE DIVISION (where the action is) and the DATA DIVISION (which tells what the variables mean), while taking an occasional peek at the ENVIRONMENT DIVISION (which tells what devices are involved). Other programming languages, developed later, use better methods for organizing thoughts.
How Cobol arose During the 1950’s, several organizations developed languages to solve problems in business. The most popular business languages were IBM’s Commercial Translator (developed from 1957-1959), Honeywell’s Fact (1959-1960), Sperry Rand’s Flow-matic (1954-1958), and the Air Force’s Aimaco (1958).
In April 1959, a group of programmers and manufacturers met at the University of Pennsylvania, decided to develop a single business language for all computers, and asked the Department of Defense to help sponsor the research.
The Department agreed. In a follow-up meeting held at the Pentagon in May, the group tentatively decided to call the new language “CBL” (for “Common Business Language”) and created 3 committees.
The Short-Range Committee met immediately and created a language nice enough so the Medium-Range and Long-Range Committees never bothered to meet.
The Short-Range Committee wanted a more pronounceable name for the language than “CBL”. At a meeting in September 1969, the committee members proposed 6 names:
The next day, a member of the committee suggested “Cobol” (Common Business-Oriented Language), and the rest of the committee agreed.
I wish they’d have kept the name “BUSY”, because it’s easier to pronounce and remember than “Cobol”. Today, Cobol programmers are still known as “BUSY bodies”.
From Sperry Rand’s Flow-matic, the new language (called “Cobol”) borrowed 2 rules:
From IBM’s Commercial Translator, Cobol borrowed group items (01 and 02), PICTURE symbols, fancy IF statements, and COMPUTE formulas.
Compromises On some issues, the members of the committee couldn’t agree, so they compromised.
For example, some members wanted Cobol to let programmers write mathematical formulas by using these symbols:
But other members of the committee disagreed: they argued that since Cobol is for stupid businessmen who fear formulas, Cobol should use the words ADD, SUBTRACT, MULTIPLY, and DIVIDE instead. The committee compromised: when you write a Cobol program, you can use the words ADD, SUBTRACT, MULTIPLY, and DIVIDE; you can use a formula instead but just if you warn the computer by putting the word COMPUTE before the formula.
Can Cobol handle long numbers? How long? The committee decided that Cobol would handle any number up to 18 digits long and handle any variable name up to 30 characters long. So the limits of Cobol are “18 and 30”.
Cobol’s popularity In 1960, the Defense Department announced it would buy just computers that understand Cobol, unless a manufacturer can demonstrate why Cobol isn’t helpful. In 1961, Westinghouse Electric Corp. made a similar announcement. Other companies followed. Cobol became the most popular computer language.
Today it’s still the most popular computer language for maxicomputers, though programmers on minicomputers and microcomputers have switched to newer languages.
Improvements The original version of Cobol was finished in 1960 and called Cobol 60. Then came an improvement, called Cobol 61. The verb SORT and a “Report Writer” feature were added in 1962. Then came Cobol 65, Cobol 68, Cobol 74, and Cobol 85.
Cobol’s most obvious flaw To write a Cobol program, you must put info about file labeling into the data division’s FD command. Since file labeling describes the environment, not the data, Cobol should have been changed, to put the labeling in the environment division instead.
Jean Sammet, who headed some of the Short-Term Committee’s subcommittees, admits her group goofed when it decided to put labeling in the data division. But Cobol’s too old to change now.
The first version of Basic was developed in 1963 and 1964 by a genius (John Kemeny) and his friend (Tom Kurtz).
How the genius grew up John Kemeny was a Jew born in Hungary in 1926. In 1940 he and his parents fled from the Nazis and came to America. Though he knew hardly any English when he began high school in New York, he learned enough so he graduated as the top student in the class. Four years later, he graduated from Princeton summa cum laude even though he had to spend 1½ of those years in the Army, where he helped solve equations for the atomic bomb.
Two years after his B.A., Princeton gave him a Ph.D. in mathematics and philosophy, because his thesis on symbolic logic combined both fields.
While working for the Ph.D., he was Einstein’s youngest assistant. He told Einstein he wanted to quit math and instead hand out leaflets for world peace, but Einstein said leafleting would waste his talents; the best way for him to help world peace would be to become a famous mathematician, so people would listen to him, as they had to Einstein. He took Einstein’s advice and stayed with math.
After getting his Ph.D., he taught symbolic logic in Princeton’s philosophy department. In 1953, most of Dartmouth College’s math professors were retiring, so Dartmouth asked him to come to Dartmouth, chair the department, and bring his friends. He accepted the offer and brought his friends. That’s how Dartmouth stole Princeton’s math department.
At Dartmouth, Kemeny invented several new branches of math. Then Kemeny’s department got General Electric to sell Dartmouth a computer at a 90% discount, in return for which his department had to invent programs for that computer and let General Electric use them. To write the programs, Kemeny invented his own little computer language in 1963 and showed it to his colleague Tom Kurtz, who knew less about philosophy but more about computers. Kurtz added features from Algol and Fortran and called the combination Basic.
After inventing Basic, Kemeny got bored and thought of quitting Dartmouth. Then Dartmouth asked him to become the college’s president. He accepted.
Later, when the Three-Mile Island nuclear power plant almost exploded, President Jimmy Carter told Kemeny to head the investigation, because of Kemeny’s reputation for philosophical and scientific impartiality. Kemeny’s report was impartial — and sharply critical of the nuclear industry.
Basic versus Algol & Fortran Basic is simpler than both Algol and Fortran in two ways:
Is Basic closer to Algol than to Fortran? On the one hand, Basic uses the Algol words FOR, STEP, and THEN and the Algol symbol (or ^). On the other hand, Basic uses the Fortran words RETURN and DIMENSION (abbreviated DIM); and Basic’s “FOR I = 1 TO 9 STEP 2” puts the step size at the end of the statement, like FORTRAN’s “DO 30 I = 1,9,2” and unlike Algol’s “FOR I:=1 STEP 2 UNTIL 9”.
Basic versus Joss Basic is not the simplest computer language. Joss, which was developed a year earlier by the Rand Corporation, is simpler to learn. But Joss runs slower, requires more memory, lacks string variables, and doesn’t let you name your programs (you must give each program a number instead, and remember what the number was).
A few programmers still use Joss and 3 of its variants, called Aid, Focal, and Mumps. Aid appeals to high-school kids; Focal appeals to scientists; Mumps appeals to doctors designing databases of patient records. Though Mumps does have string variables and other modern features, it’s being replaced by newer database languages such as DBase.
6 versions Kemeny & Kurtz finished the original version of Basic in May 1964. It included just these statements:
In that version, the only punctuation allowed in the PRINT statement was the comma.
How Basic became popular During the 1960’s and 1970’s, Kemeny & Kurtz worked on Basic with a fervor that was almost religious.
Dartmouth’s computer was built by General Electric, which quit making computers and sold its computer factory to Honeywell. So Dartmouth’s computer became called a “Honeywell”.
Since Dartmouth’s research on Basic was partially funded by the National Science Foundation, Basic was in the public domain. Other computer manufacturers could use it without worrying about copyrights or patents.
DEC The first company to copy Dartmouth’s ideas was Digital Equipment Corporation (DEC, pronounced “deck”).
HP Soon after DEC started putting Basic on its computers, Hewlett-Packard (HP) did likewise.
How Microsoft Basic arose The first popular microcomputer was the Altair 8800, which used a version of Basic invented by a 20-year-old kid named Bill Gates. His version imitated DEC’s.
The Altair computer was manufactured by a company called Mits, which didn’t treat Bill Gates fairly, so he broke away from Mits and formed his own company, called Microsoft.
Bill Gates and his company, Microsoft, invented many versions of Basic.
All those versions of Basic were written for computers that contained an 8080 or Z-80 CPU. Simultaneously, he wrote 6502 Basic, for computers containing a 6502 CPU.
Unfortunately, 6502 Basic is primitive: it resembles his 8K Basic.
After writing 6502 Basic, Bill wrote an improved version of it, called 6809 Basic, just for Radio Shack’s Color Computer. Radio Shack calls it Extended Color Basic.
Texas Instruments (TI) asked Bill to write a version of Basic for TI computers. Bill said “yes”; but when TI told Bill what kind of Basic it wanted, Bill’s company (Microsoft) found 90 ways that TI’s desires would contradict Microsoft’s traditions. Microsoft convinced TI to change its mind and remove 80 of those 90 contradictions, but TI stood firm on the other 10.
Because of those differences, TI’s computers became unpopular, and TI stopped making them. Moral: if you contradict Bill, you die!
Later, Bill invented an amazingly wonderful version of Basic, better than all earlier versions. He called it Gee-Whiz Basic (GW Basic). It runs just on the IBM PC and clones. When you buy PC-DOS from IBM, you typically get GW Basic at no extra charge. (IBM calls it BasicA.) When you buy MS-DOS for an IBM clone, the typical dealer includes GW Basic at no extra charge.
Beyond GW Basic GW Basic was the last version of Basic that Bill developed personally. All Microsoft’s later improvements were done by his assistants. They created Microsoft Basic for the Mac, Amiga Microsoft Basic (for the Commodore’s Amiga computer), Quick Basic (for the IBM PC and clones), QBasic (which you get instead of GWBasic when you buy MS-DOS version 5 or 6), and Visual Basic (which lets you create Windows programs, so the human can use a mouse and pull-down menus). Those Basics are harder to learn how to use than GW Basic but have advantages: they run faster and include a better editor, more words from Algol and Pascal, and fancier output.
While developing those versions of Basic, Microsoft added 3 exciting new commands: SAY, END IF, and SUB.
The SAY command makes the computer talk, by using a voice synthesizer. For example, to make the computer’s voice say “I love you”, type this command:
That makes the computer translate “I love you” into phonetics and then say the phonetics. That command works just on Amiga computers.
The END IF and SUB commands give Basic some of Pascal’s power. By using the END IF command, you can make the IF statement include many lines, like this:
By using the SUB command, you can give a subroutine a name.
Divergences Microsoft’s versions of Basic are wonderful.
Over the years, several microcomputer manufacturers tried to invent their own versions of Basic, to avoid paying royalties to Bill Gates. They were sorry!
While DEC, HP, Microsoft, and other companies were developing their own versions of Basic, professors back at Dartmouth College were still tinkering with Dartmouth Basic version 6. In 1976, Professor Steve Garland added more commands from Algol, PL/I, and Pascal to Dartmouth Basic. He called his version Structured Basic (SBasic).
One of Basic’s inventors, Professor Tom Kurtz, became chairman of an Ansi committee to standardize Basic. His committee published two reports:
Comparison chart Here are 9 commands in advanced Basic:
Here’s what they accomplish:
This chart shows which versions of Basic understand those 9 commands:
Notice that the Commodore 128 and Radio Shack TRS-80 Color Computer understand 6 of the commands, while the more expensive Apple 2c understands just 1 command. If schools would have bought Commodore 128 and Radio Shack TRS-80 Color Computers instead of Apple 2c’s, students would have become better programmers!
During the early 1960’s, IBM sold two kinds of computers: one kind for scientists, the other kind was for business bookkeepers. For the scientific kind of computer, the most popular language was Fortran. For the business kind of computer, the most popular language was Cobol.
In 1962, IBM secretly began working on a project to create a single, big computer that could be used by everybody: scientists and businesses. IBM called it the IBM 360, because it could handle the full circle of applications. What language should the IBM 360 be programmed in? IBM decided to invent a single language that could be used for both science and business.
IBM’s first attempt at such a language was “Fortran V”. It ran all the Fortran IV programs but added commands for handling strings and fields in data files. Instead of announcing Fortran V, IBM began working in 1963 on an even more powerful language called “Fortran VI”, which would resemble Fortran but be much more powerful and modern (and hence incompatible). It would also include all important features of Cobol and Algol.
As work on Fortran VI progressed, IBM realized it would be so different from traditional Fortran that it should have a different name. In 1964, IBM changed the name to “NPL” (New Programming Language), since the language was intended to go with the IBM 360 and the rest of IBM’s New Product Line. But IBM discovered the letters “NPL” already stood for the National Physics Laboratory in England, so IBM changed the language’s name to Programming Language One (PL/I), to brag it was the first good programming language and all predecessors were worth zero by comparison.
Troubles The committee that invented PL/I had a hard time.
After the design was finished, the language still had to be put on the computer. Since that took 2½ more years of programming and polishing, the language wasn’t available for sale to IBM’s customers until August 1966.
That was too late. It was after IBM had already begun shipping the IBM 360. The 360’s customers continued using Fortran and Cobol, since PL/I wasn’t available initially. After those customers bought, installed, and learned how to use Fortran and Cobol on the 360, they refused to take the trouble to switch to PL/I, especially since PL/I was expensive (requiring twice as much RAM as Cobol, 4 times as much RAM as Fortran) and ran slowly (1½ times as long to compile as Cobol, twice as long as Fortran). Most programmers already knew Fortran or Cobol, were satisfied with those languages, and weren’t willing to spend the time to learn something new.
Some programmers praised PL/I for being amazingly powerful, but others called it just a scheme to get people to buy more RAM. Critics call it a disorganized mess, an “ugly kitchen sink of a language”, thrown together by a committee that was too rushed.
Since PL/I is so big, hardly anybody understands it all. As a PL/I programmer, you study just the part of the language you plan to use. But if you make a mistake, the computer might not gripe: instead, it might think you’re trying to give a different PL/I command from a language part you never studied. Instead of griping, the computer will perform an instruction that wasn’t what you meant.
Stripped versions In 1972, Cornell University developed a stripped-down version of PL/I for students. That version, called PL/C, is a compromise between PL/I’s power and Algol’s pure simplicity.
In 1975, The University of Toronto developed an even more stripped-down version of PL/I, and called it SP/k: it ran faster and printed messages that were more helpful. SP/k came in several sizes: the tiniest was SP/1; the largest was SP/8.
Stripped-down versions of PL/I stayed popular in universities until about 1980, when universities switched to Pascal.
Digital Research invented a tiny version of PL/I for microcomputers and called it PL/M. It couldn’t handle decimals. Most PL/M programmers eventually switched to C.
The full PL/I is still used on big IBM computers, because full PL/I is the only language that includes enough commands to let programmers unleash IBM’s full power.
Statements PL/I uses many statements for input and output. The statement’s meaning depends mainly on the statement’s first word:
These statements interrupt:
These statements handle conditions:
These statements handle variables:
These statements handle general logic:
Half of those statements are borrowed from Fortran, Algol, and Cobol.
Like Algol, PL/I requires a semicolon at the end of each statement. Besides the statements listed above, you can also give an assignment statement (such as “N=5;”), a null statement (which consists of just a semicolon), and a preprocessor statement (which tells the computer how to create its own program).
In 1968, a European committee invented “Algol 68,” which was strange: it even required you to spell some commands backwards. Some members of the committee disagreed with the majority and thought Algol 68 was nuts. One of those dissidents, Niklaus Wirth, quit the committee and created his own Algol version, which he called Pascal. Today, most computerists feel he was right: Pascal is better than Algol 68.
He wrote Pascal in Switzerland, on a CDC maxicomputer that used punched cards. His version of Pascal couldn’t handle video screens, couldn’t handle random-access data files, and couldn’t handle strings well. Those 3 limitations were corrected in later Pascal versions, especially the one invented at the University of California at San Diego (UCSD), which also includes Logo-style commands that move a turtle.
Apple’s Pascal Apple Computer Company got permission to sell an Apple version of UCSD Pascal. Apple ran full-page ads bragging that the Apple 2 was the only popular microcomputer that could handle Pascal.
Apple Computer Company sold an Apple 2 add-on called the Apple Language System, whose $495 price included disks for Pascal & advanced Basic, plus 16K of extra RAM. Many people bought that system were disappointed, when they discovered that Pascal is harder to learn than Basic.
Pascal is helpful just if the program you’re writing is long. Pascal helps you organize and dissect long programs more easily than Basic. But the average Apple 2 owner never wrote long programs and never needed Pascal. Many of Apple’s customers felt “ripped off”, since they spent $495 uselessly.
Pascal’s rise Many programmers who’d written big Fortran programs for big computers switched to Pascal, because Pascal helps organize large programs, and because Fortran is archaic. Many programmers who’d been using PL/I switched to Pascal, because Pascal consumes less RAM than PL/I and fits in smaller computers.
Pascal became popular. Many colleges required freshman computer-science majors to take Pascal, so the College Entrance Examination Board’s Advanced Placement Test in Computer Science required knowing Pascal. Many high-school students studied Pascal to pass that test and prepare for college.
Pascal’s fall Basic has improved (by incorporating many features from Pascal), so Pascal no longer has much advantage over Basic. Now students skip Pascal: after learning Basic, they skip past Pascal to tougher languages: Java and C++. Now the Advanced Placement Test in Computer Science requires knowing Java instead of Pascal.
Pascal is ignored.
After Niklaus Wirth invented Pascal, he designed a more ambitious language, called Modula. He designed the Modula’s first version in 1975, then Modula-2 in 1979. When today’s programmers discuss “Modula”, they mean Modula-2.
Modula-2 resembles Pascal. Like Pascal, Modula-2 requires each program’s main routing to begin with the word BEGIN; but Modula-2 does not require you to say BEGIN after DO WHILE or IF THEN:
That example shows 4 ways that Modula-2 differs from Pascal: Modula-2 says WRITESTRING instead of WRITELN, uses regular quotation marks (") instead of apostrophes, lets you omit the word BEGIN after IF ELSE (and WHILE DO), and lets you omit the word END before ELSE.
Advanced programmers like Modula-2 better than Pascal because Modula-2 includes extra commands for handling subroutines.
Many programmers use C.
How C arose In 1963 at England’s Cambridge University and the University of London, researchers developed a “practical” version of Algol and called it the Combined Programming Language (CPL). In 1967 at Cambridge University, Martin Richards invented a simpler, stripped-down version of CPL and called it Basic CPL (BCPL). In 1970 at Bell Labs, Ken Thompson developed a version that was even more stripped-down and simpler; since it included just the most critical part of BCPL, he called it B.
Ken had stripped down the language too much. It no longer contained enough commands to do practical programming. In 1971, his colleague Dennis Ritchie added a few commands to B, to form a more extensive language, which he called New B. Then he added even more commands and called the result C, because it came after B.
Most of C was invented in 1972. In 1973, it was improved enough so that it was used for something practical: developing a new version of the Unix operating system. (The original version of Unix had been created at Bell Labs by using B. Beginning in 1973, Unix versions were created by using C.)
So C is a souped-up version of New B, which is a souped-up version of B, which is a stripped-down version of BCPL, which is a stripped-down version of CPL, which is a “practical” version of Algol.
C’s peculiarities Like B, C is a tiny language.
In Basic, if you reserve 20 RAM locations for X (by saying DIM X(20)) and then say X(21)=3.7, the computer will gripe, because you haven’t reserved a RAM location for X(21). If you use C instead, the computer will not gripe about that kind of error; instead, the computer will store the number 3.7 in the RAM location immediately after X(20), even if that location’s already being used by another variable, such as Y. As a result, Y will get messed up. Moral: C programs run quickly and dangerously, because in C the computer never bothers to check your program’s reasonableness.
In your program, which variables are integers, and which are real?
In 1975, the U.S. Department of Defense decided it wanted a better kind of computer language and wrote a list of requirements the language would have to meet.
Contest In 1977, the Department held a contest, to see which software company could invent a language meeting such specifications (which were in the process of changing from Tinman to Ironman).
The winner was the Green language, designed by CII-Honeywell-Bull.
The Department decided that the Green language would be called Ada to honor Ada Lovelace, the woman who was the world’s first programmer.
So Ada is a Pascal-like language developed by a French company (CII-Honeywell-Bull) under contract to the U.S. Department of Defense.
Ada is too big to be practical. Researchers made computers understand part of Ada but had difficulty making computers understand the whole language.
DBase was invented by Wayne Ratliff because he wanted to bet on which football teams would win the 1978 season.
He worked at the Jet Propulsion Laboratory (JPL). His coworkers had invented a data-management system called the JPL Display and Information System (JPLDIS), which imitated IBM’s Retrieve. Unfortunately, Retrieve and JPLDIS both required maxicomputers. Working at home, he invented Vulcan, a stripped-down version of JPLDIS small enough to run on the CP/M microcomputer in his house and good enough to let him compile football statistics — though by then he’d lost interest in football and was more interested in the theory of data management and business applications.
In 1979, he advertised his Vulcan data-management system in Byte Magazine. The mailman delivered so many orders to his house that he didn’t have time to fill them all — especially since he still had a full-time job at JPL. He stopped advertising, to give himself a chance to catch up filling the orders.
In 1980, the owners of Discount Software phoned him, visited his home, examined Vulcan, and offered to market it for him. He agreed.
Since “Discount Software” was the wrong name to market Vulcan under, Discount Software’s owners — Hal Lashlee and George Tate — thought of marketing Vulcan under the name “Lashlee-Tate Software”. But since “Lashlee” sounded wimpy, they changed the name to Ashton-Tate Software.
Instead of selling Vulcan’s original version, Ashton-Tate Software decided to sell Wayne’s further improvement, called DBase 2. It ran faster, looked prettier on the screen, and was easier to use.
At Ashton-Tate, George Tate did the managing. Hal Lashlee was a silent partner who just contributed capital.
Ad George Tate hired Hal Pawluck to write an ad for DBase 2. Hal’s clever ad showed a photo of a bilge pump (the kind of pump that removes water from a ship’s bilge). The ad’s headline said: “DBase versus the Bilge Pump”. The ad went on to say that most database systems are like bilge pumps: they suck!
That explicit ad appeared in Infoworld, a weekly newspaper read all computer experts. Suddenly, all experts knew that DBase was the database-management system that claimed not to suck.
The ad generated just one big complaint — from the company that manufactured the bilge pump!
George Tate offered to add a footnote saying “This bilge pump does not suck”. The pump manufacturer didn’t like that either but stopped complaining.
Beyond DBase 2 The original DBase 2 ran on computers using the CP/M operating system. It worked well. When IBM began selling the IBM PC, Wayne invented an IBM PC version of DBase 2, but it was buggy.
He created those early versions of DBase by using assembly language. By using C instead, he finally created an IBM PC version that worked reliably and included extra commands. He called it DBase 3.
DBase 2 and DBase 3 were sold as programming languages, but many people who wanted to use databases didn’t want to learn programming or hire a programmer. So Ashton-Tate created a new version, called DBase 3 Plus, which you can control by using menus instead of typing programming commands; but those menus are hard to learn how to use and incomplete: they don’t let you tap DBase 3 Plus’s full power, which requires you to learn programming.
In 1988, Ashton-Tate began shipping DBase 4, which includes extra programming commands.
Over the years, Ashton-Tate became a stodgy bureaucracy. George Tate died, Wayne Ratliff quit, the company’s list price for DBase grew ridiculously high, and the company was callous to DBase users.
In 1991, Borland bought Ashton-Tate. In 1994, Borland began selling DBase 5, then further improvements. In 1999, Borland gave up trying to sell DBase; Borland transferred all DBase rights to KSoft, which sold Visual DBase 7.5 and tried to develop DBase 2000 (DB2K). The newest version of DBase is DBase Plus 2, published by from DataBased Intelligence (2548 Vestal Parkway East, Vestal NY 13850, phone 607-729-0234 or toll-free 877-322-7340, www.dbase.com).
Other companies make Dbase clones that work better than DBase itself! The most popular clone is Visual FoxPro 9: it runs faster than DBase, includes extra commands, and is marketed by Microsoft.
Easy is a language I developed several years ago. It combines the best features of all other languages. It’s easy to learn, because it uses just these 12 keywords:
Here’s how to use them.…
SAY Easy uses the word SAY instead of Basic’s word PRINT, because SAY is briefer. If you want the computer to say the answer to 2+2, give this command:
The computer will say the answer:
Whenever the computer prints, it automatically prints a blank space afterwards but does not press the Enter key. So if you run this program —
the computer will say:
Here’s a fancier example:
The “AS 3” is a format: it makes the computer print just the first 3 letters of LOVE. The “AT 20 15” makes the computer begin printing LOVE at the screen’s pixel whose X coordinate is 20 and whose Y coordinate is 15. The computer usually prints a blank space after everything, but the word TRIM suppresses that blank space. The exclamation point makes the computer press the Enter key afterwards.
Here’s another example:
It means that henceforth, whenever you give a SAY command, the computer will print the answer simultaneously onto your screen, onto your printer, and onto a disk file named HARRY. If you ever want to cancel that “SAY TO” command, give a “SAY TO” command that contradicts it.
GET Easy uses the word GET instead of Basic’s word INPUT, because GET is briefer. The command GET X makes the computer wait for you to input the value of X. Above the GET command, you typically put a SAY command that makes the computer ask a question.
You can make the GET command fancy, like this:
The “AS 3” tells the computer that X will be just 3 characters; the computer waits for you to type just 3 characters and doesn’t require you to press the Enter key afterwards. The “AT 20 15” makes the computer move to pixel 20 15 before your typing begins, so your input appears at that part of the screen. The “WAIT 5” makes the computer wait just 5 seconds for your response. If you reply within 5 seconds, the computer sets TIME equal to how many seconds you took. If you do not reply within the 5 seconds, the computer sets TIME equal to -1.
LET The LET statement resembles Basic’s. For example, you can say:
To let R be a random decimal, type:
To let R be a random integer from 1 to 6, type:
To let R be a random integer from -3 to 5, type:
REPEAT If you put the word REPEAT at the bottom of your program, the computer will repeat the entire program again and again, forming an infinite loop.
SKIP If you put the word SKIP in the middle of your program, the computer will skip the bottom part of the program. SKIP is like BASIC’s END or STOP.
HERE In the middle of your program, you can say:
An earlier line can say SKIP TO FRED. A later line can say REPEAT FROM FRED. The SKIP TO and REPEAT FROM are like Basic’s GO TO.
IF In your program, a line can say:
Underneath that line, you must put some indented lines, which the computer will do if X<3.
Suppose you give a student a test on which the score can be between 0 and 100. If the student’s score is 100, let’s make the computer say “PERFECT”; if the score is below 100 but at least 70, let’s make the computer say the score and also say “OKAY THOUGH NOT PERFECT”; if the score is below 70, let’s make the computer say “YOU FAILED”. Here’s how:
To shorten the program, use the words NOT and BUT:
The phrase “IF NOT” is like Basic’s ELSE. The phrase “IF NOT BUT” is like Basic’s ELSE IF.
PICK You can shorten that example even further, by telling the computer to pick just the first IF that’s true:
LOOP If you put the word LOOP above indented lines, the computer will do those lines repeatedly. For example, this program makes the computer say the words CAT and DOG repeatedly:
This program makes the computer say 5, 8, 11, 14, and 17:
That LOOP statement is like Basic’s “FOR I = 5 TO 17 STEP 3”. If you omit the “BY 3”, the computer will assume “BY 1”. If you omit the “FROM 5”, the computer will assume “FROM 1”. If you omit the “TO 17”, the computer will assume “to infinity”.
To make the computer count down instead of up, insert the word DOWN, like this:
PREPARE To do an unusual activity, you should PREPARE the computer for it. For example, if you want to use subscripted variables such as X(100), you should tell the computer:
In that example, PREPARE is like Basic’s DIM.
DATA Easy’s DATA statement resembles Basic’s. But instead of saying READ X, say:
HOW In Easy, you can give any command you wish, such as:
If you give that command, you must also give an explanation that begins with the words:
Interrelated features In the middle of a loop, you can abort the loop. To skip out of the loop (and progress to the rest of the program), say SKIP LOOP. To hop back to the beginning of the loop (to do the next iteration of loop), say REPEAT LOOP.
Similarly, you can say SKIP IF (which makes the computer skip out of an IF) and REPEAT IF (which makes the computer repeat the IF statement, and thereby imitate Pascal’s WHILE).
Apostrophe Like Basic, Easy uses an apostrophe to begin a comment. The computer ignores everything to the right of an apostrophe, unless the apostrophe is between quotation marks or in a DATA statement.
Comma If two statements begin with the same word, you can combine them into a single statement, by using a comma.
For example, instead of saying —
you can say:
Instead of saying —
you can say:
More info I stopped working on Easy in 1982 but expect to continue development again. To get on my mailing list of people who want details and updated info about Easy, phone me at 603-666-6644 or send me a postcard.
Most C programmers have switched to an improved C, called C++.
Java is a variant of C++ that runs slower but can be easier to learn.
While you’re using the Internet’s World Wide Web, you often see ads that are animated cartoons. Those ads are created by using Java. That’s Java’s main purpose: to create ads that are annoyingly eye-catching.
Let’s examine the radical languages, beginning with the oldest radical — the oldest hippie — Lisp.
Lisp is the only language made specifically to handle lists of concepts. It’s the most popular language for research into artificial intelligence.
It’s the father of Logo, which is “oversimplified Lisp” and the most popular language for young children. It inspired Prolog, which is a Lisp-like language that lets you make the computer imitate a wise expert and become an expert system.
Beginners in artificial intelligence love to play with Logo and Prolog, which are easier and more fun than Lisp. But most professionals continue to use Lisp because it’s more powerful than its children.
The original version of Lisp was called Lisp 1. Then came an improvement, called Lisp 1.5 (because it wasn’t different enough from LISP 1 to rate the title “LISP 2”). Then came a slight improvement on LISP 1.5, called Lisp 1.6. The newest version of LISP is called Common Lisp; it runs on maxicomputers, minicomputers, and microcomputers.
I’ll explain “typical” Lisp, which is halfway between Lisp 1.6 and Common Lisp.
Typical Lisp uses these symbols:
If you want the computer to add 5 and 2, just type:
When you press the Enter key at the end of that line, the computer will print the answer. (You do not have to say PRINT or any other special word.) The computer will print:
If you type —
the computer will add 1, 3, 1, and 1 and print:
If you type —
the computer will find the difference between 7 and 2*3 and print:
If you type —
the computer will print:
Note you must type an apostrophe before LOVE but must not type an apostrophe afterwards. The apostrophe is called a single quotation mark (or a quote).
You can put a quote in front of a word (such as ‘LOVE) or in front of a parenthesized list of words, such as:
That makes the computer print:
Lisp 1, Lisp 1.5, and Lisp 1.6 don’t understand the apostrophe. On those old versions of Lisp, say (QUOTE LOVE) instead of ‘LOVE, and say (QUOTE (LAUGH LOUDLY)) instead of ‘(LAUGH LOUDLY).
The theory of lists Lisp can handle lists. Each list must begin and end with a parenthesis.
In a list, the first item is called the CAR, and the rest of the list is called the CDR (pronounced “could er” or “cudder” or “coo der”). For example, the CAR of (SAILORS DRINK WHISKEY) is SAILORS, and the CDR is (DRINK WHISKEY).
To make the computer find the CAR of (SAILORS DRINK WHISKEY), type this:
The computer will print:
If you type —
the computer will print:
If you type —
the computer will find the CAR of the CDR of (SAILORS DRINK WHISKEY). Since the CDR of (SAILORS DRINK WHISKEY) is (DRINK WHISKEY), whose CAR is DRINK, the computer will print:
You can insert an extra item at the beginning of a list, to form a longer list. For example, you can insert MANY at the beginning of (SAILORS DRINK WHISKEY), to form (MANY SAILORS DRINK WHISKEY). To do that, tell the computer to CONStruct the longer list, by typing:
The computer will print:
Notice that CONS is the opposite of CAR and CDR. The CONS combines MANY with (SAILORS DRINK WHISKEY) to form (MANY SAILORS DRINK WHISKEY). The CAR and CDR break down (MANY SAILORS DRINK WHISKEY), to form MANY and (SAILORS DRINK WHISKEY).
Variables To make X stand for the number 7, say:
Then if you say —
the computer will print 9.
To make Y stand for the word LOVE, say:
Then if you say —
the computer will say:
To make STOOGES stand for the list (MOE LARRY CURLEY), say:
Then if you say —
the computer will say:
To find the first of the STOOGES, say:
The computer will say:
Your own functions You can define your own functions. For example, you can define (DOUBLE X) to be 2*X, by typing this:
Then if you say —
the computer will print:
REPEAT Let’s define REPEAT to be a function, so that (REPEAT ‘LOVE 5) is (LOVE LOVE LOVE LOVE LOVE), and (REPEAT ‘KISS 3) is (KISS KISS KISS), and (REPEAT ‘KISS 0) is ().
If N is 0, we want (REPEAT X N) to be ().
If N is larger than 0, we want (REPEAT X N) to be a list of N X’s.
You can define the answer to (REPEAT X N) as follows: if N is 0, the answer is (); if N is not 0, the answer is (CONS X (REPEAT X (SUB 1 N))). Here’s how to type that definition:
The top line says you’re going to DEfine a FUNction called REPEAT (X N). The next line says the answer depends on CONDitions. The next line gives one of those conditions: if N is ZERO, the answer is (). The next line says: otherwise, the value is (CONS X (REPEAT X (SUB1 N))). The next line closes the parentheses opened in the second line. The bottom line closes the parentheses opened in the top line.
Then if you type —
the computer will print:
The definition is almost circular: the definition of REPEAT assumes you already know what REPEAT is. For example:
That kind of definition, which is almost circular, is called recursive.
Lisp was the first popular language that allowed recursive definitions.
When the computer uses a recursive definition, the computer refers to the definition repeatedly before getting out of the circle. Since the computer repeats, it’s performing a loop. In traditional Basic and Fortran, the only way to make the computer perform a loop is to say GO TO or FOR or DO. Although Lisp contains a go-to command, Lisp programmers avoid it and write recursive definitions instead.
ITEM As another example of recursion, let’s define the function ITEM so (ITEM N X) is the Nth item in list X, and so (ITEM 3 ‘(MANY SAILORS DRINK WHISKEY)) is the 3rd item of (MANY SAILORS DRINK WHISKEY), which is DRINK.
So define (ITEM N X) as follows:
Here’s what to type:
If your computer doesn’t understand (ONEP N), say (EQUAL 1 N) instead.
Snobol lets you analyze strings more easily than any other language. It can handle numbers also.
Simple example Here’s a simple Snobol program:
When you type the program, indent each line except END. Indent at least one space; you can indent more spaces if you wish. Put spaces around the symbols = and + and other operations.
The first line says A is the integer -2. The next line says B is the real number 8.6. The next line says C is the string “BODY TEMPERATURE IS 98.6”. The next line makes the computer print:
In Snobol, a variable’s name can be short (like A or B or C) or as long as you wish. The variable’s name can even contain periods, like this:
Loop This program’s a loop:
The first line (whose name is FRED) makes the computer print:
The next line makes the computer print —
and then go to FRED. Altogether the computer will print:
Replace Snobol lets you replace a phrase easily.
The first line says X is the string “SIN ON A PIN WITH A DIN”. The next line says: in X, replace the first “IN” by “UCK”. So X becomes “SUCK ON A PIN WITH A DIN”. The next line says the output is X, so the computer will print:
That program changed the first “IN” to “UCK”. Here’s how to change every “IN” to “UCK”:
The first line says X is “SIN ON A PIN WITH A DIN”. The second line replaces an “IN” by “UCK”, so X becomes “SUCK ON A PIN WITH A DIN”. The next line replaces another “IN” by “UCK”, so X becomes “SUCK ON A PUCK WITH A DIN”. The next line replaces another “IN”, so X becomes “SUCK ON A PUCK WITH A DUCK”, which the next line prints.
This program does the same thing:
Here’s how it works:
Delete This program deletes the first “IN”:
The second line says to replace an “IN” by nothing, so the “IN” gets deleted. X becomes “S ON A PIN WITH A DIN”, which the computer will print.
This program deletes every “IN”:
The computer will print:
Count Let’s count how often “IN” appears in “SIN ON A PIN WITH A DIN”. To do that, delete each “IN”; but each time you delete one, increase the COUNT by 1:
The third line tries to delete an “IN”: if successful, the computer proceeds to the next line, which increases the COUNT and goes back to LOOP; if failing (because no “IN” remains), the computer goes to ENDING, which prints the COUNT. The computer will print:
How Snobol developed At MIT during the 1950’s, Noam Chomsky invented a notation called transformational-generative grammar, which helps linguists analyze English and translate between English and other languages. His notation was nicknamed “linguist’s algebra”, because it helped linguists just as algebra helped scientists. (A decade later, he became famous for also starting the rebellion against the Vietnam War.)
Chomsky’s notation was for pencil and paper. In 1957 and 1958, his colleague Victor Yngve developed a computerized version of Chomsky’s notation: the computerized version was a language called Comit. It was nicknamed “linguist’s Fortran”, because it helped linguists just as Fortran helped engineers.
Comit manipulated strings of words. In 1962 at Bell Telephone Laboratories (Bell Labs), Chester Lee invented a variant called Symbolic Communication Language (SCL), which manipulated strings of math symbols instead of words and helped mathematicians do abstract math.
A team at Bell Labs decided to invent a simplified SCL that would also include features from Comit. The team started to call their new language “SCL7” then renamed it “Sexi” (which stands for String Expression Interpreter); but Bell Labs’ management didn’t like sex. Then, as a joke, the team named it Snobol, using the flimsy excuse that Snobol stands for String-Oriented symbolic Language. Though cynics said Snobol didn’t have “a snowball’s chance in hell,” it became popular. It was used mainly to write programs that translate between computer languages. (For example, you could write a Snobol program that translates Fortran to Basic.)
Which is better: Comit or Snobol?
Most new versions of Snobol are named after baseball pitching methods — such as Fasbol, Slobol, and Spitbol. (Spitbol stands for Speedy Implementation of Snobol.)
APL lets you manipulate lists of numbers more easily than any other language.
APL uses special characters that aren’t on a normal keyboard.
To compute 8+9, type this:
Notice the line is indented. Whenever it’s your turn to type, the computer automatically indents the line for you.
When you press the Return key at the end of that line, the computer will print the answer. (You don’t have to say PRINT or any other special word.) The computer will print:
Scalar operators APL uses these scalar operators:
To make the symbol *o, type the symbol *, then press the BACKSPACE key, then type the symbol o.
Order of operations Unlike all other popular languages, APL makes the computer do all calculations from right to left. For example, if you type —
the computer will start with 5, add 3 (to get 8), and then multiply by 2 (to get 16). The computer will print:
In Basic and most other languages, the answer would be 11 instead.
If you type —
the computer will start with 3, subtract it from 4 (to get 1), and then subtract from 9 (to get 8). The computer will print:
In most other languages, the answer would be 2 instead.
You can use parentheses. Although 9-4-3 is 8, (9-4)-3 is 2.
Compare these examples:
In both examples, the 4 is preceded by a negative sign; but in the second example, the negative sign is raised, to be as high as the 4. (To make the raised negative, tap the 2 key while holding down the Shift key. To make a regular negative, tap the + key while holding down the Shift key.) The first example makes the computer start with 6, add 4 (to get 10), and then negate it (to get -10). The second example makes the computer start with 6 and add -4, to get 2.
Double precision APL is super-accurate. It does all calculations by using double precision.
Variables You can use variables:
The first line says X is 3. The second line makes the computer print X+2. The computer will print:
A variable’s name can be long: up to 77 letters and digits. The name must begin with a letter.
Vectors A variable can stand for a list of numbers:
The first line says Y is the vector 5 2 8. The next line makes the computer add 1 to each item and print:
This program prints the same answer:
The computer will print:
This program prints the same answer:
You can add a vector to another vector:
The computer will add 5 to 3, and 2.1 to 2.8, and 6 to - 7, and print:
This program prints the same answer:
This program prints the same answer:
Here’s something different:
The first line says X is the vector 4 2 3. The next line makes the computer print the sum, 9.
This program prints the same answer:
You can combine many ideas on the same line, but remember that the computer goes from right to left:
The computer will start with 2 4 7, multiply it by 5 1 3 (to get 10 4 21), find the sum (which is 35), multiply by 6 (to get 210), add 1 4 3 (to get 211 214 213), and then subtract from 219 (to get 8 5 6). The computer will print:
Each of APL’s scalar operators works like addition. Here are examples:
Vector operators Here are vector operators; the examples assume V is 8 5 6:
Love or hate? Some programmers love APL, because its notation is brief. Other programmers hate it, because its notation is hard for a human to read. The haters are winning, and the percentage of programmers using APL is decreasing.
Logo began in 1967, during an evening at Dan Bobrow’s home in Belmont, Massachusetts. He’d gotten his Ph.D. from MIT and was working for a company called Bolt, Beranek, and Newman (BBN). In his living room were 3 of his colleagues from BBN (Wally Feurzeig, Cynthia Solomon, and Dick Grant) and an MIT professor: Seymour Papert. BBN had tried to teach young kids how to program by using BBN’s own language (Telcomp), which was a variation of Joss. BBN had asked Professor Seymour Papert for his opinion. The group was all gathered in Dan’s house to hear Seymour’s opinion.
Seymour chatted with the group, which agreed with Seymour on several points:
That’s how Logo began. Seymour Papert was the guiding light, and all other members of the group gave helpful input during the conversation.
That night, after his guests left, Dan went to his bedroom, where he started writing a program (in Lisp) to make the computer understand Logo.
That’s how Logo was born. Work on Logo continued. The three main researchers who continued improving Logo were Seymour (the MIT guru), Wally (from BBN), and Cynthia (also from BBN). Logo resembled Lisp but required fewer parentheses.
After helping BBN for a year, Seymour returned to MIT. Cynthia and several other BBN folks worked with him at MIT’s Artificial Intelligence Laboratory to improve Logo.
Turtles At first, Logo was as abstract and boring as most other computer languages. But in the spring of 1970, a strange creature walked into the Logo lab. It was a big yellow mechanical turtle. It looked like “half a grapefruit on wheels” and had a pen in its belly:
It also had a horn, feelers, and several other fancy attachments. To use it, you put paper all over the floor and then programmed it to roll across the paper. As it rolled, the pen in its belly drew pictures on the paper. The turtle was controlled remotely by a big computer programmed in Logo.
Suddenly, Logo became a fun language whose main purpose was to control the turtle. Kids watching the turtle screamed with delight and wanted to learn how to program it. Logo became a favorite programming game for kids. Even kids who were just 7 years old started programming in Logo. Those kids were barely old enough to read, but reading and writing were not prerequisites for learning how to program in Logo. All the kids had to know was:
As for the rest of Logo — all that abstract stuff about strings, numbers, and Lisp-like lists — the kids ignored it. They wanted to use just the commands “FD” and “RT” that moved the turtle.
The U.S. Government’s National Science Foundation donated money, to help MIT improve Logo further. Many kids came into the Logo lab to play with the turtles.
The turtles were expensive, and so were the big computers that controlled them. But during the early 1970’s, computer screens got dramatically cheaper; so to save money, MIT stopped building mechanical turtles and instead bought cheap computer screens that showed pictures of turtles. Those pictures were called “mock turtles”.
Cheaper computers Logo’s first version was done on BBN’s expensive weird computer (the MTS 940). Later versions were done on the PDP-1, the PDP-10, and finally on a cheaper computer: the PDP-11 minicomputer (in 1972).
At the end of the 1970’s, companies such as Apple and Radio Shack began selling microcomputers, which were even cheaper. MIT wanted to put Logo on microcomputers but ran out of money to pay for the research.
Texas Instruments (TI) came to the rescue.…
TI Logo TI agreed to pay MIT to research how to put Logo on TI’s microcomputer (the TI-99/4).
TI and MIT thought the job would be easy, since MIT had already written a Pascal program that made the computer understand Logo, and since TI had already written a version of Pascal for the CPU chip inside the TI-99/4. Initially, MIT was worried because the Pascal program running on MIT’s PDP-10 computer handled Logo too slowly; but TI claimed TI’s Pascal was faster than the PDP-10’s and that Logo would therefore run fast enough on the TI.
TI was wrong. TI’s Pascal couldn’t make Logo run fast enough, and TI’s Pascal also required too much RAM. So TI had to take MIT’s research (on the PDP-10) and laboriously translate it into TI’s assembly language, by hand. The hand translation went slower that TI expected. TI became impatient and took a short-cut: it omitted parts of Logo, such as decimals. TI began selling its version of Logo, which understood just integers.
MIT Apple Logo After TI started selling its Logo, the MIT group invented a version of Logo for the Apple. The Apple version included decimals but omitted “sprites” (animated creatures that carry objects across the screen) because Apple’s hardware couldn’t handle sprites fast enough.
MIT wanted to sell the Apple version, since more schools owned Apples than TI computers. But if MIT were to make money from selling the Apple version, MIT might get into legal trouble, since MIT was supposed to be non-profit. And anyway, who “owned” Logo? Possible contenders were:
Eventually, MIT solved the legal problems and sold the rights for “MIT Apple Logo” to two companies: Krell and Terrapin.
Krell was strictly a marketing company. It sold MIT Apple Logo to schools but made no attempt to improve Logo further.
Terrapin, on the other hand, was a research organization that had built mechanical turtles for several years. Terrapin hired MIT graduates to improve Logo further.
LCSI versus competitors Back when MIT was waiting for its lawyers to determine who owned Apple Logo, a group of MIT’s faculty and students (headed by Cynthia Solomon) impatiently left MIT and formed a company called Logo Computer Systems Incorporated (LCSI). That company invented its own version of Logo for the Apple. LCSI became successful and was hired by Apple, IBM, Atari, and Microsoft to invent Logo versions for those systems. Commodore hired Terrapin instead.
For the Apple 2c (and 2e and 2+), you could buy either the official Apple Logo (sold by Apple Computer Inc. and created by LCSI), or “Terrapin Logo for the Apple” (sold by Terrapin), or the original “MIT Logo for the Apple” (sold by Krell). Krell became unpopular, leaving Terrapin and LCSI as the main Logo versions. LCSI’s versions were daring (resulting from wild experiments), while Terrapin’s versions were conservative (closer to the MIT original).
The two companies had different styles: Terrapin was small & friendly and charged little; LCSI was big & rude and charged more. On the phone, Terrapin was nicer than LCSI.
Terrapin’s original owners had financial difficulties, moved to Maine, then sold the company to Harvard Associates (a Massachusetts company that had invented a Logo version called “PC Logo”). So now Terrapin is part of Harvard Associates (run by Bill Glass, who’s friendly). To find out about his Terrapin Logo, look at his Web site (www.terrapinlogo.com) then phone him at 800-774-Logo (or 508-487-4141) or write to 955 Massachusetts Ave. #365, Cambridge MA 02139-3233.
LCSI’s newest, daring version of Logo is MicroWorlds Pro. To find out about it, look at LCSI’s Web site (www.lcsi.ca) then phone LCSI at 800-321-5646. LCSI is based in Montreal, Canada but accepts U.S. mail at PO Box 162, Highgate Springs VT 05460.
Logo versus Basic Most of Logo’s designers hate Basic. They want to eliminate Basic from schools altogether. They believe Logo’s easier to learn than Basic, encourages a kid to be more creative, and lets a kid think in a more organized fashion. They also argue that since Logo is best for little kids, and since switching languages is difficult, kids should continue using Logo until they graduate from high school and should never use Basic.
That argument is wrong. It ignores the fact that knowing Basic is essential to understanding our computerized society. Most programs are still written in Basic, not Logo, because Basic consumes less RAM and because Basic’s newest versions contain many practical features (for business, science, and graphics) that Logo lacks.
Another advantage of Basic is that Logo suffers from awkward notation. For example, in Basic you can type a formula such as —
but in Logo you must type:
Notice how ugly the Logo command looks! Notice you must put a quotation mark before the A but not afterwards! And look at those frightful colons! Anybody who thinks such notation is great for kids is a fool.
Extensible One of Logo’s nicest features is that you can modify Logo and turn it into your own language, because Logo lets you invent your own commands and add them to the Logo language. A language (such as Logo) that lets you invent your own commands is called an extensible language. Though some earlier languages (such as Lisp) were extensible also, Logo is more extensible and pleasanter.
Like Logo, Forth is extensible. But Forth has two advantages over Logo:
Since Forth is extensible and consumes so little of the computer’s memory and time, professional programmers have used Forth often. Famous programs written in Forth include Easywriter (a word-processing program), Valdocs (the operating system for Epson’s first computer), and Rapid File (an easy-to-learn data-management system).
Unfortunately, the original versions of Easywriter and Valdocs contained many bugs, but that’s because their programmers were careless.
In Forth, if you want to add 2 and 3 (to get 5) you do not type 2+3. Instead, you must type:
The idea of putting the plus sign afterwards (instead of in the middle) is called postfix notation. The postfix notation (2 3 +) has two advantages over infix notation (2+3): the computer handles postfix notation faster, and you never need to use parentheses for “order of operations”. But postfix notation hard for humans to read.
Like Forth, ancient HP pocket calculators used postfix notation. If you used such as calculator, you’ll find Forth easy.
Postfix notation is the reverse of prefix notation (+ 2 3), which was invented around 1926 by the Polish mathematician Lukasiewicz. So postfix notation is called reverse Polish notation. Since Forth is so difficult for a human to read, cynics call it “an inhuman Polish joke”.
Forth was invented by Chuck Moore in his spare time while he worked at many schools and companies. He wanted to name it “Fourth”, because he considered it to be an ultra-modern “fourth-generation” language; but since his old IBM 1130 computer couldn’t handle a name as long as “Fourth”, he omitted the letter “u”.
Pilot was invented in 1968 by John Starkweather at the University of California’s San Francisco branch. It’s easier to learn than Basic but intended to be programmed by teachers, not students. Teachers using Pilot can easily make the computer teach students about history, geography, math, French, and other schoolbook subjects.
For example, suppose you’re a teacher and want to make the computer chat with your students. Here’s how to do it in Pilot:
Notice that the Pilot program is briefer than Basic.
Atari, Apple, and Radio Shack have all sold versions of Pilot that include commands to handle graphics. Atari’s version is the best, since it includes the fanciest graphics and music and even a Logo-like turtle, and since it’s also the easiest version to learn how to use.
Though Pilot is easier than Basic, most teachers prefer Basic because it’s available on more computers, costs less, and accomplishes a greater variety of tasks. Hardly anybody uses Pilot.
For specialized applications, use a special language.
If you use Apt, the computer will help you cut metal.
Type an Apt program that says how you want the metal cut. When you run the program, the computer will create a special instruction tape. If you feed that tape into a metal-cutting machine, the machine will cut metal as you said.
Let’s write an Apt program that makes the machine cut out the shaded area:
We’ll make the machine move the cutter where the circles are.
Here’s the program:
Dynamo uses these symbols:
For example, suppose you want to explain to the computer how population depends on birth rate. If you let P be the population, BR be the birth rate, and DR be the death rate, here’s what to say in Dynamo:
The equation says: Population now = Population before + (how long “a moment” is) times (Birth Rate during the past moment - Death Rate during the past moment).
World Dynamics The most famous Dynamo program is the World Dynamics Model, which Jay Forrester programmed at MIT in 1970. His program has 117 equations that describe 112 variables about our world.
Here’s how the program begins:
The first line gives the program’s title. The next line defines the Level of Population, in terms of Birth Rate and Death Rate.
The second equation defines the iNitial Population to be PI (Population Initial). The next equation defines the Constant PI to be 1.65e9, because the world’s population was 1.65 billion in 1900.
The next equation says the Rate BR.KL (the Birth Rate during the next moment) is determined by the Population now and several other factors, such as the BRFM (Birth-Rate-from-Food Multiplier), the BRMM (Birth-Rate-from-Material Multiplier), the BRCM (Birth-Rate-from-Crowding Multiplier), and the BRPM (Birth-Rate-from-Pollution Multiplier). Each of those factors is defined in later equations.
When you run the program, the computer automatically solves all the equations simultaneously and draws graphs showing how the population, birth rate, etc. will change during the next several decades. The graphs show the quality of life will decrease (because of the overpopulation, pollution, and dwindling natural resources). Although the material standard of living will improve for a while, it too will eventually decrease, as will industrialization (capital investment).
The bad outlook is caused mainly by dwindling natural resources. Suppose scientists suddenly make a “new discovery” that lets us reduce our usage of natural resources by 75%. Will our lives be better? The computer predicted that if the “new discovery” were made in 1970, this would happen:
Forrester tried other experiments on the computer. To improve the quality of life, he tested the effect of requiring birth control, reducing pollution, and adopting other strategies. Each of those simple strategies backfired. The graphs showed that the only way to maintain a high quality of life is to adopt a combination strategy immediately:
Other popular applications Although the World Dynamics Model is Dynamo’s most famous program, Dynamo has also been applied to many other problems.
The first Dynamo programs ever written were aimed at helping managers run companies. Just plug your policies about buying, selling, hiring, and firing into the program’s equations; when you run the program, the computer draws a graph showing what will happen to your company during the coming months and years. If you don’t like the computer’s prediction, change your policies, put them into the equations, and see whether the computer’s graphs are more optimistic.
How Dynamo developed Dynamo developed from research at MIT.
At MIT in 1958, Richard Bennett invented a language called Simple, which stood for “Simulation of Industrial Management Problems with Lots of Equations”. In 1959, Phyllis Fox and Alexander Pugh III invented Dynamo as an improvement on Simple. At MIT in 1961, Jay Forrester wrote a book called Industrial Dynamics, which explained how Dynamo can help you manage a company.
MIT is near Boston, whose mayor from 1960 to 1967 was John Collins. When his term as mayor ended, he became a visiting professor at MIT. His office happened to be next to Forrester’s. He asked Forrester whether Dynamo could solve the problems of managing a city. Forrester organized a conference of urban experts and got them to turn urban problems into 330 Dynamo equations involving 310 variables.
Forrester ran the program and made the computer graph the consequences. The results were surprising:
If you ever become a mayor or President, use the computer’s recommendations cautiously: they’ll improve the cities, but only by driving the underemployed out to the suburbs, which will worsen.
In 1970 Forrester created the World Dynamics Model to help “The Club of Rome”, a private club of 75 people who try to save the world from ecological calamity.
A queue is a line of people who are waiting. GPSS analyzes queues. For example, let’s use GPSS to analyze the customers waiting in “Quickie Joe’s Barbershop”.
Joe’s the only barber in the shop, and he spends exactly 7 minutes on each haircut. (That’s why he’s called “Quickie Joe”.)
About once every 10 minutes, a new customer enters the barbershop. More precisely, the number of minutes before another customer enters is a random number between 5 and 15.
To make the computer imitate the barbershop and analyze what happens to the first 100 customers, type this program:
Indent so that the word SIMULATE begins in column 8 (preceded by 7 spaces) and the “10,5” begins in column 19.
When you run the program, the computer will tell you the following.…
Joe was working 68.5% of the time. The rest of the time, his shop was empty and he was waiting for customers.
There was never more than 1 customer waiting. “On the average”, .04 customers were waiting.
There were 101 customers. (The 101st customer stopped the experiment.) 79 of them (78.2% of them) obtained Joe immediately and didn’t have to wait.
The “average customer” had to wait in line .405 minutes. The “average not-immediately-served customer” had to wait in line 1.863 minutes.
How to make the program fancier Below the RELEASE statement and above the TERMINATE statement, you can insert two extra statements:
(Indent so that the 1 before TABLE is in column 2.) Those two statements make the computer add the following comments.
Of the 100 analyzed customers, the “average customer” spent 7.369 minutes in the shop (from when he walked in to when he walked out).
More precisely, 79 customers spend 7 minutes each, 9 customers spend 8 minutes each, 9 customers spend 9 minutes each, 2 customers spend 10 minutes each, and 1 customer had to spend 11 minutes.
The computer also prints the “standard deviation”, “cumulative tables”, and other statistical claptrap.
On your own computer, the numbers might be slightly different, depending on how the random numbers came out. To have more faith in the computer’s averages, try 1000 customers instead of 100.
Alternative languages For most problems about queues, GPSS is the easiest language to use. But if your problem is complex, you might have to use Simscript (based on Fortran) or Simula (an elaboration of Algol) or Simpl/I (an elaboration of PL/I).
RPG is the most popular language for IBM minicomputers, such as the IBM System/3, System/32, System/34, and System/36.
For example, suppose you run a company that provides male football coaches, male boxing trainers, and male strippers, and you have a file called MANHOURS containing one line for each employee:
On each line:
The file’s been typed on punched cards (each line on a separate card).
Let’s make the computer print the whole file onto paper, with spacing between the columns, and also print the total hours worked, like this:
To create the program, start by filling in 4 forms (on paper, by using your pencil).
On form #1 (which resembles Cobol’s ENVIRONMENT DIVISION), describe the controls and files, so the form looks like this:
Form #2 describes the input:
Form #3 describes the calculations:
Form #4 describes the output:
After you’ve filled in the 4 forms by using your pencil, hand them to a typist, who types what you handwrote (but doesn’t type the column headings). Then the program runs!
To do that in Basic, Fortran, or traditional Cobol, you’d have to write a loop; you’d have to say GO TO, DO, or PERFORM. RPG makes the computer do loops automatically, without forcing you to specify how. The order in which you write statements is less important in RPG than in those other languages; you’re less likely to err; RPG is more reliable.
But today, RPG is considered old-fashioned, since newer languages (such as DBase) let you generate loops, totals, and reports even more easily than RPG. Moreover, DBase costs less than RPG and can run on cheaper computers.
The most popular computer language for statistics is SPSS, which stands for Statistical Package for the Social Sciences.
Simple example Suppose you survey 10 of your friends and ask each of them two questions:
Maybe you can guess the answer to the second question by just looking at the person; but to be sure, you’d better ask.
Suppose nobody gives an unusual answer (such as Prohibitionist or Communist or Transsexual or Undecided). You think it would be cool to feed all the data into the computer. For example, if a person said “Republican Female”, you’d feed the computer this line:
If a person said “Democrat Male”, you’d feed the computer this line:
This SPSS program makes the computer analyze the data:
In the top line, the word PARTY begins in column 16. Most SPSS statements consist of a control field (columns 1-15) followed by a specification field (columns 16-80).
When you run the program, the computer will print this kind of table:
Look at the top number in each box. Those numbers say there were 3 male Republicans, 2 male Democrats, 1 female Republican, and 4 female Democrats. The first box says: the 3 male Republicans were 60% of the males, 75% of the Republicans, and 30% of the total population.
The computer prints the table in reverse-alphabetical order: “M” before “F”, and “R” before “D”. Each row is a SEX, and each column is a PARTY. In the program, if you change “SEX BY PARTY” to “PARTY BY SEX”, each row will be a PARTY, and each column will be a SEX.
Fancy features The CROSSTABS statement has options. Here are some of them.
If you want options 3 and 5, put this statement under the CROSSTABS statement:
The CROSSTABS statement has statistics. Here are some of them:
Those statistics are numbers that help you analyze the crosstab table. If you want statistics 1 and 8, insert this statement underneath the CROSSTABS and OPTIONS statements:
It makes the computer print statistics 1 and 8 underneath the table. If you want the computer to print all 9 statistics, say:
The CROSSTABS statement is called a procedure. Here are other procedures SPSS can handle:
Each procedure has its own OPTIONS and STATISTICS.
SPSS includes many other kinds of statements:
SPSS contains more statistical features than any other language. If you don’t need quite so many features, use an easier language, such as STATPAK or DATATEXT.
In 1972, Prolog was invented in France at the University of Marseilles. In 1981, a different version of Prolog arose in Scotland at the University of Edinburgh. In 1986, Turbo Prolog was created in California by Borland International (which also created Turbo Pascal).
Those versions of Prolog are called Marseilles Prolog, Edinburgh Prolog, and Turbo Prolog.
Prolog programmers call Marseilles Prolog the “old classic”, Edinburgh Prolog the “current standard”, and Turbo Prolog the “radical departure”.
Turbo Prolog has two advantages over its predecessors: it runs programs extra-fast, and it uses English words instead of weird symbols. On the other hand, it requires extra lines at the beginning of your program, to tell the computer which variables are strings.
The ideal Prolog would be a compromise, incorporating the best features of Marseilles, Edinburgh, and Turbo. Here’s how to use the ideal Prolog and how the various versions differ from it.…
Creating the database Prolog analyzes relationships. Suppose Alice loves tennis and sailing, Tom loves everything that Alice loves, and Tom also loves football (which Alice does not love). To feed all those facts to the computer, give these Prolog commands:
The top two lines say Alice loves tennis and sailing. In the third line, the “X” means “something”, so that line says: Tom loves something if Alice loves it. The bottom line says Tom loves football.
When you type those lines, be careful about capitalization.
At the end of each sentence, put a period.
That’s how to program by using ideal Prolog. Here’s how other versions of Prolog differ.…
For Edinburgh Prolog, type the symbol “:-” instead of the word “if”.
For Marseilles Prolog, replace the period by a semicolon, and replace the word “if” by an arrow (->), which you must put in every line:
For Turbo Prolog, you must add extra lines at the top of your program, to warn the computer that the person and sport are strings (“symbols”), and the word “loves” is a verb (“predicate”) that relates a person to a sport:
(To indent, press the Tab key. To stop indenting, press the left-arrow key.) When you’ve typed all that, press the Esc key (which means Escape) then the R key (which means Run).
Simple questions After you’ve fed the database to the computer, you can ask the computer questions about it.
Does Alice love tennis? To ask the computer that question, type this:
The computer will answer:
Does Alice love football? Ask this:
The computer will answer:
That’s how the ideal Prolog works. Other versions differ. Marseilles Prolog is similar to the ideal Prolog. Turbo Prolog omits the question mark, says “true” instead of “yes”, and says “false” instead of “no”. Edinburgh Prolog puts the question mark at the beginning of the sentence instead of the end, like this:
Advanced questions What does Alice love? Does Alice love something? Ask this:
The computer will answer:
What does Tom love? Does Tom love something? Ask:
The computer will answer:
Who loves tennis? Ask:
The computer will answer:
Does anybody love hockey? Ask:
The computer doesn’t know of anybody who loves hockey, so the computer will answer:
Does Tom love something that Alice doesn’t? Ask:
The computer will answer:
That’s ideal Prolog.
Prolog’s popularity After being invented in France, Prolog quickly became popular throughout Europe.
Its main competitor was Lisp, which was invented in the United States before Prolog. Long after Prolog’s debut, Americans continued to use Lisp and ignored Prolog.
In the 1980’s, the Japanese launched the Fifth Generation Project, which was an attempt to develop a more intelligent kind of computer. To develop that computer’s software, the Japanese decided to use Prolog instead of Lisp, because Prolog was non-American and therefore furthered the project’s purpose, which was to one-up the Americans.
When American researchers heard that the Japanese chose Prolog as a software weapon, the Americans got scared and launched a counter-attack by learning Prolog also.
When Borland — an American company — developed Turbo Prolog, American researchers were thrilled, since Turbo Prolog ran faster than any other Prolog. It ran faster on a cheap IBM PC than Japan’s Prolog ran on Japan’s expensive maxicomputers! The money that Japan had spent on maxicomputers was wasted! The Americans giggled with glee.
Moral: though the Japanese can beat us in making hardware, we’re still way ahead in software. But wouldn’t it be great if our countries could work together and share talents?