Book Review: Programming in J
Vector 8:3, page 67
Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 67
Iverson, Kenneth E., 1991. Programming in J.
Iverson Software Inc., 33 Major Street, Toronto M5S 2K9, Canada.
69 pp., $40.00 + 7% GST.
Programming in J begins as follows:
"This book is an introduction to programming in J, a language available as shareware on a wide variety of computers. Although the primary purpose of study may be to learn to write programs and systems for use on a computer, reading is an interesting and efficient aid to gaining fluency in writing. Much emphasis is therefore given to exercises in reading."
Further on the first page we read that:
"A prospective programmer may feel that learning to read a language is a costly detour on the way to writing, but imagine the analogous case of a person unwilling to learn to read English because he is impatient to learn to write. Moreover, reading alone is a very useful skill; it allows one to read what others have written, in order to quickly grasp otherwise complex procedures."
This monograph, then, is intended to be used primarily as a reader to introduce persons to J. It supplements the ISI Dictionary of J, and the first chapter has been designed "to encourage and reinforce reference" to the dictionary.
The first five of the six chapters are mainly about reading J. Chapter 1, "Introduction", gives an overview of the language. Each of the fifteen sections introduces a topic in J, e.g., nouns and pronouns, verbs and proverbs, conjunctions, and most of the sections contain exercises to read and execute on the computer. Chapter 5, "Experiments", contains further examples for each of the sections of Chapter 1. Chapters 2, 3 and 4, entitled "Adverbs", "Conjugations" and "Verbs", respectively, continue the discussions of these topics begun in Chapter 1. Only in Chapter 6, "Writing Programs", does writing take precedence over reading. This last chapter discusses the use of J in a variety of topics including the preparation and presentation of tables of numerical data, construction of graphs and barcharts, and polynomial manipulation.
Programming in J is attractively printed in a 5½" by 8½" format. The inside back cover gives as Appendix A a table of the fifty-odd foreign conjunctions used for communicating with the host facility, and the outside back cover gives the language summary as is apparently customary in all of the publications from ISI Software.
Persons familiar with APL will recognize Ken Iverson’s terse, even spartan, style. The following are a few short quotes to illustrate his approach to learning J: "Do not be stopped by the discussion of rank; it might be better to defer the matter until rank is used in Section I of this chapter"; "Read Part II.B (Verbs) and enter all examples, but do not become paralyzed by difficulties; it may be best to review them again later"; "Read all of Appendix A lightly and continue with the following experiments"; and "Review Appendix A and experiment with any facilities that look interesting." We should not overlook his one-sentence summary of structured programming given in the last chapter: "Use structured design, constructing each program from a few sentences that themselves employ component functions, which may in turn be constructed of generally-useful components."
Rather than attempt to review the contents of Programming in J let us consider a paragraph or two which might be considered typical of the style and the demands placed on the reader. The following is the discussion of the verb permute given in Section G of Chapter 4:
If
p=. 0 2 4 3 1, thenp{b 'abcde'provides a permutation of the items ofb, andpis said to be a permutation vector. Read the first paragraph of the definition [in the Dictionary] of the dyadic case of permute (C.), and enterp C.bto verify that the result is the same as that ofp{b. Also verify that3 1 C. i.#byieldsp.Read the next paragraph of the definition and reconcile it with the results obtained above. Then examine the following dialogue and read the entire definition of C. (including the monadic case):
EXERCISES
5. Definef=. i.&:A.i.and experiment withf nfor various values ofn.
6. Do the exercises on permutation from Chapter 6.
Programming in J must be read slowly and thoughtfully. Most sections need to be read repeatedly and the examples and exercises experimented with on a computer. The reader who is encountering J for the first time could easily become discouraged. The best advice in reading this monograph can probably be stated in the author’s own words quoted above: Do not become paralyzed by difficulties. Progress will almost certainly be slow initially, but perseverence in reading together with working on simple problems of one’s own with the examples given in the text as models will eventually give a fluency in using J.
Today many conventional programming languages together with spreadsheets, data bases and statistical packages in implementations which are increasingly easier to use compete for our attention. However, this reviewer experienced the same excitement on being introduced to J as he did when he began working with APL twenty-five years ago, and is obtaining the same satisfaction in "mastering J", to use a colleague’s phrase, as he did when he was working with APL. He considers J to be an important step in the development of programming languages.
In his opinion Programming in J, together with the ISI Dictionary of J, are indispensable in understanding J and investigating its place in the computing world of the late twentieth century.
Keith Smillie
Department of Computing Science
University of Alberta
Edmonton, Alberta T6G 2H1