233 comments

[ 5.1 ms ] story [ 268 ms ] thread
Seems nice in theory, though I'm immediately turned off by having to reach for special characters not on my keyboard.
Julia solves this very gracefully with LaTeX-like input, ie. you type \lambda<TAB> which expands to λ
To avoid this you typically use a character keymap with APL characters accessible with AltGr and Shift+AltGr, for instance AltGr+i for iota and AltGr+r for rho etc. After a while you learn the keystrokes and if you need a less frequently used character you can click on it in the language bar.
someday soon we’ll be able to use voice input to say these characters.

Of course, I’ve been wrong for about a decade. but we have to be getting close

If you want to learn more about array programming languages there is a new podcast series at https://www.arraycast.com with some banter, philosophy, history and a collection of related resources https://www.arraycast.com/resources
Found it when their first ep was posted here on HN a few months ago. Had seen array langs before but never dared to sit down with them. Their pod made me take the plunge. These langs are fascinating. As someone who likes func programming normally it feels related but with reduce on steroids.
Are there companies still producing modern keyboards with APL in mind? I like the idea but can't see how it would be practical with a normal keyboard.
It looks like Dyalog are selling keyboards

> A different keyboard is not required to enter Dyalog glyphs. However, if you would like one, Black Cherry G80-3000 keyboards with Dyalog glyphs engraved are available in UK, US, DE and DK layouts. USB and PS2 adapters are included. The keyboards have been tested using both Microsoft Windows and Linux

https://www.dyalog.com/apl-font-keyboard.htm

I wonder if there are keyboard sticker sets available somewhere. I think I've seen some in the past for video editing software.

Unicomp was selling them for a while, if I remember correctly. I don't see them on their website anymore though (but maybe I didn't look hard enough.)
You can still get them, only on certain keyboard though. I want to say you can purchase the individual key caps as well.
This was initially downvoted, perhaps because I didn’t post confirmation , so in case no one believes me:

https://www.pckeyboard.com/page/product/KBDCFG - choose a color and than select Language -> US APL

https://www.pckeyboard.com/page/product/USAPLSET - keycaps

https://www.pckeyboard.com/page/product/00UA41P4A - premade

(Well, it wasn't me, the comment I'm replying to now says 37 minutes ago. I did downvote your first comment just now, before seeing your self-reply. Sorry. I upvoted your second, to reimburse you.)

When I saw "I want to say" I stared at it for a minute..

I've been hearing it for a while from Yasser Seirawan (US grandmaster) doing chess commentary on major tournaments, on the St Louis chess youtube channel. He's a great storyteller and commentator, seems a wonderful guy, but a kind of walking verbal accident-waiting-to-happen. Like he seems incapable of pronouncing about 50% of names. He started saying "I want to say" frequently in the last couple of years. Lately one or two of his co-commentators starting saying it too. It seems to just mean "I think"—i.e. not "I think it was 1987" but "I wanna say it was 1987"—for no apparent reason except it's more words. (Maybe because no-one can say "You're wrong" to "I want to say"?) I really loathe it. Why tell me you want to say something, why not just say it?! Uh but it doesn't mean that apparently, it just means "I think". That was a perfectly good expression. "I want to say" makes me feel like going into a forest where I never have to hear humans speak again. (Related: I downvote any comment I see starting "Fun fact:"—that should be most strongly discouraged, I believe, being similarly barbarous.)

This is the first time I've seen it in print. I considered replying with a strong objection, imagined whether that could change the expression's course of popularity in English. Was considering favouriting or screenshotting it for further reference when I saw the comment I'm now replying to. Where does it "I want to say" (meaning "I think") come from?!

Apologies for long rant, but I felt I owed you an explanation! Maybe your other downvoter was also trying to nip "I want to say" in the bud on here, before it becomes another "literally" or "fun fact".

This is now an aside, but I suspect it comes from this progression:

"I say that" -> "I want to say that"

It's a verbal form of softening what you're saying and indicating you're not sure. The "online text" version would be to use "IIRC".

Oh thank you, fascinating. Hmm I notice now that "I think" is similar to "I want to say" in literal meaning—not stating the uncertainty, but they're both like "Warning, about to report on what my brain is doing, don't blame me!"
It's similar to the third-personing we do when we have to enforce a rule: "I'm sorry but I have to ..." or "I'm afraid I'm going to ...".

In both cases we're trying to downplay our involvement a bit.

It's a venerable idiom that means something like "I think X, but am more uncertain than 'I think' normally implies."
There are many custom keyboard companies who will put anything you want on a keyboard. It shouldn't be a problem to get APL

I've had keyboards made by "WASD" with Yiddish keycaps (which are slightly different from Hebrew -- there's a double-vov, double-yud, kometz aleph -- here's an online version if you're curious https://keymanweb.com/#ydd-hebr,Keyboard_yiddish_pasekh ) Just upload your graphics and they'll make it.

I can't be the only who though Alexa Presentation Language
As someone who has used APL professionally to maintain a legacy codebase https://en.wikipedia.org/wiki/Write-only_language

Anyway, I like reduce, shape, membership, find, and/or, and ceiling/floor. I actually like dealing with arrays in this way.

IMO, that is why numpy/matlab is so much better than APL.

What is your setup like? I was just messing around with it just now using homebrew's gnu-apl package, and it just seems like a toy language, for example scripting mode is sort of bolted on top of interactive mode, since you have to add an ")OFF" command at the end of your script. How do you handle modules?
GNU APL is mostly a reimplementation of APL2 from the 80s, with some additions that in my opinion do nothing to get it out of the 80s. Dyalog has namespaces, but scripting support is only due to be released in the next version, 18.1.

