Why Array Programming?
This web site is about exploring the ideas of Array Programming which started in a 50+ year old computer language called APL. Why should we care about concepts from a really old computer language? Many of you might never have heard of it. Some of you may have heard it is like an "alien" language. I love alien artifacts. Besides being beautiful I maintain that APL is a wonderful problem solving language that happens to have vast latent Parallelism. Our programming languages typically teach us to think searially. Loops with accumulators are the death of parallelism. I have been on a crusade to expose the parallel thinking that goes with array programming for years. While at Oracle Labs my collegues and I had some success in mining APL's latent parallelism. Many of us love APL. Some of us both love it and hate it at the same time, it depends on the day. I will rag on it because I so love it.
I think Javascript is a good host language for playing with ideas. These aplish concepts that I will focus on have been evolving for years while in use by people building amazing applications and solving interesting problems.
Why do I like Javascript for this?
- ES2015 finally makes Javascript civilized.
- It's Lispy (if you squint).
- It runs in browsers.
- It runs in servers (node.js).
- It has first class functions and objects.
- First class first class literals for functions, objects, strings numbers, and arrays.
- Runtime types which make it fast and fun to code.
- First class lexical closures that give you true first class functions.
Finally, you can dynamically add properties to any object because you are not stuck with classes. Prototypes are the essense of first class objects.
Functional Fever Dream
In order to play with array programming I have built a library so that we can explore the concepts. I have named this library Functional Fever Dream (FFD). The name is intentionally a little self effacing so you do not take it too seriously prematurely. The library borrows not just from APL but APL's fabulous descendents J, K, Q, DyalogAPL and Trenchard More's Nested Array Theory as emboded in QNial. The library is intended to be a very good toy. Besides the array programming concepts we will explore the libraries implementation. The implementation will not worry about performance and scalability. We don't want to get bogged down in gnarly details too early. There will be ample opportunity to experiment with taking it on the next steps towards "the more real". If you find that you like these ideas then all of the above mentioned languages are available for free for non-comercial use. You should get them all! Who knows, you could wind up as a badass quant programmer in New York City or London.
By using a library instead of a language we will be freed from the idiosyncratic influances of syntax. Well, we will be free at least as far as Javascript will let us. I have implemented a similar library in Java. What was I thinking? It turns out that we can get closer than you might imagine to having the result be "langugae-y". By the end of the dream we will implement the ability to do famous APLish/Jish one liners with Javascript's quasi-literals and quasi-literal parsers. I of the mind that array programming can get by as being viewd as a domain specific language
Why Notebooks?
Along with Functional Fever Dream I have built a Notebook style interface.
This will give us a cell at a time Read Eval Print loop that can be embedded in a "literate context".
I have been addicted to incremental software hacking for years.
When I got my hands on Smalltalk the addiction got worse.
I loved developing by having a set of expressions in a WYSIWYG workspace that let me select code with a mouse and then do a menu pick for "doit" or "print it". Smalltalk encouraged the use of Inspectors so you could do the same sorts of evaluation in a in the context of a single object.
The work in the inspector was not persistent.
When I finally got a copy of Mathematica and started using their notebook I had the blend of capabilities I had always craved.
Mathematica became my all time favorite programming/hacking/mind expanding environment that
I use for the initial exploration of my fuzzy thinking.
A list of cell ready to evaluate. Bigger bodies of code that constitute the system I am building eventually wind up in the cells at the top.
Active development is at the bottom and all my regression tests wind up in the middle in the middle.
You can evaluate all the cells in a Notebook at once and see all the results.
The Notebook style interface that I am co-evolving is inspired by Mathematica,
although it will be much less than the Mathematica's notebooks. The "lessyness" turns out to be liberating.
The important thing to understand is that the library and it's programming interface should be co-evolved with ideas that flow in both directions.
This decission to co-evolve is really an extension of my many years of experience working on Smalltalk80. My above mentioned addiction with evolving the Smalltalk80
programming environment at Xerox Parc and ParcPlace was my longest running addiction which consumed me from 1983 until about 2001.
It was my well spent youth.
The Smalltalk80 programming language and it's environment are marvels of co-evolution. At some point in life everyone should
go get "Squeak" and take it for an extended ride. Build something you have always wanted but were afraid that it would be too hard.
When you want to see a "Real Notebook" give Mathematica a try.
Mathematica is expensive but students can get if for a good price. If you have children of the right age then you must! There is no excuse.
The Personal copy isn't too bad and is just below the level that invokes spousal wrath. The world of Mathematica is easy to get started with and has no upper limit.
There is also an online version of "The Wolfram Language".
I have hopes that Steven Wolfram will figure out how to upload us so that my trained apes brain can be used to help explore the computational universe.
I apologise for all that I am about to get wrong. I am prone to the telling of tall tales. I may exagerate. Some of the stories will feature real people such as Ken Iverson, John Bacus, John McCarthy and others. Take what I say about them with a big grain of sodium. I hope my collegues and the folks from the Array Programming community will set me right when I drift too far.