11 ms·
APL in its modern state (2020)
- adamrt 5y agoThere was a good Co-Recursive episode I just listened to last week that was partially about APL. https://corecursive.com/065-competitive-coding-with-conor-hoekstra/ https://corecursive.com/065-competitive-coding-with-conor-ho...
- 7thaccount 5y agoAnyone using APL or J for work on HN? I've used it as a hobby and think it's really cool, but haven't ever used it professionally. Edit: this has been posted on HN before.
- gerikson 5y agoYes, on 3 May 2020: https://news.ycombinator.com/item?id=23055793 https://news.ycombinator.com/item?id=23055793 "Is APL Dead? Not anymore"
- mlochbaum 5y agoBelieve it or not, the APL world's changed a lot since then. I still consider APL dead, but there are strong signs of rebirth. APL dialects April[0] and KAP[1] are improving rapidly, and my own offshoot BQN[2] has gone from prototype to a full language. All of these are open source and made to work with the Unix ecosystem. While the K language isn't as close to APL, ngn/k[3] is following a similar trajectory. This year we created a Discord/Matrix forum[4] (bridged together) for array languages, which has hundreds of members and a few conversations per day at the slowest. The Array Cast was featured prominently here when the first episode aired[5] and is also worthy of note: they say they now have thousands of subscribers. [0] https://github.com/phantomics/april https://github.com/phantomics/april [1] https://github.com/lokedhs/array https://github.com/lokedhs/array [2] https://mlochbaum.github.io/BQN/ https://mlochbaum.github.io/BQN/ [3] https://codeberg.org/ngn/k https://codeberg.org/ngn/k [4] https://mlochbaum.github.io/BQN/community/forums.html https://mlochbaum.github.io/BQN/community/forums.html [5] https://news.ycombinator.com/item?id=27209093 https://news.ycombinator.com/item?id=27209093
- 7thaccount 5y agoThanks for all you do! I can't wait until one of these languages reaches a 1.0 milestone.
- lucozade 5y agoI haven't written in APL professionally (other than fixing up existing code) but I have been responsible for an APL system and for its replacement. I'm sure that writing a greenfield APL program is a lot of fun. Initially. Or if you're just writing vignettes to do some temporary data wrangling then it's fine. As a language for writing applications that do proper work and need maintaining? Wouldn't be in my top 50 choices of language. And I don't think I've worked with 50 languages yet.
- maest 5y agoq and k are still actively used in many parts of finance.
- 7thaccount 5y agoYes, sorry for not mentioning that. I'm aware of kdb+ in finance (never used it personally, but wish I could).
- gbronner 5y agoIndeed, and if you have a community of people using them, you can be very productive. But those languages are astonishingly intimidating for new programmers -- reading from right to left, with implicit variables, different usage of brackets, types that are hard to discern, overloading of every possible bit of punctuation, etc makes it more like translating Latin than writing code. So while a line such as : .[`:/data/raw; (); :; 1001 1002 1003] is very succinct, the skill and concentration necessary to write that line is not something that lends itself to widespread adoption.
- rak1507 5y agoI've been learning APL for a bit, and have tried q too, and I disagree with the idea you need more skill and concentration to write either. Personally, for problems that suit the domain, I've found it much easier than equivalents in other languages like numpy and pandas. Q-sql in particular seems extremely convenient to have built into a language, and probably requires less concentration to write than an equivalent using manual iteration/filtering.
- agumonkey 5y agosearch for aaron hsu, he made plenty of talks about APL dialects if you like terse generic code you'll be fed for a while (too much even, Aaron's two page parser/compiler was somehow too cryptic even for my tastes :)
- aozgaa 5y agoHe also wrote TFA.
- 7thaccount 5y agoOhh yeah. I've enjoyed talking with him on HN. Probably on a previous account as I never enter my email and get locked out all the time :) That parser was mind bending.
- abrudz 5y agoI do. But I don't really write or maintain large systems, only various tools and interfaces.
- jpf0 5y agohttps://github.com/interregna/arraylanguage-companies https://github.com/interregna/arraylanguage-companies
- rscho 5y agoI use J's Jd columnar database to munge data for academic research. Much, much easier than SQL. The models, I do in R because packages.
- tangentstorm 5y agoDoes trying to build a Youtube channel around J count as professional? I've been livestreaming a presentation tool / time-travelling REPL for J for a few months now: https://github.com/tangentstorm/j-prez https://github.com/tangentstorm/j-prez It hasn't paid anything directly yet, but my videos probably helped me land my current job. At work, I use another APL-inspired language called K.
- 7thaccount 5y agoFor finance or something else?
- JulianMorrison 5y agoNothing dies. Like, if it has actual uses and implementations on modern machines and isn't abandonware, someone is going to be using it somewhere. But I would say it was niche.
- _rgek 5y agoI will note that the article doesn't contain the word "readability". APL is the classic example of a "write-only" language.
- bluejekyll 5y agoDo you have any examples?
- skruger 5y agoIt really isn’t. Thousands of APL programmers read it perfectly well. I can’t read Japanese, but that doesn’t make it lacking in “readability”.
- rightbyte 5y agoYou could argue just that. Japanese is surely more difficult to learn to read with its mix of Japanese and Chinese symbols, then say Russian or Greek.
- celeduc 5y agoLanguages have varying costs of entry and mastery. The relative cost depends on what languages one already knows. But some language features are rarer and more difficult (declensions, conjugations, symbols, tones, etc). The size of the active vocabulary matters a great deal. But the availability of the language matters perhaps most of all.
- dreamcompiler 5y ago"Language X is a write-only language" seems to be code for "it doesn't look like C." I've also heard Forth and Lisp described this way. And yet I find both readable since I have experience using them. I wonder if APL is similar: It's only unreadable to people who don't know the language. Well of course it is.
- ddek 5y agoAPL is different from Forth and Lisp, in that the 'write-only' reputation is supported by it's programmers. Take the famous 'game of life' APL example: ``` life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵} ``` It's quite logical, when you walk through it.[0] But it's harder to read 'back to front', which is what code readability is about. [0] https://www.youtube.com/watch?v=a9xAKttWgP4 https://www.youtube.com/watch?v=a9xAKttWgP4
- coldcode 5y agoFew languages ever die completely. Even Jovial is still used in some places (I learned it in 1982). I have not seen any mention of PL/1 in decades, however. I learned APL in 1979 and found it an amazing language at the time, though I never used it again. Every other language I learned in my life is still in use in some form.
- Jill_the_Pill 5y agoHa! You inspired me to look up FOCUS, a language I once wasted a summer on. I guess it is still limping along out there, if somewhat unrecognizable.
- debo_ 5y agoOr perhaps somewhat un-FOCUS-ed.
- joostdevries 5y agoGilad Bracha is working on Shaperank. An APL inspired language for reactively calculating with multi dimensional arrays. Ie vectors and matrices. https://twitter.com/Gilad_Bracha/status/1450149734325256193 https://twitter.com/Gilad_Bracha/status/1450149734325256193
- agumonkey 5y agoInteresting how reactive graph are spreading everywhere :)
- abzug 5y agoCan you explain/expand on this?
- joostdevries 5y agoObviously this is relevant to machine learning and data analytics. On github: https://github.com/f5devcentral/shapeRank https://github.com/f5devcentral/shapeRank
- eggy 5y agoI like the confluence of ML and array languages happening right now. I know Pandas and NumPy are their offspring, but I like the array-oriented PLs. An ELM (Extreme Learning Machine) in J [1], CNNs in APL [2], and APL-to-GPU toolchains like Futhark/apltail [3,4]. I'll have to look at shapeRank. [1] https://github.com/peportier/jelm https://github.com/peportier/jelm [2] https://dl.acm.org/doi/10.1145/3315454.3329960 https://dl.acm.org/doi/10.1145/3315454.3329960 [3] https://futhark-lang.org/blog/2016-06-20-futhark-as-an-apl-compiler-target.html https://futhark-lang.org/blog/2016-06-20-futhark-as-an-apl-c... [4] https://github.com/melsman/apltail/ https://github.com/melsman/apltail/
- MontyCarloHall 5y agoAPL is alive and well and widely used. It’s just evolved into more verbose forms known as NumPy, R, and other Iverson Ghosts [0]. Turns out people love array programming but hate terse syntax. [0] https://dev.to/bakerjd99/numpy-another-iverson-ghost-9mc https://dev.to/bakerjd99/numpy-another-iverson-ghost-9mc
- mikl 5y agoOne mans “terse” is another mans “cryptic”. Languages like R are both easier to for the average programmer to read and (much) easier to type.
- jodrellblank 5y ago"Turns out people love array programming but hate terse syntax." People hate Java and COBOL and XML and PowerShell and ActionScript and SQL for their verbose syntax. People adore `x ? y : z` while complaining about unreadable terse syntax that with symbols that don't say what it does in English. Why do people put up with data[4] to get an item out of an array with a special single-purpose symbol heavy syntax instead of index(data, 4)? How come the symbols are never the problem when people are familiar with them? Can it just as easily be explained by "people like what they're used to, people hate change"?
- qwerty456127 5y agoTerse is generally better than verbose but it has 2 problems: 1. Learning curve - most of the people immediately dismiss what they can't intuitively understand straight away, even if it requires just some minutes to grok and a cheatsheet during first days of usage. People need to have at least very basic clue immediately to get interested and feel motivated to invest further attention. 2. Terse syntax/vocabulary encourages packing overly complex logic into one-liners which become brainfuck to read and reason about even for yourself shortly after. I believe it's not hard to develop automatic decoders for such expressions which would split them into multiple lines introducing intermediate variables, structure them with indentation and/or highlight corresponding elements but people probably prefer to just read the code immediately rather than to use advanced tooling even to read it. I indeed adore `x ? y : z` and similar things and use these heavily but always split the expressions in separate indented lines every time I nest them. Some times I also use ReSharper to convert some verbose C# code I wrote into much shorter (Linq or something) but in not-so-rare cases I then fail to understand the result and have to remember/comment what does it do. I would often revert to verbose unless I'm sure this part of the code is not going to need to be debugged ever after.
- michaelbuckbee 5y agoI feel like we're quibbling about semantics. Is APL an interesting language that most people would benefit from picking up and building something with? Sure. Is there a small and passionate community around it? Absolutely? Is it still possible to get up and running with APL in 2021? Yes. Given the variety of choices in the developer ecosystem is APL the best choice for the types of problems the vast majority of developers are solving today? No. And I think maybe most interestingly this conversation (to me) highlights how important ecosystems, frameworks and communities are to modern development over the pure language semantic benefits.
- qwerty456127 5y agoGiven the variety of choices in the developer ecosystem is APL the best choice for ANY types of problems one can realistically have to solve today? I.e. is it still the best tool for the job it was designed for but on modern hardware/OSes? Provided you don't mind the special charset and low availability of APL programmers to maintain your code.
- adrian_b 5y agoAlready when it appeared, APL was an incomplete programming language. It had much better facilities than any other language for working with arrays of numbers but other tasks were awkward, e.g. handling strings, input/output, program control structures, partitioning a large program in separate modules and so on. So going back to use the original APL is not a solution. On the other hand, having to work with arrays of numbers in any language that does not include APL-like expressions is tedious. Having to write explicit loops when better solutions existed more than half a century ago seems extremely stupid. With Unicode, providing the APL operators in a programming language is trivial. There is however one APL feature that prevents the simple extension of any current programming language to just allow you to write APL expressions without changing the language otherwise. APL had a different rule for the precedence of operators than most popular programming languages, all operators have equal precedence and the right hand operand of an operator is everything that is to its right. So the operators are evaluated from the right to the left, unless there are parentheses to change the order. This rule was a very important innovation of APL. While it may seem weird for those who do not have experience with it, it is actually much more convenient than the usual multi-level precedence rules. Just adding APL operators to a language without also using the APL rule of evaluation order would loose a good part of the APL advantage and simplicity.
- mikl 5y agoWas it ever alive, outside some tiny academic niche? You could hardly even use it without getting a custom keyboard for it.
- boublepop 5y agoThe fintech company SimCorp was built on APL and their backend still has tons of APL.
- lokedhs 5y agoI mean, given the number of new implementations of APL that are being actively worked on, there is clearly some interest. The most prominent such dialect is BQN, which I definitely recommend anyone interested in APL-like languages to take a look at. https://mlochbaum.github.io/BQN/ https://mlochbaum.github.io/BQN/ APLwiki has a list of other languages: https://www.aplwiki.com/wiki/Language_overview#Dialects https://www.aplwiki.com/wiki/Language_overview#Dialects Disclaimer, I'm the developer of one of these dialects so of course I'm biased.
- HPsquared 5y agoIronically with the rise of touchscreens, it's easier than ever to have an APL keyboard.
- thrower123 5y agoI don't know which would be more painful, trying to program on a touchscreen, or trying to program in APL.
- ibiza 5y agoConor Hoekstra's code_report[0] YouTube channel is a great way to learn about APL. The "1 problem N languages" series of videos are especially good. [0] https://www.youtube.com/c/codereport/featured https://www.youtube.com/c/codereport/featured
- robomartin 5y agoContext: Professional APL user for ten years back in the '80's I firmly believe languages like APL, Forth and LISP should be taught in a single quarter course on programming languages. The perspective you get is invaluable. These ideas help you think about computational problem solving in a different way. That said, attempting to use any of these languages today for anything other than a fun hobby would be a mistake. While APL isn't dead --paid and free distributions are still actively maintained--, it is, in my opinion, deader than a doornail when it comes to the reality of using it for any real work, particularly at scale. In this sense it isn't any different than Forth, LISP, COBOL and FORTRAN. Can you imagine Facebook announcing a move to FORTRAN. Neither can I. I often find the comments on HN about APL is terribly misinformed. Things like "read only language", "need a custom keyboard", "need a custom machine", etc. are, from the perspective of someone who actually knows APL, just silly. People truly should stop for a second and think about whether their opinions about anything are based on enough data to actually support even having an opinion. Simple parallel example: Dabbling in music does not make you a musician. Declaring that you need a custom machine to type musical notation and that this notation is impossible to read would sound terribly ignorant to someone who devoted sufficient time to actually learning and internalizing this. I can, still, to this day, decades later, touch-type APL. Do you look at your keyboard when you type anything in your spoken language/s? No? Same with APL. The learning curve isn't any worse than learning to type on an ASCII keyboard. Do you have to look at the keyboard when you type any of the shifted symbols on the top row? No? Well, imagine that's APL. Different symbols. No problem. Yes. APL is dead as a sensible informed choice for non-trivial projects. No. APL is not dead as it pertains to learning some amazing things about what computing could --and arguably, should-- look like at some undefined point in the future. I have always thought that the future of AI will require us to be able to communicate with the computer in code in a form far closer to the symbolic APL approach rather than typing words in English. I can't put my finger on what form that would take. Iverson's "Tool for Though" paper goes over the reasons that support this idea. I just can't offer anything other than to say I believe this to be true based on ten years using an amazing symbolic language for real work at scale. One of my APL applications was part of the human genome decoding project. It helped analyze, classify and visualize sequencing data.
- rhn_mk1 5y ago
- ncmncm 5y agoAnyway, the iota operator isn't wholly dead. It gets name-checked in libraries for other languages, including recently C++. Which isn't dead.
- ctdonath 5y agoArticle describes interest in APL, and constructing tools for it, but does not note any modern practical/commercial use of APL. As such, seems little more than academic interest akin to Latin or Esperanto, where even Klingon gets more actual use (https://smile.amazon.com/s?k=klingon+shakespeare https://smile.amazon.com/s?k=klingon+shakespeare).