So I don't know of any APL that allows module-defining scripts. This is really unfortunate since there's no technical reason to prevent it. With lexical scoping (Dyalog has it, GNU doesn't), it's easy to define a module system and I did this in my APL reboot called BQN: https://mlochbaum.github.io/BQN/doc/namespace.html .

BQN is really impressive, and implements a language which is similar to APL, but without a lot of the legacy baggage that Dyalog has gathered over the years.

For someone that wants to get started with array languages and does not have any need to be compatible with APL, then this is probably the best place to get started.

It also has good documentation, unlike my array language. I need to put a lot of effort into it to get even close to what BQN did.

I see it's self-hosted. How much code needs to be written in another language in order to bootstrap the whole thing?
In Javascript it would be probably around 250 lines: the current VM is 500 but that includes extra stuff for performance, and system stuff like math and timers that aren't part of the core language.

This depends a lot on the host language. BQN requires garbage collection because it has closures so an implementation in a language without it needs to include a GC. JS has a lot of conveniences like closures of its own, and the ability to tack properties onto anything, so even other high-level hosts would generally take more code.

I'm thinking Julia could be a good fit. It's garbage collected, pretty fast, and designed for numerical work.
And Julia has APL.jl, implementing APL within Julia, with the beautiful APL characters, using string macros. This library might contain some ideas for implementing your array language.
Agree with both of you: I've been planning to do an embedded BQN for Julia (as well as finish my NumPy one), and having found APL.jl in this thread it looks like a pretty good resource. There are some missing syntax features in the compiler that I'd like to finish first.

If anyone else is interested in working on a Julia VM I think this would be a pretty cool project, and a nice way to learn some of how bytecode interpreters are implemented without getting into the weeds in a low-level language. Join the forums and ask about it!

Thanks for your work on BQN Marshall. Can it run on the desktop though? I know little about JS, but kind of assume it needs a browser? My only experience with JS on the desktop is via bloated electron apps. I always thought a single file executable would be best. Is that possible?
There are multiple VMs. The JS one does run offline with Node.js (it's one file to implement BQN and one for Node-specific stuff like command-line and filesystem interaction), but it's not designed for speed. CBQN is what you want. EDIT: Just run make, which will pull from a bytecode branch if necessary. It doesn't ship with bytecode, so currently you have to bootstrap once with either dzaima/BQN or Node; at some point I'm sure we'll publish a full release that can be compiled with C alone for bootstrapping.

Further details at https://mlochbaum.github.io/BQN/running.html, and feel free to contact me or join the forums for help getting set up!

EDIT: No longer necessary; see edit above.

Updated this gist, so you can also copy the bytecode (into the commented files in src/gen in the CBQN repository) from here: https://gist.github.com/mlochbaum/7208fa5a4dd767102f9a99b363...

Thanks for reaching out. I'll def keep watching the project. Really happy to see there is a C version.

What is the roadmap for I/O and common data formats support on the C side (like csv, json, xml...etc), or do you get all of that with the bootstrapping?

There already is some basic file I/O in CBQN (though not complete yet). Format parsing isn't hard to do in BQN itself, and finishing the base implementation is a priority over fancy built-in interfaces for now.
various interpreters have ways to make external calls via com/web/etc. APL is basically python calling C++/C#/Java/etc.

Seeing pure APL for XML parsing is.. interesting. Most interpreters support saved/read of functions in a more procedural way.

A lot of people seem to have trouble with symbol-based languages, for eg. regular expressions, some parts of Perl, or APL in this case. That seems to be part of the appeal of Python too, for a lot of people, that it's unusually low on non-alphanumeric symbols. I wonder if it has something to do with "Head-voice vs. quiet-mind" [1]. I'm generally on the non-verbal quiet-mind side, and find APL-like languages very intuitive and appealing. Debugging or maintaining them doesn't feel any more difficult than more verbal languages either.

[1] http://web.archive.org/web/20210207121250/http://esr.ibiblio...

I think that quiet vs verbal mind personality difference is really what separates whether people like which languages.

I personally can't stand languages that are "spoken description". I understand the appeal to others but the languages just don't mesh with my way of thought. When I'm programming or building a system I'm thinking in the sense of abstract transformations and structures not in any spoken structure. Often times for me it's easier to draw out what I'm thinking of rather than explain it since there's not necessarily a verbal representation behind what I'm thinking of until I sit down and try to come up with one.

There was study of Harvard undergraduates that demonstrated Greek letters made math harder.

I tell my students that Columbia undergraduates are of course smarter, but still...

Interesting. I was under the impression that Iversion intended APL to also read almost like English, provided you knew the names of operators and idioms.

Aaron Hsu has some talks showing this off about his co-dfns compiler.

Got a server error trying a few examples from the shown tutorial:

~~~~ TryAPL Version 3.4.5 (enter ]State for details) Thu Jun 10 2021 14:30:06 Copyright (c) Dyalog Limited 1982-2021 2 + 2 4 4 2 3 + 8 5 7 12 7 10 ⍳100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 !10 3628800 +/⍳10 55 +/⍳10 SERVER ERROR ~~~~

Yeah, I'm guessing Hug of Death.
Everything here is pretty easily accomplished using vanilla Python (numpy counts as vanilla at this point). I'm having trouble seeing what the advantage is of an "array-based" language over a well-designed array library like numpy.

  import numpy as np
  from collections import Counter

  print(2+2)
  print(np.array([4,2,3]) + np.array([8,5,7]))
  print(np.arange(1,11))
  print(np.arange(1,100001).sum())
  print(np.arange(1,11).prod())

  avg = lambda x: x.sum() / x.shape[0]
  print(avg(np.array([1, 6, 3, 4])))

  throws = np.random.randint(1, 7, size=(10000,))
  print((throws == 1).sum())
  print(Counter(throws))

  print(Counter("Mississippi"))
It's interesting how many programming languages seem to have "accessible to those not trained in it" as a design goal (offhand I can think of SQL and COBOL, but also BASIC and you see it even in Python, etc).

But there are trade-offs doing that, and "amount you can look at at once" is a huge one.

"amount you can look at at once" is severely underestimated.
This.

What I find really annoying is how many people confuse this property ("accessible to those not trained in it") with readability.

It's a shame, too, as the most "dense" recent language we had was perl and that got universally made fun of as "line noise" - which I feel influences people more than they think.
I also wonder how many people understand that linenoise meant noise on a data cable of some description.

i.e. the difference between `d` and `$` is a single bit. If your cable happened to glitch during that first `1` bit, you would get a `$` instead of the `d` you should have.

The thing is that doesn't happen anymore. Or at least when it does happen it gets caught and retransmitted.

---

Which means that some of the first people to say it might not have been making a value judgement, but a statement of fact. (I doubt there was very many in that camp.)

Note that I say that as a person who's second favorite language is Perl. (First favorite is Raku, formally known as Perl6.)

It is too bad that most of coolest features have come to Perl after I switched to Raku.

The point is not _what_ you can achieve, but _how_. You can achieve almost anything in any language, but I bet you can’t implement Game of Life in 20 characters of Python!
What about 17? {≢⍸⍵}⌺3 3∊¨3+0,¨⊢
People like it for the same reason we like modern chess notation over older more verbose notation.

Consider a game that starts with white moving their king side knight to the square in front of the pawn on the bishop's file. Here is how that would have been written through the ages [1].

Early 1600s: The white king commands his owne knight into the third house before his owne bishop.

Mid-1700s: K. knight to His Bishop's 3d.

Early 1800s: K.Kt. to B.third sq.

Around 1850: K.Kt to B's 3rd.

Around 1860: K.Kt to B. 3d.

Around 1870: K.Kt to B3.

Around 1890: KKt-B3.

Early 1900s: Kt-KB3.

Mid 1900s: N-KB3.

Last quarter of 1900s to present: Nf3 or ♘f3 if you want to avoid language-specific piece names.

Reading that numpy code compared to reading APL is like reading a record of a chess game from around 1700.

[1] https://www.knightschessclub.org/the_history_of_notation.htm...

Exist power in being fully immerse in a paradigm. You can do OO on C, but still you are on C, that is not OO.

You can do arrays on python, but python is not an array language.

In other words, the moment you mix 2 paradigms, them will mismatch in direction of the most dominant one.

In the 90s I installed an optical CMM at an IBM plant and they had PCs with APL keyboards sitting in the clean room. I was impressed that they would use something like that in a production area, not really sure what they did with it but the keyboard looked very impressive.

I think without the special keyboard APL is a no-go these days.

(comment deleted)
Would APL work as well with the unusual symbols replaced by keywords? Any with APL experience know?
> Would APL work as well with the unusual symbols replaced by keywords?

Hot take: take a look at numpy.

In general, I would say no. One of the main points is that the notation is terse so that the experienced readers can at a glance see what is going on. Notation as a tool of thought, and all that.

No. The power of notation is significant enough that you would lose a lot. Someone mentioned J. It’s an abomination. Iverson made a huge mistake taking that path and likely contributed to APL’s trip into becoming a curiosity. I have written about this before on HN.

Context: I used APL professionally every day for about ten years and was quite active in the community at the time.

It what ways is J an abomination? APL (and to a degree J) are on my bucket list of languages to learn. I’d always read that J was a sort of spiritual successor to APL.
He holds a grudge against J, but not everyone does. I write research code in J and it's a very good little language. For instance, scripting is much easier in J. (Dyalog) APL is much more like an APL machine (in the sense of the LISP machine).
I believe he prefers one fancy character to two ugly characters.
I think my reasons are very different from robomartin's but I share the opinion that J has some pretty serious flaws. Some are brought forward from APL, some are not.

It has no context-free grammar (but neither does APL). Scoping is local or global: if a variable in a function is local, even inner functions can't access it. It has namespaces (locales), but they are not first-class and are instead referenced by numbers or strings, so they can't be garbage collected. Until this year, there was no syntax to defined a function—even though control structures had dedicated syntax! System functionality has no syntactic support, so it's provided by passing a numeric code to the "foreign" operator. To enable recursive tacit functions, functions are passed by name. Not just as arguments, anywhere. The name is just a string with no context information, so if you pass a function to an explicit modifier and the name means something different in that scope it will do something different (probably a value error, fortunately). Oh, also these names store function ranks, and if you define the function later it won't pick it up, so even the tacit recursion thing is broken.

The designers of J weren't familiar with design principles that are common knowledge outside the APL world, and it really shows. J was my first programming language (well, except TI basic) and while I'm still a big fan of array programming it really held me back from learning these things as well.

Functions, if you are referring to monads and dyads, can be defined using "3 : '...'" or "3 : 0\n...\n)" using "3" for monads and "4" for dyads.

As for rank information, functions do carry that rank. I believe you are not defining any rank, it which case it becomes infinite rank and depending on usage, it will be applied incorrectly.

For tacit recursion, there is the "$:" operator, which allows a tacit function to call itself anonymously. You may also need the agenda operator "@." to define your base case with a gerund "`".

The "foreigns" table, while useful, seems like a cludgy way to introduce functions that don't or are difficult to introduce cohesively into J's notation.

I'll reply to all comments here.

No, I don't hold a grudge against J. That's preposterous. Silly, really. These are tools.

No. I don't prefer one symbol to two characters. That is also silly.

You have to understand the HISTORY in order to understand my statement.

APL was, at the time, brilliant. Remember that it started in the 60's. Way ahead of its time. I learned and worked with it professionally in the 80's and early 90's.

Ken Iverson, the creator of APL, understood the power of notation as a tool for thought. In fact, he famously authored a paper with exactly that title [0].

I had the pleasure of being at an APL conference where Iverson himself presented and discussed this paper. I also took advantage of tutorials and sessions by Iverson and many of the early APL luminaries of the time.

The power of notation might not be easy to understand without truly internalizing APL or having good command of a reasonable analog. For example, a classically trained musician appreciates the value of musical notation. While not perfect, the alternatives have failed to deliver equivalent results, power, expression, etc. The day something else is used to score and perform orchestral performances we might have something to consider.

There are other examples of the power of notation and the paper covers the subject well.

So, why is it I say J is an abomination?

History.

Why does J exist? Why did Iverson go this way after correctly noting and promoting the idea that notation was a powerful tool?

He made a mistake, likely driven by a failed attempt to improve business outcomes.

Here's the history part.

Back in the '80's doing APL characters was not easy. On mainframe based systems we either had to use specialized IBM or Tektronix terminals and printers. When the IBM PC came out we had to physically replace the video card's character ROM (not sure most people know what this is these days) in order to get APL characters.

A common hack was to install a kludgy setup with a toggle switch so you could switch between APL and standard characters. The keyboard, for the most part, got stickers glued to it on the front face of the keycaps. You could, eventually, buy new keycaps for the IBM PC standard keyboard.

Printers suffered a similar fate. You had to reprogram and hack Epson and other printers in order to be able to print the characters.

Incidentally, if you wanted to use a PC for, say, Japanese and English back then you had to resort to the same kinds of hacks or buy specialized video cards and software.

I could go on. The point is that you had to be truly determined to do APL back then and it was a pain in the ass. Convincing an employer to hack 500 PC's so you could migrate to APL was an exercise in futility. Financials and other industries where the power of APL could be put to good use took the plunge, nobody else did. I did an APL-based DNA sequencing tool for a pharmaceutical company back in the 80's.

APL wasn't going to go very far beyond academic and corner-case circles under those conditions.

That's when Iverson came up with the J concept of transliterating APL characters to combinations of standard ASCII characters. It was hard to impossible to sell APL to the masses given the issues of the time. Iverson thought the transliteration would open the doors to the wider audience. Well, it did not. Among other things, notation, believe it or not, is much more practical and easier to learn than a seemingly random mish-mash of ASCII characters.

From my perspective Iverson suffered from a lack of conviction based on likely business pressure. The hardware of the day was conspiring against being able to push APL out to the masses. He did not have visibility into what was coming. Shortly after he took the J trip, the IBM PC went fully graphical and universal multi language (spoken) characters could be rendered without hardware hacks. Except that now Iverson, the creator of APL, had his business int...

The only explanation I see here for what's wrong with J is

> Among other things, notation, believe it or not, is much more practical and easier to learn than a seemingly random mish-mash of ASCII characters.

Is that your main problem with J?

Probably a two part objection:

First, abandoning a new branch of computing that started with the development of a specialized notation. As I said elsewhere, the power this offers cannot be appreciated without a suitable frame of reference. This can be either the use of APL (to a good degree of competency, not just dabbling) or a reasonable analog, such as musical notation.

The timing for the introduction of J was terrible. Computers made the transition from text-only terminal output to full-on, character-agnostic and graphically-rich output just around that time. I can't fault Iverson for this, nobody has a crystal ball. Having the inventor/founder of APL leave the language behind for a half measure that was primarily a reaction to character-only computers did a lot of damage to APL. One has to wonder how things might have evolved had he stayed the course he charted. After three decades of educating an entire community on the value and power of notation he threw it all away purely due to a mistimed decision about computer hardware of the day. As I said elsewhere, not the first time and not the last time someone in technology makes a bad decision. None of us are immune to this.

J started in 1990, Mac was 6 years old. I think it was pretty obvious GUIs will stay, no?
Maybe I'm missing the point but could you clarify a bit more on APL's notation vs J's notation?

Speaking as someone who is not very well math inclined and as someone who was born in an Asian country, both APL's special characters for verbs and J's alphabetical characters for verbs are similar enough for me. Both languages use symbols for verbs, it's just that J's symbols happens to very closely resemble the characters of the English alphabet.

Although, due to the familiarity of the English alphabet, J's symbols might intuitively bring up ideas of the alphabet character, is it not possible to just think of it as a new mathematical symbol? For example, instead of seeing "o." as the alphabet character 'o' followed by a period, couldn't it be seen as a circle followed by a dot? Or if we lived in a world where the alphabetical characters of the English were swapped with the special characters of APL, would J's notation still be broken? Does familiarity of the symbols used in a notation make it any less powerful?

Maybe the reason why I don't understand is because I haven't tried APL and only tried J. And I eventually ended up quitting on learning J because it was starting to get too difficult for me. Would it be possible to explain the differences in APL's notation and J's notation is an easier or simpler fashion?

APL’s verbs are geometrically suggestive. They are little pictures that represent what they do, and how they are related to each other. For example, ⌽ reverses an array along its last axis; you can see the array flipping around the vertical line. And you will know what ⍉ does without looking it up, I bet. These symbols are so well designed that you don’t have to memorize much, because they document themselves.
Couldn't the same be said of J? If APL's powerful notation comes from not having to memorize much and being a good visual representation of what the verb does, doesn't J's usage of alphabetical characters achieve something similar albeit a bit worse? For example "i." for index and related functions. Since the letter 'i' is usually used for indexing, one could assume that "i." is something related to indexing. Does the usage of alphabetical characters weaken the notation so much that it could be considered an abomination?

If there was another language that was a copy of APL but with new non-alphabetical symbols that were less suggestive than the original APL symbols, would that language be considered to have a less powerful notation? If so, how much weaker would it be considered? What would the symbols of a language that is APL-like and uses non-alphabetical characters, but would still be considered an abomination look like? Would that language be considered to have a more powerful notation than J?

This might be a bit of a stretch but I'd like to use the symbols on a media player as an analogy. The symbols on a media player (play, pause, resume, seek back, seek forward) could be compared to APL's symbols. Then, for the J version of the media player, rather than the symbols, there could be "Pl", "Pa", "Re", "SB", "SF" or something of the sort. I would say that the APL's symbols do look nicer, but I don't think J's usage of alphabetical characters should be considered an abomination. If so, wouldn't all text GUI's (e.g. command line managers such as nnn or MidnightCommander) be considered an abomination compared to a regular GUI version?

Maybe I'm not looking at the right thing here but APL's and J's notation seem to be similar. One does look better than the other, but both seem to serve the same purpose.

I’ve only glanced at J and never used it, so I don’t have any strong opinions about it. But APL just has that extra magic that J seems to lack. Notation does matter. It could be that I’m partially sentimental, as it’s the first programming language that I learned.
> Maybe I'm not looking at the right thing here but APL's and J's notation seem to be similar. One does look better than the other, but both seem to serve the same purpose.

Not sure if it is possible to understand this without having the context of being well versed in another means of communication that uses specialized notation. Musical notation being an easy example of this. Mathematics could be another. And, of course, languages that don't use the latin alphabet. Outside of APL, I happen to be fluent at musical notation and one non-ASCII spoken language, as well as having the mathematical background.

The closest I can come to explaining what happened with J is that they did their best to convert every APL symbol into an equivalent combination of ASCII characters. Here's the key:

They did NOT do this because Iverson thought this was a better path forward. He did not abandon thirty years of history creating and promoting notation because mashing ASCII characters together was a better idea. He did this because computers of the day made rendering non-ASCII characters a pain in the ass. This got in the way of both commercial and open adoption of the language. He likely genuinely thought the transliteration would bring array programming concepts to the masses. It did not.

In the grand context of computing, J is a failure and APL suffered greatly when its creator and primary evangelist abandoned it.

Imagine a world where people are writing perfectly legible code in C, Basic, Pascal, etc. Now imagine someone proposing the use of seemingly random arrangements of ASCII characters instead of those languages. It's like telling everyone: Stop programming in these languages! We are all going to program in something that looks like regex!

Well, the rest is history. The proof is in the fact that APL is but a curiosity and J isn't a commercially viable tool. Yes, they both exist in corner-case applications or legacy use. Nobody in their right mind would use either of them for anything other than trivial personal or academic applications. That's coming from someone who used APL professionally for ten years and even envisioned a future creating hardware-accelerated APL computing systems at some point. It's computer science history now.

I still think it should be taught (along with FORTH and LISP) as there's value in understanding a different way of thinking about solving problems computationally.

As an extension of this, part of me still thinks that the future of computing might require the development of specialized notation. For some reason I tend to think that working at a higher level (think real AI) almost requires us to be able to move away (or augment) text-based programming with something that allows us to express ideas and think at a different level.

Thanks for taking the time to reply. I think I'm beginning to understand but am not quite sure.

While I wouldn't consider myself fluent in any of the following, I do know how to read musical notation (from middle school/high school band) and I can read/write/speak a non-ASCII language (Korean). So I am somewhat familiar with non-ASCII notation.

> The closest I can come to explaining what happened with J is that they did their best to convert every APL symbol into an equivalent combination of ASCII characters.

This is the statement I keep on getting stuck on. From what I have read, besides the symbols being converted to ASCII characters, APL and J are generally the same. Both work on arrays, both are parsed right to left, etc. It seems like the only major change is that the symbols got converted to ASCII characters that are at a maximum 2 characters long. If this is the case, what would you say about the J language's notation if the authors one day decided to change all the symbols to non-ASCII characters? Everything else would stay the same, such as what the symbols do and how much space the symbols takes up (max 2 characters). If the J language were to change only its symbols and nothing else, would its notation be considered to be on par with APL's?

As you mentioned, my lack of proficiency in other specialized notation might be preventing me from understanding the issue. That said, your last set of comments strikes a chord with me and I do think I kind of understand. As you mentioned previously, notation is "a powerful tool of both expression and thought." The usage of specialized notations allows one to express their thoughts and ideas in a way that normal writing can't. But I guess this is where being well versed in the subject matter comes into play, since after all it is a "specialized" notation. It would be difficult for someone who doesn't have a strong background in the subject matter to take advantage of the specialized notation.

To me, with my limited knowledge and experience, J vs APL appears to be a symbol (graphical) design comparison rather than a notation design comparison. And as someone who doesn't have a strong mathematical background, both APL's and J's symbols conveyed nothing to me when I first saw them. Changing the symbols to non-ASCII or ASCII has no effect on me besides figuring out how I would input the non-ASCII characters. But I suppose that to you, a change in the symbols isn't something so superficial. The way I understand APL vs J now is that for those who are experienced in APL, the changing of the non-ASCII symbols to ASCII characters, simply for the purpose of not having go through the trouble of inputting non-ASCII characters, "broke" the notation.

> what would you say about the J language's notation if the authors one day decided to change all the symbols to non-ASCII characters?

That's a very interesting question. I think the only possible answer has to be that this would return the language to what I am going to label as the right path. It would be wonderful.

APL is the only programming language in history to attempt to develop a notation for computing. Iverson actually invented it to help describe the inner workings of the IBM mainframe processors. Any hardware engineer who has ever read a databook for, say, an Intel (and other) processors has run into APL-inspired notation that made it into the language of explaining how processor instructions work. It's a remarkable piece of CS history.

> besides the symbols being converted to ASCII characters, APL and J are generally the same

Let's call it "notation" rather than "symbols". The distinction I make is the difference between a language and just a set of glyphs that not entirely related to each other.

You might want to read Iverson's original paper on notation. It makes a very strong argument. Coming from the man who created APL, this is powerful. It also --at least to me-- tells me that his detour into J had to be motivated by business pressures. There is no way a man makes such an effort and defends a notion with such dedication for three decades only to throw it out for something that isn't objectively better.

I don't think we can find a paper from Ken Iverson that says something like "I abandoned three decades of promoting a new notation for computing and created J because this is better". You will find statements that hint at the issues with hardware of the era and the problems this created in popularizing APL.

Here's my lame attempt to further explore the difference. I don't know Korean at all. I just used Google translate and this is what I got for "hello from earth":

지구에서 안녕

I count seven characters, including the space.

Let's create J-korean because we are in the 80's and it is difficult to display Korean characters.

지 This looks like a "T" and an "L": So "TL".

구 This looks like a number "7" with a line across it: "7-"

에 This looks like an "o" with two "L"'s, one with a pre-dash: "O-LL"

서 This looks like an "A" with a dashed-"L": "A-L"

안 This looks like an "o" with a dashed-"L" and another "L": "OLL-"

녕 This looks like an "L" with two dashes and an "O": "L--O"

Space remains a space.

Here's that phrase in J-korean:

TL7-O-LLA-L OLL-L--O

It's a mess. You can't tell where something starts and ends.

OK, let's add a separator character then: "|"

TL|7-|O-LL|A-L| |OLL-|L--O|

Better? Well, just in case we can do better, let's make the space a separator. Two spaces in a row denote a single space:

TL 7- O-LL A-L OLL- L--O

We have now transliterated Korean characters into an ASCII printable and readable combination of characters.

Isn't this an abomination?

We destroyed the Korean language purely because computers in the 80's could not display the characters. We have now trifurcated the history of the language. Which fork will people adopt? Which will they abandon? Will all books be re-written in the new transliterated form?

Which of the above encodings (real Korean and the two transliterations) conveys, communicates and allows one to think in Korean with the least effort and the greatest degree of expressive freedom?

If I, not knowing one bit of Korean, expressed a strong opinion about J-korean being better because it doesn't use "funny symbols" I would not be treated kindly (and rightly so).

I don't know if this clarifies how I see the differenc...

Thank you for the discussion. I am now convinced but unfortunately, I cannot confidently say that I deeply understand.

I've taken a shot at the linked paper but will require more readings to fully grasp what it's saying. However, between what I understood of the paper and the example that you provided, it makes sense that J would be considered an abomination of APL.

Hopefully, after reading the paper a few more times and maybe even trying out APL, I'll have a better understanding. Thanks again for your time.

> I happen to believe that the future of AI requires a specialized notation. I can't put my finger on what this means at this time. This might be a worthwhile pursuit at a future time, if I ever retire (I can't even think about what that means...I love what I do).

