Live data from Hacker News

K: We need to talk about group

gist.github.com

41–50 of 102 posts

Re: K: We need to talk about group

#41
post #16
post #12

It’s awe-inspiring to see a K program where the comments are in another APL variant (I can’t pretend to know which): {d:~1=':s:^x / s‿e←1⊸»⊸(>⋈ This program implements a Pigdog Latin translator, bien sûr .

I... just can't. I work a lot with data, so it sounds like it should be a good fit for what I do, but I find that writing the damn code in a normal language is much more productive. Maybe it's my brain that's wired wrong, but I fail to see how the entire construction is supposed to help.

I think the main use for K and the other APL family languages is programmer lock-in. If you can get your employer to buy in and write the entire codebase in one of these languages, you can establish yourself as essentially irreplaceable and then demand large raises to retain you.

Re: K: We need to talk about group

#42
post #12

It’s awe-inspiring to see a K program where the comments are in another APL variant (I can’t pretend to know which): {d:~1=':s:^x / s‿e←1⊸»⊸(>⋈ This program implements a Pigdog Latin translator, bien sûr .

That’s BQN: https://mlochbaum.github.io/BQN/

Re: K: We need to talk about group

#43
From the way I often use Haskell, Matlab, and even crazy shell one-lines with lots of pipes, awk, sort, and other stuff, I often have the impression that array languages are exactly what I'm looking for for certain problems.

The question is... which array language should I pick? What are the reasons to pick one over the other?

Re: K: We need to talk about group

#44
post #16
post #12

It’s awe-inspiring to see a K program where the comments are in another APL variant (I can’t pretend to know which): {d:~1=':s:^x / s‿e←1⊸»⊸(>⋈ This program implements a Pigdog Latin translator, bien sûr .

I... just can't. I work a lot with data, so it sounds like it should be a good fit for what I do, but I find that writing the damn code in a normal language is much more productive. Maybe it's my brain that's wired wrong, but I fail to see how the entire construction is supposed to help.

what was your first programming language?

mine was matlab. thinking of everything as an array, especially things that aren't arrays, was the first pattern I ever learned. I've never used APL in anger but for the most part it comes very easily to me. Maybe not the code golfing and/or idiomatic APL style that people like to post but, like, using the primitives to create increasingly elaborate arrays before discarding anything I don't want, that part has always felt very straight forward.

Re: K: We need to talk about group

#45

Earlier quoted context omitted.

Isn't the original APL the only lang that uses actual Unicode symbols for operators?

There are esoteric code golf languages that use unicode. MPW (shell, assembler) used extended characters (MacRoman, not unicode but then again, APL also predates unicode) for some operations. eg, instead of "echo yo >> file" you would "echo yo ≥ file"

Julia has support for Unicode operators. Most editor plugins for Julia allow you to enter the characters using (La)Tex syntax, so it’s quite common to see.

Re: K: We need to talk about group

#46
post #43

From the way I often use Haskell, Matlab, and even crazy shell one-lines with lots of pipes, awk, sort, and other stuff, I often have the impression that array languages are exactly what I'm looking for for certain problems. The question is... which array language should I pick? What are the reasons to pick one over the other?

J i guess. https://www.jsoftware.com/#/

I don't really like J but the only serious APL left is the proprietary (though free, and fun) Dyalog; K, the official product, is also proprietary and because Arthur rewrites it every couple of years all the open source clones are of different versions so there isn't much of an ecosystem.

Re: K: We need to talk about group

#47

Earlier quoted context omitted.

That has to be the tersest language I have ever seen in my life. Code golf but it's actually a real language used heavily in finance.

I think ‘used heavily’ is a bit of an overstatement. I think the right intuition for APL-family languages is that they mostly do numpy-like operations except their set of operations tend to compose very nicely. So the idea is that one can quickly and interactively figure out a composition of the operations which will do the calculation you want, but you don’t have a complicated compiler and spend most of your time in…

> compostable APL-style operators

APL-style operators have been sent to the compost heap of history for a reason.

Re: K: We need to talk about group

#48
post #43

From the way I often use Haskell, Matlab, and even crazy shell one-lines with lots of pipes, awk, sort, and other stuff, I often have the impression that array languages are exactly what I'm looking for for certain problems. The question is... which array language should I pick? What are the reasons to pick one over the other?

J i guess. https://www.jsoftware.com/#/ I don't really like J but the only serious APL left is the proprietary (though free, and fun) Dyalog; K, the official product, is also proprietary and because Arthur rewrites it every couple of years all the open source clones are of different versions so there isn't much of an ecosystem.

Hmm, so why J over Dyalog APL then?

Re: K: We need to talk about group

#49

Earlier quoted context omitted.

I think ‘used heavily’ is a bit of an overstatement. I think the right intuition for APL-family languages is that they mostly do numpy-like operations except their set of operations tend to compose very nicely. So the idea is that one can quickly and interactively figure out a composition of the operations which will do the calculation you want, but you don’t have a complicated compiler and spend most of your time in…

> compostable APL-style operators APL-style operators have been sent to the compost heap of history for a reason.

Fold

Scan

Map

Head/tail

Index (with an array)

The integers up to n

Concatenate

Flatten

Most of the operators are already familiar but they tend to work well on multidimensional arrays and with each other due to broadcast semantics (and some axis selection features). In other languages you may see the magic broadcasting for some operations like addition but many of the functions only work on vectors.

Re: K: We need to talk about group

#50
post #39

Earlier quoted context omitted.

That has to be the tersest language I have ever seen in my life. Code golf but it's actually a real language used heavily in finance.

Some exchanges like BitMEX are written in kdb+, as in, the trade engine.

What is a trade engine?
Post reply on HN