Articles index:

A collection of articles concerning APL and related languages. (All articles will open in a new window.) To suggest an article for posting, contact us.

A Programming Language

by Dr. Kenneth Iverson
Applied mathematics is largely concerned with the design and analysis of explicit procedures for calculating the exact or approximate values of various functions. Such explicit procedures are called algorithms or programs. Because an effective notation...
Read more...

Ken Iverson Quotations and Anecdotes

by Roger Hui
Ken's ancestors came from Trondheim, Norway. He observed on the serious outlook of Norwegians by retelling a story he had heard on Garrison Keillor's radio show about Lake Woebegone...
Read more...

A Personal History of APL

by Michael Montalbano

I have several reasons for calling this talk a personal history.

For one, I want to make it clear that the opinions I express are my own: they are not the opinions of my employer or of any other organization, group or person. If you agree with them, I am happy to have your concurrence: if you disagree, I'd be happy to defend them. In any event, the praise, blame or indifference my views may inspire in you should be directed to me and to no one else.

What I plan to discuss are things I have done, seen or experienced at first hand....

Read more...

APL Blossom Time (live)

by JCL Guest
Click for an audio file of the live performance of "APL BLossom Time," a song by JCL Guest. This song, set to the tune of "The Battle of New Orleans", recounts the early history of the invention and implementation of APL - "A Programming Language". As mentioned in the introduction, the history covered by the song covers the period from approximately 1962 to 1967. This version was sung by the participants of the APL conference held in San Francisco, California, in 1973.
Listen...

APL Blossom Time (studio)

by JCL Guest, performed by Jim Brown
Click for an audio file of the studio version of "APL BLossom Time," a song by JCL Guest, performed here by noted APL2 implementor, Jim Brown, who also plays guitar on the live version.
Listen...

Automatic Data Processing

by Dr. Kenneth Iverson
The systematic analysis and design of complex algorithms must be based upon a suitable means for their description. Since a precise description of an algorithm is called a "program," a notational scheme for the description of information processes is called a "programming language." A programming language should be concise, precise, consistent over a wide area of application, mnemonic, and economical of symbols....
Read more...

Memory Mapped Files in J

by Chris Burke
J 4.02 supports memory-mapped files. A memory-mapped file can be associated with a J noun - referencing the noun is equivalent to reading the file; changing the noun's value changes the file. Some benefits: there is no need for explicit file i/o operations; memory-mapped files can be much larger than system RAM, yet they can be accessed without page thrashing; accessing memory-mapped files is very efficient....
Read more...

Implementation of Black-Scholes in J

by Eugene McDonnell
This article is about a J version of the Black-Scholes formulas, the brainchild of Myron Scholes and the late Fischer Black. A "call" is an option to buy a stipulated amount of stock at a specified time and price, and a "put" is an option to sell ditto. A person might acquire a call option who expects the price of the asset to rise. The Black-Scholes formulas enable the seller of the option to determine quite accurately what price to charge for such options.
Read more...

A Conversation with Arthur Whitney

When it comes to programming languages, Arthur Whitney is a man of few words. The languages he has designed, such as A, K, and Q, are known for their terse, often cryptic syntax and tendency to use single ASCII characters instead of reserved words. While these languages may mystify those used to wordier languages such as Java, their speed and efficiency has made them popular with engineers on Wall Street.
Read more...

Rationalized APL

by Dr. Kenneth Iverson
Certain aspects of conventional APL (as defined in the IBM publication APL Language) violate some of the fundamental characteristics of the language, and the definitions of some other aspects are too limited to provide clear guidance for systematic extensions. The present paper proposes convenient replacements for the anomalous facilities, and a systematic scheme for extensions, a scheme that does not invalidate the facilities defined in....
Read more...

Rex Swain's APL Information

by Rex Swain
A collection of APL resources, including organizations, publications, vendors, and more, from long-time APLer Rex Swain. Also shows an image of one of the original APL keyboards.
Read more...