I also share this opinion and I might know what you mean. A lot of breakthroughs in physics are due to new notation – e.g. Maxwell's equations, Einstein notation, etc. Or to be precise, it is easier to think new thought in notation/language that is suited for it.

Current machine learning is a 90:10 blend of empirical stuff followed by delayed theory. A language for theory-based ML is math with paper and pencil. However language for empirical experiments are PyTorch, Tensorflow, JAX, DEX, Julia, Swift, R, etc. Former is "dead" historical language, latter are notations for differentiable computational graphs that can be run on modern HW accelerators. If you look at what have those programming languages in common is that they were all influenced by APL. And funny enough, machine learning is the best use case for APL, but practically non-existent. APL should be reborn as differentiable tensor-oriented notation. That would be wild – prototyping new ML architectures at the speed of thought.

Anyway, another angle for APL + ML is an alternative interface – write APL with pencil on paper that understands your handwriting and evaluates your APL scribbles. [0] I committed myself to provide a BQN [1] with such interface and see where it leads.

Ideally, the best outcome would be the combination of both approaches.

[0] https://www.youtube.com/watch?v=0W7pPww6Z-4 [1] https://mlochbaum.github.io/BQN/

Congrats on your work with APL. Please do not engage in flaming on obsolete business concerns from 30 years past, on a repeated basis.

