Are there any open source projects written in APL? [closed]
Asked Answered
S

2

15

I'm trying to learn APL (Kona), and I'm looking for example projects so I can get an understanding of how an experienced APL'er would organize his/her code.

Any open source projects would be helpful but, non-financial or anything lacking heavy math would be awesome.

Sneeze answered 4/6, 2011 at 15:48 Comment(2)
I thought APL existed specifically for heavy math -- one-liner sieve of Eratosthenes: (~R∊R∘.×R)/R←1↓⍳RTannenberg
This shouldn't get closed. The question may be phrased in a borderline way but, the answer is great for a language that is hard to find good resources on.Sneeze
C
13

I've been looking too, and haven't found any yet. APL is a very old language; it completely predates the whole open-source movement. Unlike equally-old Lisp (whose history includes much AI lab research and a spirit of open collaboration), APL's culture has been historically associated with IBM, commercial timesharing systems, and finance. Kevin and I are trying to change this with Kona, though.

There is a fair bit of k code at no stinking loops. Some of it was written for a different version of k than what Kona targets, though. Hakan Kjellerstrand also has an excellent K page.

There are also several great APL/J/K/Q books. I particularly recommend Kenneth Iverson's A Programming Language, Henry Rich's J for C Programmers, Jeffry Borror's Q for Mortals (Q is the newest version of Kx's K), and Gilman & Rose's APL: An Interactive Approach. All but the last are readily available online.

Keep in mind is that many people are using APLs as mathematical tools (like R, mathematica, gnuplot, etc.) rather than for programming, per se. (IMHO, J is best for that.) K is designed to be a more general-purpose programming language, and feels like a synthesis of APL, Lisp, and C. It is an outlier in the language family, though.

Clovis answered 11/6, 2011 at 4:8 Comment(3)
Thanks for the nice words, Scott. Thanks for the nice words, Scott. Another excellent reference to (modern) APL is Dyalog's "Mastering Dyalog APL". A PDF version can be downloadable from dyalog.com/intro . It has - of course - a slant towards the Dyalog system, but is quite general.Coinstantaneous
Somehow I forgot to mention my APL page: hakank.org/apl . It has some more references, for example to some video collections about APL.Coinstantaneous
There is an old style guide on Apter's site ( nsl.com/papers/style.pdf ). All big K projects are locked inside banks. There are no open-source projects written in K as far as I know. Kona is an opportunity to change that. There are lots of things you could do. A memcached replica or a Redis replica would both be fun. See github.com/kevinlawler/kona/… New K projects will have to establish new conventions.Dermatogen
H
-11

If you read this, you will see that Kona is "an open-source implementation of the K programming language (K3.2)". Unfortunately for you, if you visit the homepage for the creator of the K Programming Language and look under products, you will see that K seems to be unsupported.

Also, looking at the Wikipedia articles for both APL and K, the syntax seems to be quite complex (e.g. x@>#:'x is used to sort a list of strings by their length)! I recommend learning Assembler (through nasm; one of the most popular assemblers), C++, C, and maybe Python rather than APL or K (both seem to be unsupported and unused).

Hereditable answered 4/6, 2011 at 16:2 Comment(3)
The syntax is far less complex than it appears, there are just several operators which are all either "op a" or "a op (b)". That's it. x@>#:'x is x[> #:' x] is x[greatest-to-least-indexes length-of each x]. Or, as you said, "sort strings by length". If you want to sort by ascending length, {x@<#:'x}. ({} is a lambda, the arguments x, y, and z are implicit.)Clovis
And while K has a very lispy feel, most of the operator mnemonics come from C. a&b is and/min, a|b is or/max, *a is first, etc.Clovis
K is not unsupported, it is just not openly advertised on the Kx products website. Kdb+ and Q, both mentioned on said product page, are built on top of K (on top of K4, "version 4" of K, to be more precise). Every Kdb+ customer has full access to K.Rebec

© 2022 - 2024 — McMap. All rights reserved.