Conway's Game of Life in one line of APL

by Michael Gertelman
Before we start to decipher (this seems to be the correct word here) the Life program, let's try to work out the strategy of how to write this program in one line, no matter how impossible it sounds. Life is a cyclic game by its very nature....
Read more...

Solving Sukodu in J

by Roger Hui
Welcome to Sudoku. Sudoku is a popular puzzle in Japan, to where it was imported from the U.S. It was popularized in the West by Wayne Gould, a New Zealander living in Hong Kong. In a November 2004 article in the Times, Gould was quoted as saying that some Sudoku puzzles are so difficult that you can't solve them if your life depended on it. The following Sudoku solver uses a simple but effective strategy. Even puzzles rated as "very hard" require no more than 15 milliseconds and 30 Kbytes on a 500 MHz Pentium 3 computer.
Read more...

Solving Sudoku in Dyalog APL using dynamic functions

The algorithm is simple: handle the matrix as a vector. The rows, columns and sudoku areas are denoted by index vectors. Do the basic checking for the puzzle (i.e. polish) and with the main function. Check one alternative from the list at time: filter all the possible elements for all the cells; if at least one cell is empty = no solution -> take the next from the list; if one cell contains more than one number -> select the cell from the tightest group and add every combination (from this cell) to the list; if all cells contain one number = solution -> take the next from the list.
Read more...

Sudoku in K

by Arthur Whitney
A concise description of how to solve Sudoku puzzles in K.
// arthur whitney

x:(0 6 0 1 0 4 0 5 0
   0 0 8 3 0 5 6 0 0
   2 0 0 0 0 0 0 0 1
   8 0 0 4 0 7 0 0 6
   0 0 6 0 0 0 3 0 0
   7 0 0 9 0 1 0 0 4
   5 0 0 0 0 0 0 0 2
   0 0 7 2 0 6 9 0 0
   0 4 0 5 0 8 0 7 0)

