💾 Archived View for blitter.com › apl-books › APLX50 › APLX-manual › www.microapl.com › apl_help › c… captured on 2023-01-29 at 14:24:40.
⬅️ Previous capture (2022-07-17)
-=-=-=-=-=-=-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>The APL Language</TITLE> <META NAME="DESCRIPTION" CONTENT="APL language help page: The APL Language"> <META NAME="KEYWORDS" CONTENT="apl,aplx,apl help"> <!-- %%COMMON_HEAD%% --> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <LINK rel="stylesheet" type="text/css" href="http://www.microapl.com/styles_apl_help.css"> <!-- %%END%%--> </HEAD> <body> <table> <tr> <td width="800" valign="top" colspan="2"> <center>Topic: <A HREF="ch.htm">APLX Help</A> : <A HREF="ch_000.htm">Getting Started with APLX</A>: <A HREF="ch_000_020.htm">Introduction to APLX</A> </center> <center> [ <A HREF="ch_000_010.htm">Previous</A> | <A HREF="ch_000_030.htm">Next</A> | <A HREF="ch.htm">Contents</A> | <A HREF="help_index.htm">Index</A> | <A HREF="http://www.microapl.co.uk/apl/index.html">APL Home</A> ]</center> <br></td> </tr> <tr> <td width="120"> <a href="http://www.microapl.co.uk/apl/index.html"><img height="68" border="0" width="119" src="MicroAPL_logo.gif" alt="www.microapl.co.uk"></a> </td> <td align="left" valign="bottom"> <h1>The APL Language</h1> </td> </tr> <tr> <td width="800" valign="top" colspan="2"> <hr> <H2>Origins of APL</H2> <p>APL began life as a notation for expressing mathematical procedures. Its originator, Dr Kenneth Iverson, published his notation in 1962 in a book called 'A Programming Language' from which title the name APL derives.</p> <p>Subsequently Iverson's notation was implemented on various computers and did indeed become 'a programming language'. The specification of the language was substantially enhanced during the 1980's, notably by Dr James Brown in IBM's APL2, giving rise to the term 'second generation APL' to cover those versions of APL that included the enhanced specifications.</p> <p>The development of the APL language has continued into the 21st century. Whilst retaining compatibility with APL2, APLX Version 4 adds object-oriented language extensions, as well as a large number of other facilities, to the language.</p> <H2>Some features of the language</H2> <H3>Data handling</H3> <p>The ability to handle generalized array data without complicated programming is one of APL's strongest points.</p> <p>The language lets you define and give a name to a single item of data, a list of items, or a table of items, or indeed arrays of more dimensions. This means it's just as easy to write an instruction that adds two tables as one that adds two numbers.</p> <p>The extra work caused by such an instruction is handled by APL internally. It goes through the named arrays of data, successively selecting and adding corresponding items, and it stops automatically when it finds that the items are exhausted.</p> <p>Consequently there's usually no need for counts, loops or any of the mechanisms traditionally used to control such operations in other programming languages: the structure of the data effectively does this for you.</p> <H3>Power</H3> <p>APL has a powerful repertoire of <i>functions</i> (i.e. operations it can perform on data). These include a full range of sophisticated mathematical functions and a range of data manipulative functions which can do anything from a simple sort to a matrix inversion.</p> <p>These functions can be combined so that on a single line you have a series of functions interacting dynamically, one function's results forming the next function's data.</p> <p>APL also has <i>operators</i> which modify the way in which functions are applied. This gives you a range of general purpose building-blocks which can easily be combined in a very flexible and consistent manner.</p> <p>This flexibility, combined with APL's ability to handle complicated data, makes it a uniquely powerful language.<p> <H3>APL Symbols</H3> <p>The syntax of most programming languages is restricted to the ASCII character set, which was originally designed for use in commercial data processing with very limited hardware, and which lacks even a basic multiply symbol. As a result, most programming languages resort to compromises such as using the asterisk symbol for multiply, and compound symbols such as <tt><=</tt> to mean 'less-than-or-equal' or <tt>**</tt> to mean 'power'. APL is not limited to the ASCII characters; instead, it uses a range of symbols to represent its built-in functions. This permits the APL user to carry out a wide range of programming tasks in a very concise manner.</P> <p>There are no reserved words in APL. The symbolic nature of APL gives it an international appeal which transcends different national languages.</p> <p>For many years, the use of special symbols by APL, and the special keyboards and display devices associated with them, was seen by many people as a big disadvantage of the language. Nowadays, with Unicode fonts and easy-to-use input methods, the special symbols are no longer such an issue.</p> <H3>Modularity</H3> <p>Besides giving you functions that are built in to the language, APL lets you define your own. In fact, what you might normally think of as a 'program' consists, in APL, of a collection of user-written functions each of which does a part of the total task.</p> <p>These functions can 'call' each other and exchange data, but each is quite separate and self-contained. This has two very useful consequences.</p> <p>First, debugging is much easier since each function can be tested separately and errors are easy to isolate.</p> <p>Second, it imposes a natural top-down structure on your programs.</p> <p>APLX takes the traditional modularity of APL further by borrowing the concepts of 'object-oriented' programming from other languages. This allows you to define <i>classes</i> (collections of data and related program logic), and to create and use instances of those classes (<i>objects</i>), in a natural APL style. You can even use classes written in other languages such as C#, Visual Basic, Java, or Ruby.</p> <H3>Convenience</H3> <p>APL is convenient to use for many reasons. In the first place, it's concise. A very few lines of APL can do a lot of work. Then it's an essentially interactive language. As you write each line or function you can try it out and get immediate feedback. It's also a fully <i>dynamic</i> language, which means that you do not have to specify in advance what is valid for a given data item or function; you can just use it immediately.</p> <p>In addition, it has a very useful concept called the <i>workspace</i>. This is basically a collection of the data items, functions, and classes which you set up in the course of doing a particular job.</p> <p>The workspace is in computer memory while you work, making everything you want immediately accessible. It can be saved (i.e. copied on to a disc) in its entirety when you stop, and loaded back into memory next time you want to use it.</p> <H3>Ease of learning</H3> <p>APL is easy to learn in the sense that it's easy to get started. You'll be able to do simple things almost immediately.</p> <p>Once started you can explore the language, discovering the functions and techniques that are of interest to you. APL supports this way of learning: it's totally consistent and does not have many arbitrary rules. And, as already said, it supplies immediate results and feedback.</p> <p>What's more, because APL is different from conventional languages, it actually helps to be a computer novice!</p> <p>Some professional programmers find it difficult to accept that APL handles complicated data without loops and counts. They're unused to the APL concept of a 'workspace' in which data and code rub shoulders. They fret about 'type-safety' and the fact that APL lets you do what you want. The functions written by the user behave neither like programs nor subroutines - what are they?</p> <p>If you haven't programmed before, none of these questions will bother you. You'll accept the way APL does things as natural and convenient. For this reason, APL has traditionally been used by people who are not primarily computer programmers, but who need to write quite sophisticated programs in the course of their work or research - actuaries, engineers, statisticians, biologists, financial analysts, market researchers, and so on.</p> <H3>Productivity</H3> <p>Unlike many programming languages, APL wasn't designed to match the ways in which a computer works internally. It was intended to help people define procedures for solving problems.</p> <p>This makes it efficient for people to use, though it may give the computer a little more work to do in the process.</p> <p>This is reflected in development times. You'll find you can produce a working prototype very rapidly. Thanks to the modular approach encouraged by the language, and the ease with which modules can be tested, corrected and combined, it takes little extra time to turn this prototype into the final, fully tested version.</p> <hr> </td> </tr> <tr> <td width="800" valign="top" colspan="2"> <center>Topic: <A HREF="ch.htm">APLX Help</A> : <A HREF="ch_000.htm">Getting Started with APLX</A>: <A HREF="ch_000_020.htm">Introduction to APLX</A> </center> <center> [ <A HREF="ch_000_010.htm">Previous</A> | <A HREF="ch_000_030.htm">Next</A> | <A HREF="ch.htm">Contents</A> | <A HREF="help_index.htm">Index</A> | <A HREF="http://www.microapl.co.uk/apl/index.html">APL Home</A> ]</center> <br></td> </tr> </table> <!-- %%COMMON_BODY_TAIL%% --> <p class="copyright">Copyright © 1996-2010 MicroAPL Ltd</p> <!-- %%END%% --> </body> </html>