5 ms·
Is there a variant of this family of language that has readable syntax?
by empath75 9y ago
Is there a variant of this family of language that has readable syntax?
- throwaway7645 9y agoYea it's actually the most readable in the family to those who haven't put the effort into learning the array paradigm. Dyalog APL & J are the two other main languages in the family that have the largest user bases. Both are pretty awesome.
- coliveira 9y ago+1 to J. It is open source, has lots of libraries, documentation, examples, and runs on most mainstream desktop platforms.
- sndean 9y agoQ is a (semi-)readable variant. You can more or less directly translate K symbols to English words. Here's some code for PE question 1: K +/&~&/(!1000)!/:3 5 Q sum where any not {(til x)mod y}[1000] each 3 5
- rscho 9y agoQ'Nial (https://github.com/danlm/QNial7 https://github.com/danlm/QNial7), although it seems pretty much an abandoned language. Searching for it on github yields like, 3 repos. http://www.nial.com/ http://www.nial.com/ is the official website, which also seems abandoned.
- scottlocklin 9y agoQ'Nial was just open sourced a year or so ago; not really an abandoned language.
- dasmoth 9y agoReadability is in the eye of the beholder! (and no, I’m not a K expert — but try working through a few problems and it does gradually start making sense) If you want a slightly more “English like” language which still gives you the array stuff, Q is built on top of K4 and might fit the bill http://code.kx.com/q4m3/ http://code.kx.com/q4m3/
- icen 9y agoThis syntax is very readable. The maximum semantic size of a function that's still easy to read is much larger. Functions that do entire things in one go are more common, and make reading about the entire program much easier - the game of life in one line is idiomatic and elegant APL, but it would be an inelegant mess in other languages.
- sammoorhouse 9y ago> The maximum semantic size of a function that's still easy to read is much larger. This seems like a really weird thing to optimise for - would you mind saying more? I've never found myself thinking "man, I wish my function could _do more_". > This syntax is very readable. Objectively, by any measure, this isn't true.
- dang 9y agoNot by the measure which matters most: the programmers using it. Readability is relative. It's a category error to speak of it without saying who the reader is. Is Sanskrit readable?
- sammoorhouse 9y ago> the programmers using it Completely disagree, and I think the people spending the 2010's clearing up screeds of idiomatic perl 5 would side with me :)
- goatlover 9y agoAre these idiomatic perl 5 programmers, or programmers converting it to their language of choice? And if the second, would it have been any easier going from Lisp or Haskell to Python, Go or whatever? Point being that translating from unfamiliar syntax to familiar is always a challenge.
- RodgerTheGreat 9y agoI use k3 at work every day. It's perfectly readable to me. Every summer we spend about a week training interns with K, and they proceed to read, modify and write real production code with it during their tenure. Interns come from a mix of backgrounds- computer science, various engineering degrees, etc. This seems compelling evidence that K is learnable. If you find K unreadable, consider spending a week or two seriously working with it. You might be surprised how you feel afterwards.
- xamuel 9y agoIt's worth the learning curve. I can't count the number of times some horrible multithousand-line pandas contortion has been replaced by a dozen lines of Q. After working in Q for awhile, you go look at someone's R code or Pandas code or whatever and you're like, "Shut up and get to the point!"