3 ms·
I discovered APL/APL2 in the 70's (using actual overstrikes on a paper terminal) and fell instantly in love with it. But when I later discovered functional pro
by pklausler 3y ago
I discovered APL/APL2 in the 70's (using actual overstrikes on a paper terminal) and fell instantly in love with it. But when I later discovered functional programming with ML and Haskell, I realized that what I really enjoy about APL had little to do with arrays, but more with its ability to compose functions.
Haskell is so much better at this, being completely pure and typed throughout, and is even more fun and powerful than APL; I've used it to write a lot of small and medium-sized projects, prototype LLVM Flang's parser to prove the concept of using parser combinators for Fortran, and do Advent of Code each year in a few hundred lines of code total. If you like APL, try Haskell.
Today, I think that the whole "notation as a tool of thought" aspect of APL is a rationalization for excessive brevity -- which can be a good way to demonstrate the power of composition, but which can work against clarity.
- jim-jim-jim 3y agoYes. I'm a broken record on this topic, but I largely stopped messing with J and K once I got decent at writing point-free Haskell. Verb trains are even more powerful with functors in the mix. <=< is already available, and once you write an equivalent for fmap, you really start cooking. |||, +++, &&&, and *** are great too. And you can always write UTF-8 operators to make it even shorter and prettier. It's unfortunate that the serious Haskell I've seen at work/in the wild is rarely friendly to vertical screen realestate in this way.
- tsegratis 3y agoCould you link your advent of code source please?