J is fine, great, easier license, has a larger and more powerful set of primatives.

Flaming?

Please.

You are free to provide a counter-argument.

Here’s the key question you have to answer:

After decades of not only inventing, but using, promoting and educating about the advantages of a specialized notation for programming. Did Iverson start J because it was a distinctively better path than APL?

No. Of course not. After nearly thirty years of brilliantly creating and promoting his notation Iverson made a mistake. It would not be the first time in the history of technology this happened, and it won’t be the last.

It wouldn't work the same, that's for sure. And APL experience isn't enough to know, because you only see one side of the comparison! Here are some notes from that side.

The advantage of using symbols for array operations is the same as the advantage in math of using them for arithmetic. A symbol can be read much faster than a word, and it makes syntax easier, not harder, to discern. This is because you only have to mentally group symbols into expressions instead of grouping characters into words and words into expressions. When programming with keywords you'd probably mitigate this by writing shorter lines in order to move some of the structure to a higher level.

Keywords have the advantage that the ones the user writes aren't any different than the ones the language provides. This can be nice, although I find that distinguishing user-defined words from symbols can also be helpful: those words tend to give a good summary of what's going on, while the primitives around them just do all the data-shuffling detail work required to make it happen. So it's easier to ignore those details and quickly get the bigger picture.

