Live data from Hacker News

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

shakti.com

21–30 of 234 posts

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

#21
post #15
post #5

The code looks heavily obfuscated. It's more like "source available" than open source. E.g. g(_M,W-=1 i?_M(i,M_(i+1))+(2*n0 Edit: Looking at it a bit more, I can't tell if the code is obfuscated or if the author really wrote it like this...

That's the "Whitney style". See: https://code.jsoftware.com/wiki/Essays/Incunabulum It's writing C in array-language style rather than intentional obfuscation.

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

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

#22
post #9

Earlier quoted context omitted.

Does writing in this way has any advantage in practical terms (not aesthetically reasons)?

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…

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.

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

#23

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

So far the highest ratio of comment to code I've seen is Hsu's thesis (~200 pages of commentary[0] to ~20 lines of code[1]) at 10 pages/line.

[0] https://scholarworks.iu.edu/dspace/bitstreams/dcbd5240-8454-...

[1] https://www.bonfire.com/co-dfns-thesis-edition/

(a) come to think of it, theses are one and done

(b) thanks to Kragen for pointing out this 02019 work!

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

#25
post #9

Earlier quoted context omitted.

Does writing in this way has any advantage in practical terms (not aesthetically reasons)?

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…

> But they [regexes] also tend to be completely unreadable

Regular expressions can be constructed using various syntaxes. Some are optimized for writing them out quickly, and some are not. Choose the latter when going to production, and you'll be fine.

As for K/J/APL - it's similar. You can write incredibly terse code which works wonderfully in a REPL (console). Working in an interactive manner is the default mode of operation for those languages. If you ever worked with Numpy/Pandas or similar, in a REPL, you likely concocted similarly terse monstrosities. Check your %hist the next time you have a chance. Going to production, you naturally rewrite the code instead of just committing the first one-liner that produces the desired results.

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

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

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

#30

OMG, just yesterday I wrote a comment saying that I regret not learning K (I instead chose J) due to being too hung up on the notion of free software at the time... What a coincidence! Now I have no excuses anymore, time to learn K!

How those two compare?
Post reply on HN