Live data from Hacker News

K: We need to talk about group

gist.github.com

31–40 of 102 posts

Re: K: We need to talk about group

#32

is there any way i can try this out?

Yep - added a link to some simple examples in the article (below). Throughout the article there are also a few links to executable versions of the code examples.

https://ngn.codeberg.page/k/#eJxdjssKwjAQRffzFddVFyLFoiiFQD8...

Re: K: We need to talk about group

#33
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 .

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

Haskell allows defining unicode operators, and has an extension that allows you to use unicode symbols instead of ascii sequences in various parts of the syntax.

Re: K: We need to talk about group

#35
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 .

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

APL predates the first documented thoughts (not specification/implementation) of unicode by roughly 20 years.

Re: K: We need to talk about group

#36
Imagine what APL could do with a Haskell-style type system and enforced referential transparency.

APL programmers want to say their language is mathematical notation, well, make it mathematical notation.

Re: K: We need to talk about group

#37
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 .

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

Raku (fka perl6) has some, eg you can use += to atomically increment a value.

Re: K: We need to talk about group

#38
post #4

https://en.wikipedia.org/wiki/K_(programming_language)

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 the operators rather than the interpreted language, and the operators tend to make the cpu happy – they work on contiguous memory, tend to be vectorized, don’t branch unpredictably, etc – so even if you have to compose many steps, you win on the time to write and the time to execute can be hard to beat because the constant factors of each individual operation are good.

For obvious reasons, things like numpy, pandas, dplyr, etc are more popular as their syntax is a bit more readable and it is easier to get data in/out. I think they do lose a bit by not having lots of the useful compostable APL-style operators because those things don’t have comprehensible names.

Re: K: We need to talk about group

#39
post #4

https://en.wikipedia.org/wiki/K_(programming_language)

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.
Post reply on HN