/ all
g:{$[0>m:|/i:b x;,....
....
Read more...

Don't Quote Me: The Single and Double Quotes Problem

by Bob Smith
As Gary Bergquist mentioned in the Limbering Up! column of the 2001 Q2 issue of his newsletter, now that some APL implementations allow both single and double quotes to mark a string, the natural question to ask by anyone who wants to parse such a line is which quote marks delimit the strings and which ones are inside a string. While I am unable to find a simple solution, there is one which involves a very powerful (albeit less than practical) tool called Transitive Closure.
Read more...

A Positive Outlook on APL

on the APL Wiki
A lot of the content of sites like comp.lang.apl is very depressing, and must surely generate a poor impression of APL is stumbled upon by the curious or new-to-APL. I personally think that the future for APL can be very positive, but we need to generate a positive attitude in the things we say and write. Here are a few random seeds - please feel free to amend and append as you wish.
Read more...

APL: a Glimpse of Heaven

by Bernard LeGrand
But to describe the APL language, whether in 3 or 30 pages is as difficult as describing a tennis match or the flight of a seagull: a written document is not capable of matching hands-on experience. Thus the following pages only give a very limited and fragmentary view of the whole wealth of APL. The abundance of APL riches is a glimpse of heaven.
Read more...

Pascal's Triangle in APL

on the Rosetta Code Wiki
How to generate Pascal's triangle of order ⍵ [omega] using APL.
Read more...

Pascal's Triangle in APL

on the APL Wiki
Write an APL function that takes an argument and returns a triangle like the one shown above. The argument defines the number of layers. The shown example has 6 layers. It is not a problem to produce the numbers - it is a formatting task. Of course this can be done in a single line of APL.
Read more...

Pascal's Triangle in J

on the J Wiki
Pascal's triangle is traditionally a triangular arrangement of the binomial coefficients.
                  1
                1   1
              1   2   1
            1   3   3   1
          1   4   6   4   1
        1   5  10   10  5   1
      1   6   15  20  15  6   1
    1   7  21  35   35  21   7  1
  1   8  28   56  70  56  28  8   1
1   9  36  84  126  126 84  36  9   1
In J it is more convenient to treat it as a table and it is seen that Pascal's triangle is simply a table of the ! verb....
Read more...

Pascal's Triangle in J

on the Rosetta Code Wiki
J
   !~/~ i.5
1 0 0 0 0
1 1 0 0 0
1 2 1 0 0
1 3 3 1 0
1 4 6 4 1
...
Read more...

Celebrity Death Match: Pascal vs. Sierpinski

by Devon McCormick
Interesting relation between Pascal's triangle and Sierpinksi triangles also demonstrating an effect of limited numeric precision and how to adjust for it.
Read more...

Diffusion-limited aggregation: an exploration

by Devon McCormick
We began by considering some code on the J wiki which is an implementation of "diffusion-limited aggregation" - a fractal growth model of a wide range of physical phenomena including crystal growth and diffusion of liquids - such as water and oil - in confined areas - such as fractured rock or soil. There's an implementation of DLA on the J wiki that was my inspiration for taking up this topic because it's an interesting problem with some working code....
Read more...

Diffusion-limited aggregation: an exercise in improving code

by Devon McCormick
Diffusion-limited aggregation ("DLA") is a clustering of random particles according to simple rules: particles accumulate into a connected mass by randomly wandering around the mass until they encounter a particle already in the mass, at which point the new particle "sticks". This is an exercise in re-vamping J code to improve its functionality and to introduce concepts unique to J to coders coming from conventional programming backgrounds....
Read more...

Introduction to J in five minutes

by Devon McCormick
A 5-minute introduction to J has yet to be delivered. This was prepared for a "Language Slapdown" in which the objective was for a number of people to present what they like about their favorite language in just five minutes. The only other two requirements are that a "hello, world" example should be given and that there should be no disparagement of other languages.
Read more...

Introduction to J for functional programmers

by Devon McCormick
J is a radically innovative, dynamic, functional, interpreted, interactive, array-based, multi-platform, open-source, mind-blowing notation that also happens to be implemented as a powerful, productivity-enhancing programming language. The entire language fits on one page.
Read more...

Sudoku mit APL

Progresses from 4x4 to 9x9 Sudoku....
by Urs Oswald
(PDF)(German)
Read more...

Tutorial on "encode" and "decode"

Encode (also called representation) and decode (also called base-value) are mixed functions. Their principal use is to convert numbers from one number base to another. Mixed number bases are permitted. Note that encode (‚) is on the N key, while base-value (ƒ) is on the B key. In APL, the representation of a number in a particular number base consists of a vector whose elements are the digit values in that base. For example, the decimal number 31 would be expressed in binary as a vector of five ones....
Read more...

Duplicate Bridge Scoring with APL

by Stephen M. Mansour
Duplicate bridge differs from Rubber Bridge because the pairs are scored not on how many tricks they take, but on how well they play the same hand compared to others. Thus, a pair, which manages to take one more trick than every other pair, will score well even with a poor hand; whereas a pair who can easily take all the tricks and doesn't bid a grand slam will score poorly.
Read more...

Scientific APL2 Computing: Bezier, BSPLINES, NURBS (Curves & Surfaces)

by Jean-Claude Duguet (PDF)
Pierre Bezier, graduated by the Hight Schools "ARTS et METIERS" and "Ecol Superieure D'electricite", also Doctor in Mathematics. He invented the Machines-Transfert, exported by Renault world-wide, revolutionizing the automation for the sequential tooling of motor-blocs etc.
Read more...

Bayesian financial dynamic linear modeling in APL

by Devon McCormick
Bayesian statistics is a brand-new idea that's only about 235 years old. The paper that was to immortalize the last name of the Reverend Thomas Bayes, a Nonconformist minister born in 1702, was published in 1763. Unfortunately for any fame he may have hoped to gain from what proved to be his most influential work, Bayes died some 3 years before. From such inauspicious....
Read more...