3 ms·
> From what I can tell, the core learning one takes from J/K/etc is the concept of an array language and treating arrays as first class objects. And nowadays Py
by beagle3 10y ago
> From what I can tell, the core learning one takes from J/K/etc is the concept of an array language and treating arrays as first class objects. And nowadays Python/R/Julia provide this same functionality in a more verbose/more readable/more mainstream package.
That's just part of it. Other parts (by no means a complete list):
- Visual density puts the pattern matching engine in your brain to good use; e.g. the K idiom "|/0(0|+)+\" which implements maximum-subsequence-sum is a 10-character visually recognizable sequence recognizable to many K programmers, which is efficient and well specified; Similarly, ",//" flattens a list. I don't know of any other language family that has this feature.
- Arrays with equivalent indices work better than structures ("column major" captures some, but not all of it)
- A properly selected core set of concrete operations (in K's case, about 60 of them) makes the needed abstractions shallower and simpler than a properly selected set of abstraction constructs.
- yummyfajitas 10y agoI agree that Python/R/Julia don't have the same visual density. But your second point is definitely something that Python/R/Julia do - that's why data frames (e.g. Pandas) are so popular. Can you suggest something that K does beyond this? By the way, I'm not asking to criticize K. I really want to know of there is something I'm missing. I've investigated J a bit, but never found the enlightenment that people say I'll find.
- beagle3 10y ago> Can you suggest something that K does beyond this? I'm not familiar enough with pandas to say for sure that K is way better - but I was familiar enough with numpy back in the day, and that was definitely way too clunky and cumbersome compared to K. But look at e.g. advent-of-code solutions on https://kx.com/2016/01/04/puzzle-solutions-for-advent-of-code/ https://kx.com/2016/01/04/puzzle-solutions-for-advent-of-cod... - I suspect even pandas won't be able to use vector correspondence so succinctly.