And the words that are used for to get this ship confused
Will not be understood as they are spoken
— Bob Dylan “When the ship comes in”
In 2018 and 2019 the vocabulary used to describe the q language changed. Why?
The q language inherited from its ancestor languages (APL, J, A+, k) syntactic terms that made the language seem more difficult to learn than it really is.
So we changed them.
Iverson wrote his seminal book A Programming Language at Harvard with Fred Brooks as a textbook for the world’s first computer-science courses. He adopted Heaviside’s term for higher-order functions: operator. It did not catch on. The term retains this usage in the APL language, but in other languages denotes simple functions such as addition and subtraction. Similarly Iverson’s monadic and dyadic are better known as unary and binary.
In 1990 Iverson and Hui published a reboot of APL, the J programming language. Always alert to the power of metaphor, they referred to the syntactic elements of J as nouns, verbs, and adverbs, with the latter two denoting respectively functions and higher-order functions. Canadian schools used to teach more formal grammar than other English-speaking countries. Perhaps this made the metaphor seem more useful than it now is.
In 2017 an informal poll in London of senior q programmers found none able to give a correct definition of adverb in either English or q. Iverson & Hui’s metaphor no longer had explanatory value.
Worse, discussions with the language implementors repeatedly foundered on conflicting understandings of terms such as verb and ambivalent.
The terms we had inherited for describing q were obstacles in the path of people learning the language. We set out to remove the obstacles.
In revising, our first principle was to use familiar programming-language terms for familiar concepts. So
& would be operators. Primitive functions with reserved words as names became keywords. We had no role for verb. Functions defined in the functional notation would be lambdas, anonymous or not. Operators, keywords, and lambdas would all be functions. Monadic, dyadic, and triadic yielded to unary, binary, and ternary.
Removing verb drained the noun-verb-adverb metaphor of whatever explanatory power it once had. Many candidates were considered as replacements. Iterator was finally adopted at a conference of senior technical staff in January 2019.
The isomorphism between functions, lists and dictionaries is a foundational insight of q. It underlies the syntax of Apply and Index. Defining
- the application of functions
- the indexing of arrays
- the syntax and semantics of iterators
requires an umbrella term for the valence of a function or the dimensions of an array. We follow the usage of J in denoting this as rank, despite the
rank keyword having a quite different meaning.
The following tabulates the changes in terminology. The new terms are used consistently on this site.
Training materials must adopt them to ensure consistency with reference articles.
Consistency helps the reader. Variations in terminology that do not mark a distinction add to the reader’s cognitive load.
This site uses the following terms consistently. If you are writing about q, we recommend you adopt them too.
|element||item, list item|