3 ms·
Seems then you'll probably dislike apl - here's the full implementation of Conway's Game of Life in 53 characters: life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖
by sgrove 5y ago
Seems then you'll probably dislike apl - here's the full implementation of Conway's Game of Life in 53 characters:
life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵}
And the explanatory video behind it (quite approachable!) https://www.youtube.com/watch?v=a9xAKttWgP4 https://www.youtube.com/watch?v=a9xAKttWgP4
- desine 5y agoProbably not. I've heard of it, never looked too in depth. As mentioned I've become a fan of Scheme. The definitive text for learning it is probably SICP, in which Sussman and Ableson call programming a form of magic - calling out certain incantations, knowing their meaning, use, and producing data manipulation from them. I find this accurate, but as an English speaker, I think I just prefer the Latin Vulgate versions, and not the runespeak of the forgotten gods. I guess maybe I was a bit harsh to say there is no use case. Perhaps there is, for someone with a deeper cognitive and memorization pool than I. For me, though, interpreting such an incantation would be the equivalent of breaking down each operation into it's C-like forms. If it were broken down for me on the screen, I could back-reference each step, and view each incantation within the framework of the larger piece. Mentally interpreting the above would require me to do the same, but with each step stored in my own mental stack memory allocation, which would quickly overflow and crash. Perhaps not, as mentioned I never tried APL, but I doubt I have the capacity to keep it all straight.
- sgrove 5y agoThat's fair! It's just a DSL with all the tradeoffs that implies (and what lisp is generally quite good at).
- smabie 5y agoIt's just a programming language. Like natural languages, what once seemed foreign and inscrutable before you learn it becomes natural and (not quite) effortless after. I'm sure you can handle it.
- deleted 5y ago[deleted]
- avmich 5y agodesine, learning J, which is in the APL family of languages, is good with "J for C Programmers" https://www.jsoftware.com/docs/help807/jforc/contents.htm https://www.jsoftware.com/docs/help807/jforc/contents.htm - you don't need mental superpowers, Henry Rich gently adds a few new things when you're good with the previous ones.
- warent 5y agoI've always wondered about code like this and what inspires people to write it. How is this any different from just directly writing machine code? Or is this the exact opposite, operating at the highest level of abstraction?
- sgrove 5y agoCloser to a very high level of abstraction in a quite restricted language. Array-based languages have lots of advantages for certain problems for those who have put in the requisite time (certainly not me!). They're one of the languages that'll expand the way you think of programming.
- mlochbaum 5y agoArray languages (Jelly is one of them!) work at a high level of abstraction, since programming consists of applying operations to entire immutable arrays. List comprehensions are probably the closest the mainstream gets to this style. It's not as abstract as possible or anything. Most directly, there are abstractions like algebraic datatypes or macros that APL doesn't have at all. And there's a sense in which APL is very concrete: it tends to use first-order functions instead of higher-order ones like Replicate[0] instead of filter. For me the fact that an array oriented program tends to handle just a few arrays at a time makes it easier to understand what's going on. I think there are also ways in which APL programming is low-level. Going back to Jelly, it's actually a stack machine, same as Java object code, or Forth. Modern APL has tacit programming[1], which has a similar mix of mathematical purity and machine-like shuffling. I think the way APL handles array axes is similar. They are numbered, so to work with them you have to keep track of the ordering. Something like einsum that names them would be higher-level. [0] https://aplwiki.com/wiki/Replicate https://aplwiki.com/wiki/Replicate [1] https://aplwiki.com/wiki/Tacit_programming https://aplwiki.com/wiki/Tacit_programming
- Loocid 5y agoAs a commenter touched on above, these languages are purely for "golfing". Programming golf is when you challenge yourself to solve a problem in the fewest characters possible. Golfing languages therefore, are languages where the aim is to jam as much common functionality into single characters as possible. There is no real practical use for them.
- 8eye 5y agolooks like script kiddies talk from the 90s