Live data from Hacker News

KlongPy: High-Performance Array Programming in Python

github.com

71–80 of 90 posts

Re: KlongPy: High-Performance Array Programming in Python

#74
post #7

I gather where it says `:monad` it is referring to an operation that had an effect on the interpreter state?

No. In APL deriverd array programming languages, verbs (or functions) are monadic or dyadic : they accept only one or two arguments : In '1 + 1', + is a dyadic operator, while in 'exp 5', exp is monadic. In J, and in APL I guess, left arg is usually understood as 'control data', while right arg is the data upon which calculation is done. Left argument is usually left unchanged after calculations. In this way, is it p…

Unfortunate naming coincidence which is confusing. Couldn't we just call those unary and binary operators rather?

Re: KlongPy: High-Performance Array Programming in Python

#75
post #56

Earlier quoted context omitted.

> including taking a lot of terminology (rank, etc.). AFAIK that's a linear algebra term for matrices, not something array programming or Pytorch or TF invented.

it's an unfortunate terminology collision. - array languages: rank is the dimensionality of an array, i.e. a vector is rank-1, a matrix is rank-2, a N-D array is rank-N - linear algebra: rank is the number of linearly-independent columns (and also rows) So for example, if you have a 5x5 matrix where 4 of the columns are linearly independent, it would be rank-4 in the linear algebra sense, and rank-2 in the array lang…

Rank in the array language terminology seems to be synonymous with tensor order (sometimes called tensor rank). Ken Iverson (APL's creator) was a mathematician, so I'm not that surprised to learn the term came from a branch of math.

Re: KlongPy: High-Performance Array Programming in Python

#76
post #46

I’ve tried several times to give J/k/Q/kdb a chance but I haven’t really found a convincing example why this approach is better than say SQL or say numpy/jax etc. The syntax has the same problem as perl in that you have to learn too many symbols that are hard to look up. And this combined with the tacit style makes it difficult to parse what the code is doing. I think ruby went in the radically opposite direction in…

There was a step-change improvement for me when I tried expressing some JS patterns via `underscore.js` instead of procedurally: eg: http://underscorejs.org/#each Thinking of something as `each | map | filter | sum` is waaay less buggy than writing bespoke procedural code to do the same thing. No doubt there is a "cost" to it as well, but the _abstraction_ is valuable. Now, if there were a "compiler" which could opti…

That's kind of what we're aiming for with PRQL (prql-lang.org). While currently it only supports SQL backends, I want to generalize that to things like underscore.js.

Re: KlongPy: High-Performance Array Programming in Python

#77
post #68

Good to see KlongPy thrive! It is based on Klong ( http://t3x.org/klong/ ), which I do not maintain any more, so I am glad that Brian took over!

Hey, I read your yoga book today.

Good to hear! I do more yoga than programming these days. :)

Re: KlongPy: High-Performance Array Programming in Python

#78

Earlier quoted context omitted.

Sorry if this is a dumb question, why is this weird in Python? I use R as my main language and this is exactly how I would expect it to work. Does Python not do this naturally?

> sum::{+/x} > count::{#x} These two expressions are not valid in R or Python. They are implicitly declaring a function without declaring the arguments, it is implicitly iterating over the array and returning the result (all features of array languages to make it more concise). Python’s + and / are a function of two objects (dyadic) and are syntactic sugar (they can’t be treated as function values, thats what the ope…

Oh I think I see what you mean. Yes I was thinking of the built-in functions of sum & length

Re: KlongPy: High-Performance Array Programming in Python

#79
post #47

Related. Others? KlongPy: Vectorized port of Klong array language - https://news.ycombinator.com/item?id=35400742 - April 2023 (8 comments) Klong: a Simple Array Language - https://news.ycombinator.com/item?id=21854793 - Dec 2019 (73 comments) Statistics with the array language Klong - https://news.ycombinator.com/item?id=15579024 - Oct 2017 (12 comments) Klong – a simple array language - https://news.ycombinator.com…

Not everyone has read everything that's ever been posted to HN. There's some utility in reposting, which I think is evident based on how many upvotes this has gotten. I'd never seen this and I'm here almost every day.

If you've already seen this, and aren't interested in another look then just move on.

Re: KlongPy: High-Performance Array Programming in Python

#80
post #79
post #47

Related. Others? KlongPy: Vectorized port of Klong array language - https://news.ycombinator.com/item?id=35400742 - April 2023 (8 comments) Klong: a Simple Array Language - https://news.ycombinator.com/item?id=21854793 - Dec 2019 (73 comments) Statistics with the array language Klong - https://news.ycombinator.com/item?id=15579024 - Oct 2017 (12 comments) Klong – a simple array language - https://news.ycombinator.com…

Not everyone has read everything that's ever been posted to HN. There's some utility in reposting, which I think is evident based on how many upvotes this has gotten. I'd never seen this and I'm here almost every day. If you've already seen this, and aren't interested in another look then just move on.

They’re posting related discussions so that interested readers can read further.
Post reply on HN