not in the way you'd hope.

due to the way APL is written and it's sort of philosophy of computation if you tried to be literal about you'd end up with a bunch of inscrutable nonsense anyways

consider https://www.aplwiki.com/wiki/FinnAPL_idiom_library#Inner_Pro...

  (⌽∨\⌽' '∨.≠X)/X  would be
  (reverse or scan reverse ' ' or prod = X) reduce X
or that infamous Game of Life one liner

  life←{⊃1 ⍵ ∨.∧ 3 4 = +/ +/ 1 0 ¯1 ∘.⊖ 1 0 ¯1 ⌽¨ ⊂⍵}
  life set {disclose 1 X or prod and 3 4 = + reduce + reduce 1 0 -1 bind prod rotf 1 0 -1 rot each enclose X}
 
Still just nonsense right? You'd end up writing very different code.
> (reverse or scan reverse ' ' or prod = X) reduce X

This just looks like Haskell.

Since this seems to have brought TryAPL down, there are other options listed at [0]. In particular, ngn/apl[1] is a JavaScript implementation and runs client-side. But it's limited relative to Dyalog (used on TryAPL) and no longer under development.

[0] https://aplwiki.com/wiki/Running_APL

[1] https://abrudz.github.io/ngn-apl/web/

The main reason I want to learn APL is for the white-boarding exercises during interviews. Most places will let you write in your strongest language.
Haha using APL in interviews (outside of finance) would be legendary.
When I was more regularly doing coding interviews, I would pick a problem suited for the strengths of the candidate's self-identified strongest language, but basically go "use whatever language you want, but beware that if it's not one of <short list>, I will have to transcribe your code and run it for the final assessment".

