6 ms·
Mastering Dyalog APL
- raghavchamadiya 6mo agoNice to see this getting the Jupyter Notebook treatment. The original book was already one of the better introductions to APL. Interactive examples make a huge difference for a language where half the learning curve is just building muscle memory with the symbols
- MayCXC 5mo agoAPL workspaces substantially predate Jupyter notebooks!
- pjmlp 6mo agoI have no use for APL, yet this looks like a great bookmark for rainy days.
- UltraSane 6mo agoI really wish learning this had a positive RoI
- robomartin 6mo agoIt does, over time. It changes the way you think about computational problem solving. It's like the difference between designing objects in 2D on a drafting table and moving to 3D CAD. It changes your brain visualizes, explores and solves problems. That said, learning APL isn't about learning the symbols any more than learning mathematics is not about learning the meaning of the various symbols it uses. To continue with that parallel, it also isn't about memorizing formulas. It is about using the tools to solve problems and, over time, changing the way you solve problems...now in 3D. I learned APL in the early 80's and used it professionally for about ten years. The way I think of solving problems is fundamentally different in many ways because of this experience.
- skruger 6mo agoIt has a huge RoI, even if you never use it in anger. It’s a bit like Lisp in that regard — it shapes your thinking.
- twoodfin 6mo agoFor those like me who prefer a PDF: https://www.dyalog.com/uploads/documents/MasteringDyalogAPL.pdf https://www.dyalog.com/uploads/documents/MasteringDyalogAPL....
- Pay08 6mo agoHow useful would learning APL be for writing less strictly array-based languages like Matlab?
- gobdovan 6mo agoGiven you could even use it commercially (it requires an enterprise license, but I suppose Matlab does too), moderately useful conceptually, weakly useful mechanically. APL is very limited in what offers you. I did a ML course in Matlab a while ago and I remember I could scalar loops and procedural scripts, had nice tables and object-ike structures. You'd give that all up in APL so it wouldn't help you there, but you'd see how far you can get only with creative 'array language semantics'.
- lokedhs 6mo agoDyalog APL, along with other modern array languages that are related to it can all do imperative programming with loops etc. There are certainly valid arguments that you hive certain things up when moving to an array language, but loops are not one of those. That said, you won't use loops as much, but that's not because loops are not available.
- meken 6mo agoI had a little excursion into Dyalog APL recently and wound up writing an emacs mode to evaluate Dyalog APL [1]. It was a pretty nice experience using Claude to extract the small subset of features I wanted from gnu-apl-mode [2] to work with Dyalog APL. I’d really like to properly get into APL though. My plan is to solve a bunch of problems on Kattis [3]. I'm really enjoying this way of learning a new language in the age of LLMs - starting with easy problems on an online code judge website and work with an LLM to come up with/explain simple solutions. It gives me dopamine hits, lots of reps, allows me to start coding right away, and is a nice way to slowly ramp up difficulty and get practice with different features of the language. [1] https://github.com/ebanner/dyalog-mode https://github.com/ebanner/dyalog-mode [2] https://github.com/lokedhs/gnu-apl-mode https://github.com/lokedhs/gnu-apl-mode [3] https://open.kattis.com https://open.kattis.com
- gobdovan 6mo agoIt always felt strange to me that the main implementation of something as niche and esolang-adjacent as APL is neither OSS nor casually usable commercially, but instead comes under an enterprise license. Anyway, I had a fun time a while ago translating APL programs to NumPy. At some point you get what APL is all about, and you can move on with life without too many regrets. Turns out most of the time it's more like a puzzle to get an (often inefficient) terse implementation by torturing some linear algebra operators. If you're after a language that's OSS, has terse notation, and rewires your brain by helping you think more clearly instead of puzzle-solving, TLA+ is the answer. Edit: if you're curious to see at a glance what APL is all about: APL code: (2=+⌿0=∘.|⍨⍳N)/⍳N <- this computes primes up to N and is presented as the 'Hello world' of APL. Equivalent NUMPY code: ``` R = np.arange(1, N + 1) # ⍳N divides = (R[None, :] % R[:, None]) == 0 # 0=∘.|⍨⍳N divisor_counts = divides.sum(axis=0) # +⌿ result = R[divisor_counts == 2] # (2=...)/⍳N ``` As you can see, the famous prime generator is not even the Eratostenes' sieve, but a simple N^2 divisor counting computation.
- adamgordonbell 6mo agoBQN exists and needs more attention I think. It has some modern affordances as well. https://github.com/mlochbaum/BQN https://github.com/mlochbaum/BQN https://mlochbaum.github.io/BQN/doc/quick.html https://mlochbaum.github.io/BQN/doc/quick.html
- floxy 6mo agohttps://lamport.azurewebsites.net/tla/tla.html https://lamport.azurewebsites.net/tla/tla.html ?
- gobdovan 6mo agoYes! I put together some explanation and TLA+ related resources in this comment, the website is one of them: https://news.ycombinator.com/item?id=48075169 https://news.ycombinator.com/item?id=48075169
- blowscum 6mo ago> At some point you get what APL is all about, and you can move on with life without too many regrets. Honestly this is how computers/software/programming feel in general these days and it’s ruined it all for me.
- skruger 6mo agoA more concise intro to APL for the modern era: https://xpqz.github.io/learnapl https://xpqz.github.io/learnapl (author)
- xvilka 6mo agoIn the modern world there is no place for the commercial compiler. They should have made it free (and open source) and only IDE (maybe) paid one. Even better - push into GCC or LLVM.
- gucci-on-fleek 6mo agoI agree with you in principal, but I don't think that that's realistic at all, since that would completely destroy Dyalog's entire business model. I personally have little interest in learning a non-FOSS programming language, but Dyalog's paying customers are clearly okay with it, so I see little reason for them to change.
- radiator 6mo agoBut why? Commercial APL implementations have existed since decades ago. They always had customers. They were always at least partly owned by employees. Dyalog was not created in a void, but continuing this tradition.
- tosh 6mo agofwiw Dyalog APL is free for non-commercial use: https://www.dyalog.com/prices-and-licences.htm https://www.dyalog.com/prices-and-licences.htm
- 5- 6mo agotypical implementations of apl (including dyalog) are interpreted, not compiled ahead of time.
- Ayush_Khati1 6mo ago[flagged]
- suis_siva 5mo agoI am really surprised that no-one mentioned https://www.uiua.org/ https://www.uiua.org/ yet. If you like APL/BQN/K/L, look at Uiua! You're going to love it! It's very ergonomic, and has awesome and fun facilities for audio and video rendering!