PQA
PQA is an acronym for Performance Quality Assurance. We developed PQA to answer the questions, which APL primitives have slowed down from one build of the Dyalog interpreter to the next, and by how much? Currently, PQA consists of 13,659 benchmarks divided into 136 groups. The Graphs The graph above (and all other graphs in […]
Quicksort in APL Revisited
A message in the Forum inquired on sorting strings in APL with a custom comparison function. First, sorting strings without a custom comparison function obtains with a terse expression: {⍵[⍋↑⍵]} ‘syzygy’ ‘boustrophedon’ ‘kakistocracy’ ‘chthonic’ ┌─────────────┬────────┬────────────┬──────┐ │boustrophedon│chthonic│kakistocracy│syzygy│ └─────────────┴────────┴────────────┴──────┘ Sorting strings with a custom comparison function can also be accomplished succinctly by simple modifications to the Quicksort […]
APL Puns
In the Beginning ⌊ floor ⌈ ceiling ⍟ log ⌊ and ⌈ were punnish when the notation was introduced in 1962. They have long since gone mainstream, used even by respectable mathematicians and computer scientists. To see why ⍟ is a pun, see the Vector article My Favourite APL Symbol. • […]
Response to Feedback on Cut, Under and Merge
At Dyalog ’15 John Scholes and I presented proposals for future operators cut, under, and merge. Following the release of the video of this presentation, we received some feedback from a user. Our response to the feedback may be of wider interest. It’s early days yet for cut, under, and merge (they are tentatively planned […]
The Reflex/Commute Operator
The monadic operator ⍨ is defined and modeled as follows: f⍨ ⍵ ←→ ⍵ f ⍵ ⍺ f⍨ ⍵ ←→ ⍵ f ⍺ {⍺←⍵ ⋄ ⍵ ⍺⍺ ⍺} Reflex Some common well-known functions can be written as f⍨ where f is itself a well-known function: +⍨ double ×⍨ square ?⍨ […]
Permutations
I started composing a set of APL exercises in response to a query from a new APL enthusiast who attended Morten’s presentation at Functional Conf, Bangalore, October 2014. The first set of exercise are at a low level of difficulty, followed by another set at an intermediate level. One of the intermediate exercises is: Permutations […]
In Praise of Magic Functions: Part II
Part I of this post was concerned with the development speed and execution speed of magic functions and should be read before this post. Benefitting from Future and Past Improvements Looking at the magic function for key in Part I, we see that its performance depends on the following APL primitives, listed with information on […]
In Praise of Magic Functions: Part I
A magic function is an APL-coded (dfn) computation in the C source of the interpreter. For example, some cases of ∧.= are coded as MAGIC(“(≢⍺)(↑∘.=↓)⍺⍳⍺⍪⍉⍵”). The rubric “magic function” includes magic functions and magic operators. Acknowledgments. Magic functions in Dyalog are made possible due to work done by John Scholes and Richard Smith. Development Speed […]
A Dialog on APL
A discussion between Nicolas Delcros and Roger Hui Nicolas, Prologue: From a language point of view, thanks to Ken Iverson, it is obvious that you want grade rather than sort as a primitive. Yet from a performance point of view, sort is currently faster than grade. Can one be “more fundamental” than the other? If […]
Exploring Key
In ⍺ f⌸ ⍵, major cells of ⍺ specify keys for the corresponding major cells of ⍵, and f applies to each unique major cell of ⍺ and the major cells of ⍵ having that key. The monadic case f⌸⍵ is equivalent to ⍵ f⌸ ⍳≢⍵. Key is similar to the GROUP BY clause in […]