Comment by xedrac
3 years ago
> But APL programs are often cryptic and hard to decode. Some have joked that it is a “write-only language” because even the author of a program might have trouble understanding it later.
So the original Perl?
3 years ago
> But APL programs are often cryptic and hard to decode. Some have joked that it is a “write-only language” because even the author of a program might have trouble understanding it later.
So the original Perl?
I actually find it way easier and shorter to review code I've written in J and APL, because it is so succinct and the symbols are well defined. Having to review something that is a paragraph or one page of code is much easier than following pages of other programming languages code. You can comment APL as you can in most PLs, and with the REPL-like dev environment, you can test pieces of code for verification quite immediately and easily. I love APL and J. I am currently using April [1]. APL in Lisp for the best of both worlds - the expressivity of APL (and Lisp), and the CL ecosystem for batteries included. The mix is always surprising.
we need just the correct expectations. APL is like mathematics for me. i need to read it several time to understand dense unfamiliar terms and formulas. same goes for APL. it is not the typical language which i assume can be read while driving
I'd argue you could view 2 lines of APL while driving with less distraction then flipping the screen or page to read your 2 pages of code in most other PLs.
What are you using April for?
I have always liked Lisp and array languages, so I am finding my footing with April, since it is very flexible. You can write predominantly in one or the other, but I am finding it easier to do the math and array stuff in APL, and the glue in Lisp. Right now I am experimenting with creating some generative art and music with CM (Common Music, a Lisp music composition system that lends itself well to creating algorithmic music) and using APL to create the patterns for CM as arrays and composed functions. I want to add graphics and animations to the code once I get CM working with April. I just started learning April, and I am having so much fun with it, I need to stay focused on my original task!
Another parallel for Rust is Rust and BQN. BQN is a new array language, and you can run it within Rust sort of like what April does for Lisp and APL.
https://detegr.github.io/cbqn-rs/cbqn/
Way harder to read than Perl..
You can create obscure Perl as you can create obfuscated C as in any language, but if you think about the reader you can create 'easy to read' program in Perl, even by a beginner.
But creating 'not obfuscated' APL? That's really hard!
Nope, not even close. I’ve written/read lots of Perl.
APL is a completely different paradigm.
Every now and then I get the urge to take a deep dive into APL or J but I really need a use case.
Since they are array languages they seem like they might be good for machine learning?
Image processing is a fun use case. For example, here's a bit of Common Lisp using April and the Opticl library to create a mirrored meme image:
The 2 0 at the start of the APL line above controls the mirroring behavior. The second number can be set to 0 or 1 to choose which side of the image to mirror, while the 2 sets the axis along which to mirror. This will be 1 or 2 for a raster image but this function can mirror any rank of array on any axis.
April was used to teach image filtering in a programming class for middle-schoolers, you can see a summary in this video: https://vimeo.com/504928819
For more APL-driven graphics, April's repo includes an ncurses demo featuring a convolution kernel powered by ⌺, the stencil operator: https://github.com/phantomics/april/tree/master/demos/ncurse...
Here's one paper on CNN's in APL: https://dl.acm.org/doi/10.1145/3315454.3329960
The use case is use J or K is to do advent of code or the Euler project :p
APL is a tool for thought more than a real programming language so in my opinion it's best suited to boost your puzzle solving ability.