This paper was found in a box after one of our many moves. It is dated November 1983, but is probably older.
It needs to be updated by a kind APLer (please email email@example.com).
The paper barely mentions PC's and doesn't mention Windows, GUI programming,
control structures, nested arrays and other "new" language features.
Why APL? Reproduced and edited from an anonymous, undated paper of the same title. Our thanks to the unknown author, and to anyone who can trace the source for us.
IntroductionAPL is one of the most powerful, consistent and concise computer programming languages ever devised.
APL is an interactive language returning answers immediately.
APL is easy to learn and use; if you make a mistake, it is easy to fix.
APL code takes less time to write and debug than any other high level language. This makes it the most efficient and cost effective language from the combined personnel and hardware point of view.
Because of these features, APL is the ideal language for all types of people:
What is APL?APL is a language for describing procedures in the processing of information. It can be used to describe mathematical procedures having nothing to do with computers, or to describe (to a human being) the way a computer works. Most commonly, however, at least at this time, it is used for programming in the ordinary sense of directing a computer to process numeric or alphabetic data.
The language was invented by Kenneth E. Iverson while at Harvard University. The language, originally titled "Iverson Notation", was designed to overcome the inherent ambiguities and points of confusion found when dealing with standard mathematical notation. It was later described in 1962 in a book simply titled "A Programming Language" (hence APL). Towards the end of the sixties, largely through the efforts of IBM, the computer community gained its first exposure to APL. Iverson received the Turing Award in 1980 for this work.
APL is a user-oriented notation, particularly well suited for communication from people to other people or to computers. The notation consists of a set of symbols (letters, numbers, punctuation, algebra, and special shapes), with a very simple set of rules (syntax) for putting them together to describe the processing of data. The data can be either numeric or literal (which includes words and text handling).
In fact there are about a hundred different "primitive (i.e. fundamental to APL) operations which can be performed. This can be compared to having a calculator with over 100 different function keys.
Following the old Chinese proverb that a picture is worth a thousand words, the APL symbol set is the equivalent of many words in describing algorithms or procedures. Often one or a few APL symbols (function) can have the same result as several lines of code in another computer language or of several paragraphs in English. An example is shown later in this article.
APL allows the computer to be used in the same way as many hand-held calculators. Any operation which can be performed on a small calculator can be performed just as easily on a computer using APL. The answer is returned immediately, just as with the ordinary calculator. With just a few keystrokes you can easily:
Is APL Hard To Understand and Use?APL was originally created as a shorthand notation for the communication of mathematical procedures. It is easy to learn and easy to use because it was not designed to make things easier for the computer, but rather to make it easier for man to communicate with the computer.
The extensive use of symbols (or shapes) for company advertising purposes; for communication of information in public places; for traffic signs; etc., shows that our culture is a symbol-oriented and that people take easily to this use.
A number of APL symbols are already taught in every school as part of arithmetic and algebra. The additional ones are easy to learn and can be learned as needed. Thousands of students at the high school level and higher have already demonstrated that APL is easy to learn and can be used effectively in a short time.
Every higher order mathematical operation which can be performed by any large computer can be performed by an APL computer. The difference is that, with APL all of these operations can be performed conversationally while using the computer as a desk calculator. A series of keystrokes is entered, and an answer is immediately returned. If you type something that produces a machine error, the computer tells you exactly what the error was and where it occurred. APL error messages are so clear that any mistakes on your part become immediately apparent. In short, if you know how to use hand-held or desk calculators, you can begin to use an APL computer immediately. You can learn any number of primitive operations quickly by reading either the computer instruction manual or one of the standard books on APL.
Traditional application development usually requires much paperwork before any coding begins. While this is useful for many static application, which should be written from detailed specs, others can only be adequately planned through trial and discovery. Many, if not most, APL applications are written by creating a working framework (prototype) very early in the design cycle, and then by developing of additional versions with further improvements step by step. This is the concept of "throw away" code. The result is an application which more closely meets the needs of the user, allowing him/her to discover new and useful attributes of the applications when using it. In this way, APL helps not only during the coding period but during the design cycle as well.
APL is fascinating to use. It has sometimes been called addictive. A number of businessmen who were introduced to APL at a meeting were so turned on by the ability to do interesting and productive work in a very short time that they stayed up most of the night working at the terminals exploring their new found power! Experiences like these are commonplace and have changed attitudes about computers.
Who Uses APL?APL is widely used in the United States, Canada and Western Europe. It is used by at least half the Fortune 500 industrial concerns. It is used in single departments in very small companies. It is provided as a centralized service in some companies and purchased from outside sources in others. APL applications cover the gamut of computer uses: business, scientific, accounting, engineering, education, actuarial, text processing, pension valuations, simulation, graphics, and many more.
Computers are programmed in APL by financial analysts, actuaries, business managers, clerks, administrative assistants, professional programmers, etc. The common bond among all users is that at last the computer has been made directly available to the end user, to enhance his/her own creativity without being bogged down with a list of computer details and restrictions.
APL encourages direct end-user involvement. In addition to being extremely powerful, APL is very easy to learn. The rules of the language allow non-programmers to create short working programs almost instantly, thereby providing immediate positive reinforcement. Together with the ability to create programs with English language names, this allows the end-user to become directly involved and reduces or eliminates the communication problem between the end-user and the professional programmer. In turn, this shortens turnaround and yields a more accurate representation of the user's needs.
When some of his students who have learned APL, but have not lived through the years of development of computer languages, are introduced to other languages, they wonder why anyone would use them, much less even invent them.
There is a thrill of accomplishment which comes to persons who set out to learn to ride a bicycle, or skate, or hit a target, or master a particular kind of dive - when they actually accomplish that task.
That same thrill comes to the APL user who finds that it is possible to program a tedious job in a very short time; or to use a prepared application program which provides numbers and quickly makes a list or a plot or both; to type in text in a text-handling program which lets him quickly correct all mistakes and produces a finished document at high speed, with justification and paging and other features.
These accomplishments are partly due to the interactive nature of access to APL as compared to batch processing, partly to good application programs. You have to experience it to understand and appreciate it. APL users get this thrill from time to time as they use an APL system. This helps account for their enthusiasm for APL.
In addition to the missionary zeal of actual APL users to promote APL usage, there are other factors contributing to its growth. These include the availability of files with easy access, which make business applications with large databases practical; and the availability of hardware and software from an increasing number of vendors.
Much of the growth has taken place outside the standard DP installations. It indicates both a pent-up demand for computer assistance and the dissatisfaction of potential users with what they too often perceive as the inadequate cooperation, capability and procedures from these closed-shop operations.
Still others buy the economy of scale of a big computer from a time-sharing vendor. For example, it is possible to obtain a single terminal connection to an Amdahl 470 from S.T.S.C., Inc. Finally, you have small stand-alone machines like the SYSTEM 1000 from MCM Computers, the 5120 from IBM, Wycat, the IBM personal computer and many others.
A few uninformed people have made disparaging remarks about these machines as being too small and too slow to be useful. Like the proverbial bee, which continued to fly after some aerodynamic engineers proved that it couldn't, users have gone right ahead proving that their value is worth far more than their cost.
Some of the early MCM computers have gone into insurance companies for actuarial work. They have been reported to provide considerable savings compared to timesharing.
How Does APL Compare with other LanguagesAPL is a very concise language. It is normal for APL programs to have one-fifth as many instructions as programs written in other languages, and one-tenth to one-twentieth the number of instruction lines. Among the reasons for this is that APL is a symbolic language, and single symbols often replace multiple lines of code. Here is a simple comparison of a numerical sort in BASIC, FORTRAN, and APL:
In fact, the APL language has about 100 primitive symbolic functions. The ability to pre-store independently existing variables eliminates the need for creating them within a program. Also, APL permits many statements to be combined into a single line of code. Since fewer lines are coded, programming time decreases. More important, the modularity of APL encourages the generation of many small interdependent programs. As a result debugging time is decreased by approximately 50%. Since half of all programming time is devoted to debugging, the time saved is significant.
People who do not know APL may feel that it is not practical to learn the approximately 35 special shapes in the APL "vocabulary" which represent certain powerful primitive function. But only a few need be learned for any one application. And the ease of learning them is evidenced by the thousands of people from Junior High School student to non-computer professionals who have learned to use APL quickly and efficiently.
People who say that it is easier to program in COBOL than in APL omit to say that COBOL (and other computer languages) is complicated by computer-related restrictions and words reserved for special use, which in the case of COBOL amounts to a list of about 500 such words.
Some people believe that the ultimate goal is to program computers in English. However, experience to date shows that symbols may be better than English for specific cases of communication. For example, consider the programming and documentation of music. Can you imagine trying to write the score for Jingle Bells in words? "Three E's, the third one held twice as long as either of the other two; repeat; etc...!"
English (or any other language) has evolved over centuries as the best form of oral and written communication between people. But there are better ways for communicating between people and computers and the APL symbol set seems to be the most productive system yet devised.
He suggests that "APL contains an exceedingly rich collection of primitive functions which might be adequate to express clearly and comprehensively legislative intent", (where quantitative and logical relationships are involved), and that APL be used to supplement the usual English language legal statements to provide clarity and brevity.
A direct benefit from such a practice would be that the APL statements would also be an actual computer program which could be used to test whether the statements give the expected results from sample data.
There have been many cases reported of a particular application which would not even have been started using traditional batch procedures because of the very long lead-time needed before any possible results could be demonstrated. APL, by reducing both total manpower resources and elapsed time, cna show feasible results in a time that is brief enough to encourage further development.
It is interesting to note that much of the success of the APL time-sharing services has resulted from helping people do jobs they could not get done conveniently through their own internal DP organization.
A common fallacy is that a manager, to protect himself, should only work with the traditional and well accepted languages such as FORTRAN, COBOL, and a few others. But DP managers who are really concerned about productivity and overall data processing costs will not want to stay with slower and most costly development and maintenance procedures when business management wants fast answers and APL can produce them more quickly and with less cost than other languages. As machine costs go down and labor costs go up, APL with its much faster programming time is an outstanding tool for reducing overall data processing costs.
Several people have reported that they can program first in APL and then reprogram into a compiler language and be ahead in both elapsed time and cost compared to doing the whole job in the compiler language.
Unlike COBOL, APL has the option of using a single character symbol or defining any desired name for the same function or a variation of it. APL can be as wordy as COBOL but COBOL cannot be made as concise as APL because it lacks the symbol set and the functions. This is one indication of the relative power and flexibility of the two languages.
Atlantic Richfield Refinery was using remote job entry batch processing for engineering applications. When the engineers were introduced to APL, in less than one year they dropped FORTRAN and switched all work to APL. They estimate that APL takes about one tenth as many lines of code as FORTRAN.
Dr. Fred Brooks in his book "The Mythical Man Month", says in regard to system programming, "I myself find it faster to work out algorithms in APL; then I translate these to PL/1 for matching to the system environment.".
A computing service in England, in benchmark tests, found APL faster than compiled FORTRAN code for large matrix operations. They also reported that development time for APL was one third that for FORTRAN and that when using APL a ten-fold reduction in development costs was not unusual.
Proprietary Computer System reports that IBM's ECAP (Electronic Circuit Analysis Program) is 7000 FORTRAN statements long and required 8 man-years to write and document. The equivalent APL program was developed on their APL system by a novice programmer in less than 6 week of part time effort, and it required less than 700 APL statements.
The Manager of Interactive Programming Systems for one of the large mainframe manufacturers reports that some APL users in his company can be up to ten times as productive writing in APL as in FORTRAN. He also indicated that their APL interpreter is fast enough that reprogramming into FORTRAN does not provide enough of a saving to justify the reprogramming effort.
Peter Redwood in his keynote address to APL76 in Ottawa said that Xerox has converted its financial planning computer use from FORTRAN to APL to provide much better response and flexiblilty.
American Airlines started developing a financial model using a FORTRAN time sharing system. An informal parallel effort was started using APL in the evening. In just four days the APL model was showing preliminary results. By this time it was also clear that the APL version would operate at a fraction of the cost of the FORTRAN version. As a consequence, the whole project was switched to APL.
At IBM, a major planning effort took 212 man-months for an elapsed time of 24 months and operated on a 35 day cycle when done in batch. In APL it took only 26 man-months, and elapsed time of 13 months, and now runs on a 12 day cycle. This nets out as a 6 to 1 advantage in programmer productivity for APL.
The Economics of Using APLThe question of cost should come, not at the sub-optimization level of a few lines of code, but rather at the total cost of data processing. A brief look at the total cost and the contributions of the two major factors helps to make the final decision.
One breakdown is that the total cost is made up of two factors: programming costs (mostly people costs) and running costs (mostly machine costs). Generally people costs are increasing and machine costs are decreasing. Therefore machine optimization costs have less effect than people optimization costs.
Some estimates now are that people costs may be as much as ten times the machine costs over the life of a computer program. In such a case, the entire removal of the machine cost can yeild no better than about 10% reduction in total cost, which is clearly impossible. However, it is possible to get a significant reduction in the programming cost.
Most managers know the costs of data processing but they do not know the total cost of each program over the life of its use. Studies of programming factors have given some very surprising results. Perhaps half the programs written are either one-shot programs or have a life that is very short: on the order of two to three months. These programs take only a few seconds of machine time to run. For these programs, the programming cost, including all compiling and debugging costs, can easily be ten times the running costs. Any machine optimization efforts for these programs are a sheer waste of resources.
Many programs become stable because they are impractical or even impossible to change. Their "stability" is then used as an argument against the need for change, much to the frustration of the operating personnel.
Machine costs during the batch development involve both compile- and run-time for each debugging cycle. This is considerably more than the corresponding APL interpreter run cost for each cycle or the even smaller individual line check possible using APL in calculator mode.
"What advantage could APL have for some of these high-cost, low use programs? Assume $900 for programming cost and $100 for running cost in a non-APL setting. Now assume that APL takes more running time (not always true, but to be conservative 4 times). Let us say that machine cost stays unchanged per cycle (during a given and surely short period of time). Assume, also very conservatively, that during the same time, programming unit cost stays itself unchanged. As APL takes (very conservatively) one-third of the time to write (compared to the non-Apl shop) the programming cost will go down to as much as $300. The new total cost is now only $700 (300+400):a saving of 30% versus the original cost of $1000.
If we consider now these costs on a longer period of time... it's more likely to have the running unit cost reduced by a factor of 2 and the programming unit cost doubled, the new total will then be, considering both the technical and the economical factors, $800 (300x2 + 400/2). This is still 20% less than the original figure, a significant saving.
But to be fair, we have to compare this $800 with the cost which should be considered at the same time when programming or reprogramming (if necessary) using the original or similar technology... then the $800 should be compared to $1850 (2x$900 + $100/2).... Which represents a quite different portrait... a saving of more than 50%."
Why Not Get Into The APL Swing?There is a series of myths associated with APL which have been offered as reasons for not using the language. They are worth discussing and putting to rest.
APL is not readily available
APL processing is much slower than compiled code
APL is mathematical and not for business
APL has no files and the working area is too small to be useful in a business environment
APL is too complicated to learn
APL requires too big an investment to start using
There are very few application packages available
APL is not widely known
APL does not have structured programming
APL programs are harder to read than programs written in other languages
APL is too complicated for managers to learn
Programming groups will be put out of work if everyone can do his or her own work
DP managers will lose control if 'everybody' does his or her own thing by having individual access to computers
Why don't more people consider changing languages? One answer is that most people were only trained in one language. They therefore have difficulty in comparing good and bad features of languages, they cannot adequately evaluate advantages and disadvantages of compilers vs. interpreters, symbol sets, syntax, structure, control, etc.
Another answer, often given, is that they have too much money already invested in programs. This is fallacious, for as mentioned above, probably half or more of all their programs have long since been discarded anyway, and maintenance on the rest may be taking as much as 80% of the programming budget. Here again APL can be effective since much program maintenance in APL can often be done in minutes or hours, and certainly several times faster than in other languages.
Last Update: August 28, 2001
For questions, problems, or comments regarding this website, please send email to:firstname.lastname@example.org