
APL deserves its renaissance too - okaleniuk
http://wordsandbuttons.online/apl_deserves_its_renaissance_too.html
======
untangle
Neat little tribute article.

APL will not be reborn. If that was going to happen, this century's embrace of
analytics and linear-algebra-rich machine learning would have propelled the
upswell. It didn't and it won't.

Why? It's not the symbols. Not the keyboard. Nor the learning curve. Nor the
lack of standardization, libraries, or GPU support. These are collateral
damage, not primary drivers.

APL will not flourish because it is effectively a DSL with archaic I/O
capability. It is a nearly-pure functional programming language. It's primary
domain is mathematics. Native GUIs, networking, the web -- all uncompetitive
add-ons.

In this sense, APL and Haskell share some DNA.

For dynamic systems modeling for my thesis, I reached for APL and Matlab. I
still code Dyalog APL for recreation. Love it. But I wouldn't build a web app
with it and a wouldn't run my company on it.

~~~
sharpercoder
If you think about it, a decent stack is composed of languages. That's
currently already often true, e.g. the use of IDL languages like
protobuf/flatbuffers. Some languages offer integrated idl like Kotlin (data
classes). Another example is html, where the UI is described using a dsl to
specify elements and CSS for layout & appearance.

This fact caused me to think: should stack also not be made of _other_
languages? Is there a place for a _completely pure_ functional language? I
mean, Haskell is nice, but get a bit awkward with I/O. Same for APL. C# has
nicely integrated data querying, but from a distance is actually at least
somewhat awkward. C# seems to be optimized for mutable domain objects;
everything else can be nicely done but falls somewhat outside it's "identity".

I would love to be able to express functions, functors and math using a terse
math-y language. Whether that be APL or some sort of blend of Haskell and APL
(Haspell? spelling pun intended), I don't care, but it would be great if we
can have nice integrations of these languages in a full stack. Sort-of like
how TypeScript and JavaScript have dialects to enable React syntax to express
HTML within it.

The same thought experiment can be applied to SQL. Can we have a data-querying
language integrated right into, say, C# or Java?

~~~
mattnewport
C# kinda does have a data querying language built right in with LINQ query
expressions, although they seem to have rather fallen out of favor.

~~~
rjbwork
Indeed. But you can still write functional style data querying languages using
LINQ extension methods. IMO, LINQ based DB querying is revolutionary in terms
of the flexibility and capabilities it provides. For complex Relational DB
querying it's pretty great.

I tend to write raw SQL using Dapper these days, because hey, scalability and
such, but for business apps and non-cloud apps, EF and other LINQ-based DB
tools are great.

------
pavlov
I've felt that high-DPI touchscreens are the opportunity for an APL
renaissance, if there's ever going to be one.