I had Haskell, OCAML, and Ruby thrown at me (no, none of those were on the list). None actually ran on the first try, but I could rehab the Ruby to working (it was a silly mistake, only a small amount of score knocked off), but I could not rehab the Haskell nor the OCAML, so that ended up with a "recommend no-hire".

Bit of a shame, had they chosen the Python that the CV indicated they preferred, it may well have been a "strong hire" (but, failure to produce runnable code, that can't be easily fixed, in a language explicitly recommended against indicates that there are some possible red flags).

Bit of a shame? It was your decision. I don't see that as a red flag unless the candidate had time to produce running code on their own development setup. In a timed interview producing running code is irrelevant in my opinion, but hey you chose your rules and got your results.
Yes, but go with something too far off the beaten path and you just get https://aphyr.com/posts/341-hexing-the-technical-interview, which while really fun, doesn't get callbacks.

(I've always wanted to try doing a white-boarding interview in a visual language like Scratch)

I've been meaning to write 'bullshitting the technical interview' where I neither know how to solve the problem nor APL but end up convincing the interviewer that I know both.
This little thing caught my interest:

    APL takes care of binary-vs-decimal inexactness too, so 3×(1÷3) is really 1:

      3×(1÷3)
How is this done? How well it scale? I suppose well, because APL is good for math, rigth? But then I remember that must be slow...?
To be honest, I don't know what that claim means, but know that `(1 / 3) * 3` is exactly 1 under plain-old IEEE floats.

The "fun" is with, e.g. `0.1 + 0.2`. I just tried on the website

        0.1 + 0.2 - 0.3
  2.775557562E¯17

which agrees:

  julia> 0.1 + (0.2 - 0.3)
  2.7755575615628914e-17
(comment deleted)
That must be a reference to tolerant comparison, but the way it's written is bizarre. Comparisons in APL are (optionally: you can turn it off) subject to tolerance, meaning that numbers with a small enough difference are treated as equal by comparison or search functions. There are probably better resources but I describe it at [0].

However, Dyalog just uses IEEE doubles (with an error in place of infinities or NaNs; also you can configure to use higher-precision decimal floats), no different from JavaScript. The result of, say, 0.1+0.2, is not the same as 0.3, it's just equal under tolerant comparison.

[0] https://www.dyalog.com/blog/2018/11/tolerated-comparison-par...

It was used heavily for legacy trading and accounting applications at a fortune 50 company that I worked at early in my career. I don't recall any performance discussions at the time, but we were processing a large chunk of money on a handful of expensive ibm power pcs.
It's still used at those companies. Arthur Whitney wrote an APL variant called A+ still in-use at Morgan Stanley. He then left and wrote the "k" language, which is just ASCII APL (although definitely some major differences). K is the language of the extremely expensive kdb+ time series database (normally used for stock price data analysis I think). It's all in-memory data on a giant SSD (very fast and elegant design). He since left kx systems (company he made kdb+ with) and has a new startup called Shakti. Finance are generally the only folks that can afford the prices I believe.
Yea, I have no doubt that there are still a handful of extremely well paid APL devs at the company I worked at then (I wasn't at morgan stanley). I was part of a project that helped put a webservice frontend in front of the app so that non-power users didn't have to use a cli to interact with the application if they didn't want to. I don't think there was any appetite or desire to engage in a re-write due to the risk involved when I was there then and I would guess they have maintained that reasoning. I have a vague recollection of some of the stories from the APL devs, one of them was the first to get APL working on a personal computer way back in the day. He carried the computer into some APL conference and demo'd it and got a massive ovation supposedly.
That's a great story. I wish I could write modern APL at work. Would be a lot of fun.
I worked at a company right out of college that used K for some things. They did some consulting work for the financial services industry early on, and I think that's how they started. I ran through some basic tutorials, but never worked on any of the projects that used it, so never became proficient. Only a special subset of blessed people got to use K.

The only things I remember are that a symbol could could do 3 things when used with a monad, dyad, or infix, and that it was very hard to read anyone else's code because it was so terse.

They also went through a phase of naming their Java classes things like com.a.b after getting used to K's terseness. Fortunately, that didn't last very long.

I wonder if only a few got to use it due to the high costs?
So does forth:

3 1 3 */ .s <1> 1 ok

So does Raku

    say 3×(1÷3)
    # 1
It works because `1÷3` is a rational number.

    my \rat = 1÷3;

    say rat.numerator;   # 1
    say rat.denominator; # 3
If you multiply it by 3, you get another rational number which represents 1.

    my \result = 3×rat;

    say result; # 1

    say result.numerator;   # 1
    say result.denominator; # 1
---

Now that this may be slower than using floating point numbers, but it isn't that much slower. You only have two integers that you have to manage.

Actually on many older processors there wasn't built in support for floating point numbers, so it might actually have been faster to use rationals like this.

(I'm not sure if this is how APL handled it.)

---

APL happens to be one of the languages Raku copied ideas from

    ×/⍳10
Translated to Raku

    [×] 1..10
That is rather than `×/…` it is written `[×] …`. Partly because `/` is the ASCII version of the division operator.

We could go further towards replicating it.

    {
      sub prefix:<⍳> (UInt \n){ 1..n }
      sub infix:</> (&f, +list){
        [[&f]] list
      }
      constant term:<×> = &infix:<×>;

      say ×/⍳10;
      # 3628800
    }
I suppose if arrays language get popular enough, we will get a module to use them as a DSL for libs like numpy, just like we have regex for strings, instead of a whole language dedicated for them.

It would be a win / win, you gain the strength of J, K and APL for array processing, without the weakness of them for anything else.

And just like with regex, you'll get fat disclaimers in doc telling you to not get carried away too much as it can quickly become unreadable.

The regex DSL only works for strings. I lament that I cannot use something regex-like to match general sequences, e.g. a sequence of tokens, instead of only strings (sequence of characters).

The operations could be the same. There are classes, and operators for matching 0, 1, or more repetitions, etc.

Array languages are powerful especially when you have arrays with arbitrary elements, including arrays themselves. Good luck using a regex DSL to match a sequence of strings, where you might want to define a string class (analogous to a character class) as a regex itself.

> I lament that I cannot use something regex-like to match general sequences, e.g. a sequence of tokens

You can. It's not typically built into a programming language's standard library. But there are plenty of general-purpose automata-building libraries out there, and some of them do provide DSLs. At least to the extent that the regular expressions you're using are actually regular (many aren't), all a regex is is a domain-specific specialization of nondeterministic finite automata.

I sometimes lament that I don't see them, or hand-coded automata, more often. This was CS101-level stuff when I was in college, and it's pretty easy to code your own even if you don't have a good library available in your language. And, for problems where they're appropriate, using them typically yields a result that's simpler and easier to maintain than whatever ad-hoc alternative you might see instead.

The now defunct Viewpoints Research org chased an idea similar to this. It was a meta language that was based around PEGs, intended to allow the easy creation of DSLs. I imagine the papers are still up somewhere. It was called OMeta.
I'm not sure of the need to do that. Not for parsing anyway.

A well designed regex system is enough without tokenization.

The parser for the Raku language, for example, is a collection of regexes composed into grammars. (A grammar is a type of class where the methods are regexes.)

We could probably do the token thing with multi functions, if we had to.

    multi parse ( 'if',  $ where /\s+/, …, '{', *@_ ) {…}
    multi parse ( 'for', $ where /\s+/, …, '{', *@_ ) {…}
    …
Or something like that anyway.

(Note that `if` and `for` etc are keywords only when they are followed immediately by whitespace.)

I'm not sure how well that would work in practice; as hypothetically Raku doesn't start with any keywords or operators. They are supposed to seem like they are added the same way keywords and operators are added by module authors. (In order to bootstrap it we of course need to actually have keywords and operators there to build upon.)

Since modules can add new things, we would need to update the list of known tokens as we are parsing. Which means that even if Raku did the tokenization thing, it would have to happen at the same time as the other steps.

Tokenization seems like an antiquated way to create compilers. It was needed as there wasn't enough memory to have all of the stages loaded at the same time.

---

Here is an example parser for JSON files using regexes in a grammar to show the simplicity and power of parsing things this way.

    grammar JSON::Parser::Example {

        token TOP       { \s* <value> \s* }

        rule object     { '{' ~ '}' <pairlist>  }
        rule pairlist   { <pair> * % ','        }
        rule pair       { <string> ':' <value>  }

        rule array      { '[' ~ ']' <arraylist> }
        rule arraylist  {  <value> * % ','      }

        proto token value {*}

        token value:sym<number> {
            '-'?                          # optional negation
            [ 0 | <[1..9]> <[0..9]>* ]    # no leading 0 allowed
            [ '.' <[0..9]>+ ]?            # optional decimal point
            [ <[eE]> <[+-]>? <[0..9]>+ ]? # optional exponent
        }

        token value:sym<true>    { <sym>    }
        token value:sym<false>   { <sym>    }
        token value:sym<null>    { <sym>    }

        token value:sym<object>  { <object> }
        token value:sym<array>   { <array>  }
        token value:sym<string>  { <string> }

        token string {
            「"」 ~ 「"」 [ <str> | 「\」 <str=.str_escape> ]*
        }

        token str { <-["\\\t\x[0A]]>+ }
        token str_escape { <["\\/bfnrt]> }
    }
A `token` is a `regex` with `:ratchet` mode enabled (no backtracking). A `rule` is a `token` with `:sigspace` also enabled (whitespace becomes the same as a call to `<.ws>`).

The only one of those that really looks anything like traditional regexes is the `value:sym<number>` token. (Raku replaced non capturing grouping `(?:…)` with `[…]`, and character classes `[eE]` with `<[eE]>`)

This code was copied from https://github.com/moritz/json/blob/master/lib/JSON/Tiny/Gra... but some parts were simplified to be slightly easier to understand. Mainly I removed the Unicode handling capabilities.

It will generate a tree based structure when you use it.

    my $json = Q:to/END/;
    {
      "foo": ["bar", "baz"],
      "ultimate-answer": 42
    }
    E...
APL is not unreadable any more than mathematical or musical notation are. Sure, to someone who doesn’t know the notation it looks like an incomprehensible mess. So does math, music, greek, chinese, arabic, hebrew, etc.

I used APL professionally every day for ten years. I can read it. I can touch-type it. And I don’t need a specially-labelled keyboard (even thirty years later).

This should not be surprising at all. A pianist does not need labeled keys and people familiar enough with the above-listed spoken languages can touch-type them without much effort.

While, sadly, APL has no practical application in modern software engineering (it stagnated and became irrelevant and impractical) it is wrong to look at the brilliant use of notation as a tool for the concise communication and expression of ideas and list it as a negative. Not being able to speak, read or write Chinese does not make it a bad language.

> Not being able to speak, read or write Chinese does not make it a bad language.

Well that's the problem. Not being able to read or write APL makes it more fun to learn.

Thanks for posting this intriguing link. A glance at the Jupyter notebook on this site will bring a smile to a Julia user who grew up on (or has somehow encountered) APL.
What an incredibly concise, elegant implementation.
I've written an open source version of q: http://www.timestored.com/jq/ It's implemented in java. You idea is interesting. Allowing q and java intermixed... combining it inside java like linq and C# would be interesting.
I really like APL but I cannot imagine myself depending on a closed source tool-chain. I've heard that the GNU APL is order of magnitude slower than Dyalog APL, but I can't find a benchmark to confirm that.
Not to claim any are better than Dyalog, but there are options: https://aplwiki.com/wiki/List_of_open-source_array_languages . I think dzaima/APL and April are both all right. Personally, I think GNU is not a good design: for example it has no lexical scoping or even control structures, essentially requiring you to use goto for program control. BQN is my own effort and I would say it has more serious ambitions than these. If you're not attached to the APL language specifically, I'd take a look.
I check back in on your BQN project every few months. I am an anxious potential user and love the work you do.
Thank you for the comment, I wasn’t aware of the BQN project, sounds very interesting to me.
(comment deleted)
Yes, GNU APL is quite slow. There was some primitive implemented in GNU APL (as part of the interpreter, in c). A pure-APL implementation running on dyalog outperformed it by a considerable margin.

If you're looking for a performance, opensource APL, try j. Though if performance is not a priority then, as the sibling says, dzaima/apl or april should be more than adequate.

NB. I believe the primitive implemented Knuth's dancing links algorithm.

NB. NARS is also very decent, though it only runs on windows.

I had a blast learning to write and read APL for a course at my university where we chose and presented the papers from HOPL IV. If you want a fairly quick and easy read about the history of APL I can heartily recommend the paper "APL Since 1978". A small taste: `twoSum ← {1↑⍸⍺=(⍵∘.+⍵)}`, a dyadic function to find the indicies of (the) two elements in an array that sum to ⍺, for example: `9 twoSum 2 7 11 15` will return `0 1`. Though I doubt I'll ever write any larger programs with it, I've had a lot of fun with it.
I've heard that R is an array language. Can it compare with the likes of APL?
The closest language to APL/J/K is NumPy, the numerics library for Python. It was deliberately designed in the spirit of an APL, but without all the squiggly characters.
Julia has builtin language support that kind of array handling, including broadcasting.
Yes, there are a handful of languages where you can operate on arrays (without looping), including Fortran. But this doesn’t make them true array languages like APL.
> but without all the squiggly characters

I so liked the APL squiggly characters (mostly Greek letter based glyphs). Made for very succinct code. Combined with right-to-left precedence resulted in very low overhead to write and read code. Most people who complained about it APL as “write-only” seemed to be outside the community of serious APL programmers. Once you learned to read the language it was very easy to comprehend at regular reading speed...

In contrast NumPy seems absurdly wordy, and waiting for the completion menu in an IDE tends to derail my train of thought.

However I do tend to like NumPy for being APL-like, so it’s not a damning contrast as far as getting things done.

I get it, and I wrote that even though I'm a fairly big J enthusiast. It's fun to solve a tricky problem by cranking out two or three rows of line noise. :) Numpy is wordy, but you can still program in terms of arrays -- it might not feel like quick symbolic magic, but the underlying paradigm is (almost) the same.
I really don't understand why people dislike this. As long as the domain and input/ouputs are clear.. having a Δ is not worse than a `delta` or `computeDeltaOfPair` (actually the shorter the better to me..
in fairness, a delta is far more discoverable to a casual reader than, say the APL Grade Up symbol. :)
But once you use grade up, it's easy to remember. I used it like a year ago when playing with APL and haven't touched it since then and still remember the symbol.
APL is something that has been on my TODO list for a long time. To me it’s tantalizing to express a problem with pure symbols instead of a mix of it. While APL is cool I’ve always felt that coding languages are mostly wrong. Also natural languages also feels blocky, inefficient and sometimes alien.
Last used APL in 1981; We had keyboards specialized for the APL char set.

IMO Its pithy syntax was just not worth it, even back then, so haven't returned since and don't see any reason to break my 40 year hiatus.

APL's greatest contribution is its semantics, not its syntax.

(Some parts of the syntax are brilliant and would be awesome if adopted by modern languages. Others ..... not so much).

Which pieces of APL would you see fitting in a modern language? Simply curious about preferences of people who already enjoy the semantics and would find the APL syntax ideal.
I think adopting the “each” syntax would help every language that has containers - including Python and C#

It is semantically more like “map” than “foreach”, but syntactically emphasized the applied function rather than the fact that it is applied to the container - and that shows especially when nested - f””x or f”[2]x means “apply at depth two”. Compare that to a nested map/foreach

There are other syntax features I like, but most of them do interact with semantics (some more, some less). This one is useful in any language.

Topical! One of the most recent Corecursive episodes has a guest with a fascinating take on APL, while the episode is completely unrelated.

https://corecursive.com/065-competitive-coding-with-conor-ho...

Get yo actuary tables on.

Thanks for sharing!

A question I had with APL was how do you actually type it in, and it turns out you just use a back-tick as a prefix, like a leader key in vim. Conor walked my through solving something with TryAPL in this video:

https://www.youtube.com/watch?v=lG-CcPb7ggU

You can also set it as an altlayout on your keyboard. I'm on linux so I set it to holding Winkey switches to APL.
Has anyone used APL to implement web frontend? In the GOL example it shows how to use ⍴ to reshape into a matrix and then use ↑ to pad it out, and then the structure is displayed in the console. I'm imagining some kind of declarative JS+CSS frontend framework where the APL-ish source code maps intuitively to the visual representation in the DOM (or canvas).
I doubt there is one. I know of Dyalog's backend and web service frameworks, but I don't think there has been a use of APL's notation for HTML/CSS/JS programming.
How do you key the ⍳ character easily?
`i on this site. If you use another editor (including, I believe, Dyalog's actual APL implementation, but I always used emacs when I was playing with APL) you can change the prefix character. I always preferred . because there is no reaching for the character (on the Dvorak layout at least) and it doesn't conflict with much other than decimal numbers (where you may need to type .. to get the desired result).
Use `i to get it. If you hover over the character in the language bar at the top, the text shown has some indications of how to type it. Here, "Prefix: <prefix> i", with the prefix being a backtick. The version with a tab afterwards is longer but could be easier to remember for some characters.
(comment deleted)
Does anyone know of an input method for APL that works similar to an IME that you would use for Japanese?

Basically you type the name of the operator in latin characters and get the proper symbol autocompleted.

I only see direct key to symbol mappings which might be fine for a full time APL dev but offer a bit too much of a learning curve for just trying it out.

The linked site uses a couple methods:

  `i => ⍳ (iota)
  ii<tab> => ⍳
In some editors you can change the prefix character (in emacs I think the default is . or I changed it to . almost immediately). Also in emacs (though I didn't try this with APL) you can use an entry method based on TeX so if you type:

  \iota
You will get

The Windows emoji keyboard (Win+. or Win+; whichever is more comfortable for you) has a lot of the Unicode math symbols under its Symbols tab (marked with an omega). It has a pretty good IME-ish type to search experience for regular emoji, but doesn't support type to search under the Symbols tab. (I wish it did and hope it is something they consider adding.)
Emacs has a good quail-completion system for `GNU-APL`.