Live data from Hacker News

K: We need to talk about group

gist.github.com

61–70 of 102 posts

Re: K: We need to talk about group

#61
post #52

Earlier quoted context omitted.

it's libre and gratis, if that's not something that bothers you (and to be sure if you're just writing code for your own edification it's not a practical problem) then i would recommend dyalog, although as a side effect of being open J has a (perhaps only slightly) larger free ecosystem and community. the down side is that subjectively some people (myself included) find J uglier, less effective as a tool of thought a…

I see, thanks! Looks like I might try both. The "no proper lightweight anonymous function syntax" sounds weird to me, I would have thought that's paramount for an array language? Do I misunderstand?

In J if you want to do something fairly complex without writing a function you can pile up a bunch of verbs/operators into a big (point free) verb-train. You can't do recursion, loops or explicit flow control but in the Array Languages that's not much of a handicap, it can get pretty hairy to read though

In dyalog you can (as of about v13) do that if you want, or you can just use curly brackets { and inside of them have lexically scoped variables, multiple expressions, recursion and if/then (no loops either though) }

Re: K: We need to talk about group

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

Chinese is a "normal language" to over a billion people.

Re: K: We need to talk about group

#63
post #29
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 .

Amazingly, APL is more readable. Actually, it's even pretty intuitive. Which proves again, that restricting code to ASCII when every competent programmer (and PC-user in general) can enter almost any unicode symbols just fine is simply stupid.

You can enter any symbol but not quickly unless you set up some hotkeys or something. There is a key on the keyboard for e. Whatever you have to do for a unicode set symbol, it's going to be harder than hitting the e key.

And with regards to hotkeys, let's say you do Ctrl+alt+shift+esc+e to insert a unicode symbol, is that really better than just having a programming language where the common hotkeys are spelled out with a few ASCII characters?

Re: K: We need to talk about group

#64
So the summary of that long post: we still need group but Shakti/k9 gets rid of it because it's too slow forcing the user to diy it with other primitives as needed?

I love it... It's the exact opposite of every other language design. Others: lets ship it with every tool a developer might ask for. K9: Occam's razor to everything. Nothing is safe.

Re: K: We need to talk about group

#65
post #39

Earlier quoted context omitted.

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

What is a trade engine?

The actual thing that lines up a series of sell-at-this-price bids and the series of buy-at-this-price bids (or even more complicated types of orders, this the easy case) and crosses them over, figuring out who gets what bids filled by whom at what price, at supremely fast speeds and large volumes.

Re: K: We need to talk about group

#66

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…

I wrote http://KlongPy.org to blend Klong and python. Eat your cake and have it too :)

Re: K: We need to talk about group

#67
post #48

Earlier quoted context omitted.

Hmm, so why J over Dyalog APL then?

it's libre and gratis, if that's not something that bothers you (and to be sure if you're just writing code for your own edification it's not a practical problem) then i would recommend dyalog, although as a side effect of being open J has a (perhaps only slightly) larger free ecosystem and community. the down side is that subjectively some people (myself included) find J uglier, less effective as a tool of thought a…

Do you know if it's available from GNU/Linux repositories? One thing that bothers me with single letter language names is that it makes searching information cumbersome, due to lots of noise in search results.

Re: K: We need to talk about group

#68
post #52

Earlier quoted context omitted.

it's libre and gratis, if that's not something that bothers you (and to be sure if you're just writing code for your own edification it's not a practical problem) then i would recommend dyalog, although as a side effect of being open J has a (perhaps only slightly) larger free ecosystem and community. the down side is that subjectively some people (myself included) find J uglier, less effective as a tool of thought a…

I see, thanks! Looks like I might try both. The "no proper lightweight anonymous function syntax" sounds weird to me, I would have thought that's paramount for an array language? Do I misunderstand?

This was true historically, but recent versions of j introduced a 'direct definition' syntax similar to dyalog's dfns.

Re: K: We need to talk about group

#69
post #4

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

Most of the time when you open a PL article on Wikipedia you're greeted with a Hello World example, but here you get this:

"""

[...] As a result, K expressions can be opaque and difficult to parse for humans. For example, in the following contrived expression the exclamation point ! refers to three distinct functions:

    2!!7!4
Reading from right to left the first ! is modulo division that is performed on 7 and 4 resulting in 3. The next ! is enumeration and lists the integers less than 3, resulting in the list 0 1 2. The final ! is rotation where the list on the right is rotated two times to the left producing the final result of 2 0 1.

"""

Re: K: We need to talk about group

#70
post #64

So the summary of that long post: we still need group but Shakti/k9 gets rid of it because it's too slow forcing the user to diy it with other primitives as needed? I love it... It's the exact opposite of every other language design. Others: lets ship it with every tool a developer might ask for. K9: Occam's razor to everything. Nothing is safe.

I think we need some kind of grouping function, but it doesn't have to be the 'generate group indices' function. I'm sure we'll have alternatives available such as `update ... by`.
Post reply on HN