Live data from Hacker News

K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

github.com

21–30 of 93 posts

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#22

This looks like a cult I would happily dive into. Does anyone care to ELI5? I tried to read the code but did not understand a single line

Arthur Whitney is showing how to build an array language using C in array language form.

AW is known for kdb+ which is often used in finance due to its extreme performance properties and ability for quants to quickly explore ideas.

Personally, to get a better handle on how array languages worked, I implemented KlongPy which is a python implementation of Klong, which descends from K (which AW wrote).

You have to play with this stuff to understand it intuitively.

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#24

This looks like a cult I would happily dive into. Does anyone care to ELI5? I tried to read the code but did not understand a single line

Basically it is an APL-like language that is used (or was, I think it has moved on to a successor language called q now) in the proprietary kdb+ system used by some financial companies. Even if you aren't into finance it is a fun language to play around with.

https://en.wikipedia.org/wiki/Kdb%2B

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#25

[flagged]

Ha! The guy who wrote this is the same guy who invented ~~APL~~ a number of APL inspired languages (Edit: He did not invent APL. Thanks for the corrections!), so I suspect he may just be built different. https://www.jsoftware.com/ioj/iojATW.htm Have you seen anything written in K itself? Here's a program to calculate primes: 2_&{&/x!/:2_!x}'!R

APL was invented by Kenneth Iverson, the other person mentioned on the page, not Arthur Whitney.

I was not convinced of the readability of APL, but compared to its successors which tried to stick to ASCII, I've learned to appreciate the merits of an extended character set.

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#26

[flagged]

Ha! The guy who wrote this is the same guy who invented ~~APL~~ a number of APL inspired languages (Edit: He did not invent APL. Thanks for the corrections!), so I suspect he may just be built different. https://www.jsoftware.com/ioj/iojATW.htm Have you seen anything written in K itself? Here's a program to calculate primes: 2_&{&/x!/:2_!x}'!R

I'm sure ATW knows a lot of APL, but APL itself was created by Ken Iverson when ATW was just a small child. https://en.wikipedia.org/wiki/Kenneth_E._Iverson

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#29

The K language seems to be limited to CPU only. Yes, it can call out to GPU ( https://code.kx.com/q/interfaces/gpus/ ) but K only runs on the CPU. This strikes me as odd for an array language.

shakti has GPU support now, i believe.

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#30

This looks like a cult I would happily dive into. Does anyone care to ELI5? I tried to read the code but did not understand a single line

One of us.. one of us..

But seriously, if you haven’t given it a try you should. You won’t be disappointed.

Post reply on HN