Live data from Hacker News

Arthur Whitney releases an open-source subset of K with MIT license

shakti.com

71–80 of 234 posts

Re: Arthur Whitney releases an open-source subset of K with MIT license

#71

This language is very popular among quant finance people associated with Morgan Stanley. I don’t see the appeal myself. Maybe it helps prevent people stealing the code since it’s so awful looking to work with! At one point I had to learn it and I think I’ve totally forgotten it now— it’s like my brain repressed it. Not my cup of tea, that’s for sure.

Thinking about problems and data manipulation in the way array languages enable is hard but, once you have pushed through the what feels like a barrier of mainstream programming language thinking that is stopping you from “grokking” it, it is a sudden moment of clarity and then you “get it”.

Perhaps a half way house is sql. The difference between ORM-style CRUD and a power user using window functions to make the data dance shows there is still art to be had in programming :)

Re: Arthur Whitney releases an open-source subset of K with MIT license

#72

Earlier quoted context omitted.

The only possible advantage I can think of is that you can fit more code on one screen so I guess in theory you can see your context more easily. But that seems pretty minor compared to... well, look at it! I read a couple of other threads and some people try to claim less code = fewer bugs, but that's pretty clearly nonsense otherwise minifiers would magically fix bugs. As for why people actually use this (it seems…

It's not that any method of reducing code length fixes bugs, it's just happens that optimizing code to be read and worked on by domain experts leads one toward patterns that secondarily end up manifesting as terse expressions. The terseness is certainly shocking if you're not accustomed to it, but it's really not a terminal goal, just a necessary outcome. The disbelief on first encounter is totally reasonable, but fr…

From personal experience with regex, yes the first encounter was shocking, and sure I got past it and now can easily write regexes. But they still aren't more readable than the alternatives. Nor would I encourage their use in production.

Re: Arthur Whitney releases an open-source subset of K with MIT license

#73

He showed K @ Royal Society & bunch of apl & aplus guys were there. Someone asked , where are the comments? AW said comments get out of date with all the changes, if you can’t read the code you Shldnt be working on it. We then all looked at each other..

> if you can’t read the code you Shldnt be working on it I don't know this AW guy, but to me that's a huge red flag and a sign that a programmer hasn't worked on anything substantial. Ie non-trivial stuff that's maintained by a team over time. Being able to read the code is irrelevant, as the comments should tell you why the code is doing what it's doing. For example, yeah I trivially can see the code is doing a retr…

> a sign that a programmer hasn't worked on anything substantial

Maybe you want to check who he is?

Re: Arthur Whitney releases an open-source subset of K with MIT license

#74
post #32

Earlier quoted context omitted.

You may not believe it, but that's how K/Q/J people write C code. Bonus: Go visit and do "View Source" on that website. Even HTML has fragrance of K.

I don't understand how. How do you debug something this? How do you go about fixing a bug? There are no docs nor tests. It seems like one would spend hours just trying to understand what's going on. Is there a good source on their methodology? Because my mind is blown.

The environment is very interactive. It also helps when you can fit do much more on screen, quite possibly the entire program.

Re: Arthur Whitney releases an open-source subset of K with MIT license

#75

Earlier quoted context omitted.

I suppose in our new world of LLMs, using as few tokens as possible means you can cram more in a small context window, which could be helpful in various ways.

Maybe someone could produce an LLM which takes a line of vector language code and expands it into the dozen(s) of lines of equivalent pseudo-algol? (I mean, you could skip the whole hallucination thing and write an exact converter, but that'd be a lot of effort for code that'd probably get used about as much as M-expression to S-expression converters do in the lisp world?)

There are a few articles of using J or APL for ANNs and CNNs out there. Here's one:

  https://arxiv.org/pdf/1912.05234

Re: Arthur Whitney releases an open-source subset of K with MIT license

#76
post #21

Earlier quoted context omitted.

Thanks. I'm now reading this where people are trying to explain what happened in the ref/ directory. https://github.com/kparc/ksimple/blob/main/a.c

Thanks for that link. The comments there help a lot. If I understand them, this is a minimal implementation of K with a lot of limitations, such as: "the only supported atom/vector type is 8bit integer, so beware of overflows" Still, it's fascinating how an interpreter can be written with such a small amount of code.

An interpreter for BLC, including tokenizing, parsing, and evaluation, can be written in as few as 29 bytes of BLC (and 650 bytes of C).

Re: Arthur Whitney releases an open-source subset of K with MIT license

#77
post #61

Those are some very big claims with respect to performance. Has anyone outside of the author been able to reproduce the claims, considering you need to pay 100k/month just to do it? I also wonder if the commercial version has anti-benchmark clauses like some database vendors. I've always seen claims that K is much faster than anything else out there, but I've never seen an actual independent benchmark with numbers. E…

Array languages are very fast for code that fits sensibly into arrays and databases spend a lot of compute time getting correctness right. 100x faster than postgres on arbitrary data sounds unlikely-to-impossible but on specific problems might be doable.

Re: Arthur Whitney releases an open-source subset of K with MIT license

#78

He showed K @ Royal Society & bunch of apl & aplus guys were there. Someone asked , where are the comments? AW said comments get out of date with all the changes, if you can’t read the code you Shldnt be working on it. We then all looked at each other..

> if you can’t read the code you Shldnt be working on it I don't know this AW guy, but to me that's a huge red flag and a sign that a programmer hasn't worked on anything substantial. Ie non-trivial stuff that's maintained by a team over time. Being able to read the code is irrelevant, as the comments should tell you why the code is doing what it's doing. For example, yeah I trivially can see the code is doing a retr…

Defining substantial as written by a team over a long period of time seems to be putting the value in the wrong place. Is the important thing what the software does, or that it took a lot of people a long time to write it?

Re: Arthur Whitney releases an open-source subset of K with MIT license

#79

Interesting things in here. #define _(e) ({e;}) //! I didn't know that corner of C. Removing the () from the macro does change what you can pass as e, and assigning the result of a block does work as one would expect. edit: -Wpedantic on gcc will tell me ISO C doesn't like the construct but it still compiles it happily. Clang offers -Wgnu-statement-expression-from-macro-expansion So it looks likely that this is the G…

Yes, this is called statement-expression (instead of expression-statement which is the normal "doer" statement that contains just an expression followed by a semicolon).

The Linux kernel makes quite a bit of use of them as far as I'm aware.

Re: Arthur Whitney releases an open-source subset of K with MIT license

#80

The website reads like an edgy script-kiddy blog. Is K actually a useful project, or is it just a passion project of someone who happens to be sort of famous?

It’s niche, but a large part of the financial industry relies on it, for the heavy lifting of pricing and modelling, often with higher level APIs in Python or Java. Incidentally, if you run into a group full of Northern Irish developers at any big bank, you have probably found the K folks.
Post reply on HN