Once hardware keyboards standardized around ASCII in the '70s, it cramped the
promise of APL's custom notation. On touchscreen it's trivial to render a
software keyboard that contains the entire symbol set (perhaps even adapted to
the user's experience level to make it less scary initially?). Increased
resolution could be used to make the programs easier to parse visually by e.g.
scaling symbols based on their context and nesting level, just like we do in
math equations.

I'd like to work on an open source APL variant that runs on iPad and/or
touchscreen Windows. It should be aimed at entry-level programmers because
they don't have the imperative mindset strongly ingrained yet. It would be
interesting to see if "touch APL as first language" could be a viable approach
to teaching programming. Just need to find the time somehow... :/

~~~
Analemma_
What's the intersecting region in the Venn diagram between "people who will
program in APL" and "people who will program on a touchscreen" though? They're
small circles to begin with— most programmers seem to have an allergic
reaction to coding on tablets and APL is kind of a hard sell even
notwithstanding the input issue— and so I can't imagine the overlap is many
people at all.

~~~
pavlov
Like I said, it would be an open source project aimed at new learners who
haven't yet built up those preconceptions. It's ok if it doesn't take off
since it's not a business.

(If there's one thing I've learned in my career, it's that you can't change
developers' minds about anything fundamental. We are extremely stuck in our
ways, myself included, and all too ready to pretend that tiny incremental
changes in syntax or tooling are revolutions.)

------
jacquesm
If you want APL to be reborn make a version that supports GPU acceleration.
That _just_ might give it momentum enough to be used, a language that runs
with the native speed of the GPU and that is easy to compose without having to
fiddle with the details could be a winner.

There is this:

[https://github.com/Co-dfns/Co-dfns](https://github.com/Co-dfns/Co-dfns)

But it's not quite it.

As for the word 'deserve': computer languages don't really deserve anything,
they get adopted, or not. APL is a beautiful language and it gives me immense
pleasure when I 'get' a program but the barrier between 'the problem' and 'the
solution' hinges on libraries, eco systems and communities. I suspect that
APL's window of opportunity has passed and even if Clojure became 'a modern
lisp' and Elixir became 'a modern Erlang' I don't really see a big driver
behind 'A modern APL'. What would it do that can't be done in other ways?

~~~
Athas
How is Co-dfns not what you want? It is by far the best attempt I know of for
bringing the full power of APL to accelerators like GPUs[0].

...however, it is _not_ easy. Full APL has a lot of features (like nested
arrays) that are incredibly difficult to map to GPU execution. And in general,
APL is not easier to map to GPUs than your bog standard Numpy-style matrix
library (in fact it's harder, since Numpy only has regular arrays and simple
operations).

[0]: I was involved in a project that targeted only a small well-behaved
subset of APL, which was hard enough:
[https://github.com/henrikurms/tail2futhark](https://github.com/henrikurms/tail2futhark)

------
gregfjohnson
I have used and loved apl\11 and its successors for many years.

It could not be compiled on 64-bit machines, because of some ancient
programming practices that were used throughout the code.

I took some time to update apl\11 so that it compiles and runs on modern
machines.

Did a few other things as well, such as replacing linear algorithms in the
symbol table code with O(logN) algorithms.

I would refer to this project as "heirloom software". It is touchingly old-
fashioned in some ways, a bit dusty, and still fully serviceable.

It is a bit like owning and flying an Ercoupe. A bit quirky, an ongoing effort
of love, but a joy to fly.

Edit your apl with vim, run apl files like scripts from the shell, pipe inputs
and outputs, copy an APL binary or build it anywhere with a C compiler, run it
immediately and conveniently.

My take on the 'funny characters problem' was to go with touch typing, and
stick with ASCII. If you can write APL with your eyes closed, you can use APL-
touchtype. "rho" is "R", "iota" is "I", etc. Trig is "O". Log is "O@*". (APL-
touchtype uses "@" instead of backspace, and with that trivial substitution,
all of the APL overstrikes become APL-touchtype ascii.)

It is ABSOLUTELY a work-in-progress, but anyone who wants to is welcome to
give it a try:

    
    
        https://github.com/gregfjohnson/aplette

------
iainmerrick
I keep hearing APL is great, but like everyone else I find the cryptic symbols
very off-putting. I haven’t seen a really compelling explanation for _why_
it’s great.

It looks like a bunch of matrix and vector functions with very terse names. Is
it significantly different from just taking GLSL, say, and #define-ing one-
character names for all the built-in functions? What is APL’s secret sauce?

This article suggests that a lot of the fun is just the cryptic symbols
themselves. That’s absolutely fine, but it doesn’t seem like something that
“deserves” a renaissance, compared to, say, Lisp, which really does have a
uniquely productive idea at its core.

~~~
zokier
If you don't like the symbols then there are J and K/Q which are ASCII based
but retain many of APLs other characteristics.

[https://en.wikipedia.org/wiki/J_(programming_language)](https://en.wikipedia.org/wiki/J_\(programming_language\))

[https://en.wikipedia.org/wiki/K_(programming_language)](https://en.wikipedia.org/wiki/K_\(programming_language\))

~~~
49bc
If you lose the symbols you lose the terse nature of the language, which as
far as I can tell seems to be one of the most alluring parts of the language
(the author of the blog post shows game of life as essentially a one-liner).

~~~
omaranto
Did you read any J programs? It is just as terse as APL. (Probably K is pretty
terse too, but I won't comment on it as I only know J.)

~~~
vorg
In J, the parens, brackets and braces aren't balanced because those 6 symbols,
i.e. `(`, `)`, `[`, `]`, `{` and `}`, are used as standalone symbols for other
syntactic stuff, making J code very hard to read.

~~~
klibertp
No, parens are parens, used for grouping. The rest is true, though: brackets
`[`, `]` are essentially two flavors of identity function (dyadic) and `{`,
`}` are indexing operators (not sure I remember right, but I think `(<1;2) {
A` would be `A[1][2]` in more common languages).

------
keithnz
J seems to have its fans (
[http://www.jsoftware.com/](http://www.jsoftware.com/) and
[https://en.wikipedia.org/wiki/J_%28programming_language%29](https://en.wikipedia.org/wiki/J_%28programming_language%29)
) and uses ascii instead of all the different symbols.

Some of the code CAN be quite terse (and cryptic) like

quicksort=: (($:@(<#[), (=#[), $:@(>#[)) ({~ ?@#)) ^: (1<#)

I spent a small amount of time learning the basics a while ago, but never
really used it for anything. But it was interesting and I'd have to spend a
lot more time with it to get into the mindset. Popular with some Code Golfers
as well.

~~~
riskneutral
> quicksort=: (($:@(<#[), (=#[), $:@(>#[)) ({~ ?@#)) ^: (1<#)

Please, no. Glyphs / characters are not a scarce or constrained resource in
software development. The major resource constraint is developer time spent
writing, reading and debugging code. APL (and its descendants) are
specifically designed to make these challenges far more difficult than they
need to be.

~~~
keithnz
I think it's worth suspending judgement and opinions about what you think a
programming language should be and evaluate it on its own terms. The preceding
is a terse form of the code, you can write it more verbosely. But just like
regex, terse forms can be very useful once you understand them.

~~~
wwweston
I could also see either the existing chain of ascii glyphs becoming more
legible with some wisely-chosen syntax highlighting, or an editing environment
where the ascii glyphs are used to produce something distinctive, and that
might change how developers relate to the symbols.

------
leoc
The MCM/70
[https://en.wikipedia.org/wiki/MCM/70](https://en.wikipedia.org/wiki/MCM/70) ,
another early microcomputer which failed to thrive, was also an APL machine.
In fact, the computer pictured at the bottom of the article is an MCM/70\.
Interesting to consider what maybe could have been.

(One reason the MCM/70 wouldn't have had BASIC is that its development
predates _BASIC Computer Games_
[https://en.wikipedia.org/wiki/BASIC_Computer_Games](https://en.wikipedia.org/wiki/BASIC_Computer_Games)
, apparently the original, 1973 publication of BASIC listings. Those were all
games written on and for the Dartmouth BASIC system or other DEC
microcomputers. I think (I am not an expert) it was probably this corpus, and
its publication in a readily-available book, that originally drew
microcomputer systems like the ALTAIR towards supporting BASIC.)

------
rbanffy
I will support this, but only if IBM brings back the beam-spring keyboard.

~~~
danielvf
The beam-spring keyboards are still being made - someone bought the patents,
tooling, and supplies from IBM and their main supplier, 22 years ago and has
been making them ever since.

[http://www.pckeyboard.com/page/category/UKBD](http://www.pckeyboard.com/page/category/UKBD)

~~~
privong
They even sell an APL keycap set:
[http://www.pckeyboard.com/page/product/USAPLSET](http://www.pckeyboard.com/page/product/USAPLSET)

~~~
rbanffy
These guys are pretty amazing. I can't recommend their keyboards enough.

------
qwerty456127
APL looks like the best programming language I've ever seen. I wish it could
be extended with SQL and web-service mappings to input-output data
conveniently and to use functions written in other languages (like C and
Python) for acceleration and rapid logic prototyping.

~~~
uryga
Well, there's K, along with its flagship database KDB which lets you write
SQL-like queries and, from what I've heard, integrates very nicely with the
language. idk how good their FFI story is. Unfortunately, you need to pay for
commercial use.

~~~
icen
You can extend kdb with c functions, but they need to take/return their
internal K structures, so you'll need to wrap functions. `2:` is the thing to
look at.

Otherwise there's ipc clients, and a very nice native python integration now.

------
a-saleh
I remember being floored by APL few months ago when I learned about co-dnfs
and watched the stream by Aaron Hsu [1] with quotes like "This code is
perfectly readable, it just isn't in English".

Thing is, when I was thinking about trying it, I never figured out a good toy
project. Like, when I wanted to try anything else, most of the time I would
know I would be able to cobble together a web-service. Haskell, Erlang, even
Prolog.

I understand co-dnfs to be self-hosting, so maybe a toy programming language?

[1]
[https://www.youtube.com/watch?v=gcUWTa16Jc0](https://www.youtube.com/watch?v=gcUWTa16Jc0)

~~~
icen
Do some deep learning. It's very straightfoward, and you only need some
trivial IO.

Writing a programming language _in_ APL is not for the faint of heart - co-
dfns is, alongside it's performance goals, to show that compilers aren't
necessarily a bad fit for APL.

------
FractalLP
I'd love for it to go more mainstream with a high performance open source
implementation. Dyalog is pretty good, and I like J, but feel the missing
symbol leaves something out. K/Q with kdb+ is too expensive, and the other
open source array language implementations (Qnial, Klong, Kona, GNUAPL)are
just not there.

~~~
ratboy666
How is GNU APL not there? It is standards compliant, 99.9% pure APL2 (per ISO
standards), and is actively maintained (bugs and issues are usually turned
around in a day or two). It performs quite well, and can be easily extended. I
have even added memmap vectors to it to achieve even more performance (and to
begin GPGPU integration).

GNU APL also supports a library version (libapl.so) which allows APL2 to be
incorporated into other applications via C ffi. This is my primary use case --
interactive development followed by delivery via libapl.so.

~~~
FractalLP
I think it requires a more expert user. I couldn't get the manual install
process to work on Ubuntu and I believe it requires MinGW or Cygwin to work on
Windows (not for a beginner either). Don't get me wrong, I'm really really
glad it is there.

------
Ruud-v-A
Could Numpy be considered the APL renaissance? Not in syntax, but
conceptually?

~~~
dnautics
If we're going that way, I'd say Julia is closer.

~~~
ChrisRackauckas
In fact, it can get extremely close:

[https://www.youtube.com/watch?v=XVv1GipR5yU](https://www.youtube.com/watch?v=XVv1GipR5yU)

And since you can define your own operators, you could just go all of the way.

~~~
dnautics
You can't define operator precedence though!! (That's a good thing). There was
once a Julia talk about a really old programming language which disallowed any
operator groupings without parens except for the basic seven or eight.

[https://gist.github.com/ityonemo/6512f3b4fd02b9a9cc292cf0f88...](https://gist.github.com/ityonemo/6512f3b4fd02b9a9cc292cf0f88534c5)

also string macros are cheating!

------
chuchana
Here's a partial implementation of APL running on Common Lisp:
[https://github.com/phantomics/april](https://github.com/phantomics/april)

------
rebootthesystem
No, it does not. I used APL professioally for about ten years back in the
80's. I love the language. It is incredibly powerful. Once you internalize
it's like playing the piano, you don't think about the mechanics you play
music.

However, the language did not stand the test of time for far more important
issues than the inconvenience of the character set and the keyboard.

And, no, J is not a successor to APL, even though Iverson created it. J is an
abomination. He made a mistake. He thought that abandoning notation --which is
incredibly powerful-- would solve the APL popularity problem. What he ended-up
creating was a royal mess of the first degree. It's garbage.

APL could be very useful today but someone with the time and context needs to
organize an effort to evolve it into a modern language that retains the power
of what got branded as a "tool for thought" while adding layers of
functionality that are sorely missing. I wish I had the time to embark on this
journey. I would love to do something like that, but I can't.

Again, the character set and keyboard are not the problem. I used to touch
type APL. Didn't take that long to get there. People learn to drive vi/vim.
It's a matter of having to have a reason to make the effort.

And the ecosystem. That's another huge issue.

This has two aspects:

Finding qualified programmers and having access to libraries so you don't
reinvent the wheel.

Back in the day I used to do a lot of work with Forth as well. Great language
for the right applications, but finding qualified Forth programmers was
difficult when the language was popular and it became nearly impossible with
the passage of time.

APL suffers from the same problem, a seriously limited talent pool.

I probably don't need to explain the value and power of having libraries to
support a wide range of applications. Python is a good example of this today.
You can find a library to do just about anything you might care to approach
with Python, from desktop through embedded and web. In many ways the breath
and depth of available libraries an be far more important than language
capabilities and sophistication. After all, if you had to write OpenCV from
scratch there's no amount of APL magic that is going to make you more
efficient and effective than a 15 year old kid with Python and OpenCV.

I see APL mentioned on HN with some frequency. I feel that some here are in
love with the idea of APL rather than understanding the reality of APL. Again,
I love the language, but there's a reason I stopped using it about 25 years
ago.

What's interesting is that C, which I started using way before APL, is still
around and very solid language (with lots of libraries) for the right
applications.

~~~
cowile2
> Finding qualified programmers and having access to libraries so you don't
> reinvent the wheel.

Lots of niche languages have the same problem, notably lisp, but it doesn't do
to say they aren't popular for those reasons. It's circular reasoning.
Languages get those things by being popular. They get popular by having those
things.

Every current "popular" language with good libraries and a large userbase
started with no popularity, no libraries, and no users. They built these
things over time.

The problem is these languages can't create a robust community. They are
powerful, so people don't need large teams to do what they want. They are
different, so it is a bigger investment to understand them. The combination
means they attract the kind of elitists who are not willing to help newcomers
or write basic libraries, the kind of people who are perfectly capable of
reinventing every wheel and doing it better than last time.

No one teaches these languages. How popular could they get if companies and
universities spent millions of hours collectively drilling even the most
marginal programmer on how to use them like they do for C++ and Java?

They would never do it though. Large companies don't want more powerful
languages. They will take the productivity loss for fungible employees. It's
part ego. Middle managers look much more important if they have 20 programmers
write 1,000,000 lines of code over 5 years than two programmers write 10,000
over six months even if functionality is equivalent. It's part bargaining and
risk. If you only have a few programmers, the individual programmer is worth a
lot more. It is also riskier to employ one because she could leave or get hit
by a bus at any time.

~~~
wott
> _No one teaches these languages. How popular could they get if companies and
> universities spent millions of hours collectively drilling even the most
> marginal programmer on how to use them like they do for C++ and Java?_

Schools and universities have been teaching Pascal/Lisp/Caml/Scheme for
decades, yet (almost) nobody used those languages to produce actual software,
neither as a job nor for free software side projects; and a majority of jobs
implied the use of a member of the large C family (or VB at the time).

------
KWxIUElW8Xt0tD9
Learned APL in a college linear algebra class long ago and loved it (still
have the books). Best story: circuit synthesis class assignment to perform
matrix exponentiation -- two lines of APL while the rest of the class was
struggling with FORTRAN and the like.

------
transfire
Thought this very thing a few minutes ago, only to sit down and see this.

------
tlack
Really accessible tutorial format here. More of this could get more people
into APL.

(Although truthfully I don't think that char set will ever fly in a broad
commercial sense)

------
yeukhon
Oh god no. This would kill programming productivity. Why people like these
complicated programming languages? Seriously...

~~~
dTal
Your comment reminded me very much of a paragraph in "Beating the
Averages"[1]:

"As long as our hypothetical Blub programmer is looking down the power
continuum, he knows he's looking down. Languages less powerful than Blub are
obviously less powerful, because they're missing some feature he's used to.
But when our hypothetical Blub programmer looks in the other direction, up the
power continuum, he doesn't realize he's looking up. What he sees are merely
weird languages. He probably considers them about equivalent in power to Blub,
but with all this other hairy stuff thrown in as well. Blub is good enough for
him, because he thinks in Blub."

[1] [http://www.paulgraham.com/avg.html](http://www.paulgraham.com/avg.html)

------
adamnemecek
I would love apl with types.

~~~
bstamour
Have you looked at Perl 6? It's optionally typed, and can be nearly as terse
as apl with some of it's higher order operators.

~~~
FractalLP
You'd have to essentially embed a slow unoptimized APL in it which you can do.
Add that to the fact that P6 is already slow at the moment would be an issue.
Also, unlike APL, your P6 APL operators would probably be only known to you.

It would definitely work though.

~~~
b2gills
Unicode has APL characters, so create the operators using them.

If there is a conflict with an existing feature you could always create a
Slang. A Slang is a module that changes the parser. (It could be argued that
with this feature all programming languages are a subset of Perl 6)

~~~
FractalLP
I've heard that quote, but realistically, that would be a huge project to
write an efficient APL in P6 and as I already said, the performance wouldn't
make you happy.

------
g8oz
noob question: how do I paste those symbols in say Notepad++?

~~~
ASalazarMX
I'm more worried about how to type them with a standard QWERTY keyboard.

~~~
Avshalom
Well I can't say for Windows but in Linux APL is one of the keyboard layouts
standard in basically any install. In KDE you can just go in and enable it, in
gnome/xfce/cinnamon you have to tell the system to actually show you all the
layouts

    
    
      gsettings set org.gnome.libgnomekbd.desktop load-extra-items true
    

in a terminal will make it show up, then you just set it to toggle with some
button.

[https://www.dyalog.com/apl-font-keyboard.htm](https://www.dyalog.com/apl-
font-keyboard.htm)

------
qop
I want to draw APL. Like with a stylus.

That's pretty much how I'd want to use it, and the only way I'd bother. It's
cool tech but it's general purpose appeal is nonexistent and there is already
Julia and Matlab in technical computing space.

If I could draw APL symbols and have some common libraries for JSON and Http
and stuff like that, I could see a renaissance having enough steam to do
something.

Otherwise, it's only the top gun high level nerds that already use it anyways,
that would want to work in non-ascii. Modern developers seem to have an ever
decreasing attention span these days.

How many developers under 25 use vim? It's always less than it was last year.

:(

~~~
untangle
Remember the Palm Pilot? Drawing the ASCII-ish symbols in the little box?
While I did memorize the strokes, I never found the process efficient. I don't
think that drawing APL runes would be any better -- certainly not better than
the key-combos of Dyalog's bespoke APL editor (free for personal use, BTW).

~~~
qop
Wow, actually I do remember that, and it sucked!

So, I've never written apl, and I'm glad I read this comment because that's an
excellent point you raise.

To expand a bit, I was thinking about being able to notate computation
graphically. That's really what I want. Visual programming has existed and has
sucked forever, but those thoughts don't go away that there might be a way to
do it, if I just had the missing piece.

I need to sit down with dyalog and find out what I'm missing, it sounds like.

Thanks!

~~~
eigenspace
To be fair, ownning an iPad Pro, I can say first hand that the handwriting
recognition possible with the stylus is actually quite remarkable and a great
improvement from the old palm-pilot days.

~~~
qop
With that new interface, could you see yourself jotting down a "sentence" of
APL that maybe you think of in a meeting or something?

I mainly am interested in apl as a notation, there's a certain lispy zen to a
language that unifies notation and code into the same thing.

Maybe there are better handwriting notations to explore for what I'm thinking.

~~~
nickpeterson
[https://www.sacrideo.us/paper-is-dead-long-live-paper-
progra...](https://www.sacrideo.us/paper-is-dead-long-live-paper-programming/)

I think one thing to consider would be actually using paper. The terseness
means you don't really pay a 'retyping' penalty.

