Hacker News new | past | comments | ask | show | jobs | submit login

kOS! Some of the people who helped work on that hang around news.YC!

There's some pretty interesting stuff on it. The Impending kOS paper has probably introduced more people to APL and k than just about anything at this point.

http://archive.vector.org.uk/art10501320




It was directly the reason I wrote oK. I wasn't satisfied with learning k4 when I knew that somewhere out there Arthur was tinkering with k5, and the only way to have it was to build it...


What are the big advancements between the major K versions?


K1 was never available outside of Morgan Stanley AFAIK, and I’ve never seen any docs of it. So ...

APL -> A+ : opinionated (vector indices always start at 0, for example) and “electric” GUI (deserves a whole post to describe)

A+ -> K2 : significantly simplified - only ascii, no multidimensional arrays (uses nested vectors instead), much smaller vocabulary but just as effective in the basics department (e.g. the Whitney where/replicate monastic operator replaces 6 or 7 APL operators), added simple dictionaries, workspaces, dropped a lot of math from language. Simpler electric GUI. Time and date native types (as floating point)

K2 -> K3 mostly dropped GUI afaik. Added integral time and date.

k3 -> K4/kdb+: simplifies language more, comprehensive dictionary, TSDB rolled deeply into language (was previously a product written in K), native 64 bit support.

K4->K6: still more simplification, I think k6 is the kOS language. Never left dev state.

K6->k7->k9: continuous simplification, now at shakti rather than kx/firstderivatives - and with much more community involvement.


I'm curious about the Whitney where/replicate monastic operator, and how it replaces 6 or 7 APL operators. My Google-fu was not up to the task.


“Replaces” in the sense that you would use it instead, and not feel like you are missing something, not in the sense that it is equivalent char-per-char.

APL has a few expand/compress operators that take a boolean vector; all of these in K use monadic & (where/replicate), either on the at-index e.g. +/a[&x>3] which is read “sum over a where x is greater than 3”, or at the amend-index, e.g. @[&7 9 15;i:&x>3;:;7-x@|i] which is read “in a vector with seven 0s, followed by nine 1s and fifteen 2s, in the indices where x is greater than 3 (call those indices i), place 7 minus those values from the same indices in reverse order.

Obviously contrived examples, but in APL you’d have to compress/expand a couple of times instead. (Sorry, don’t remember the operator names, my APL is rusty, last wrote a real program in 1992....)


NARS2000, Dyalog APL, and dzaima/APL all have the Where function now. See https://aplwiki.com/wiki/Indices.


I'm not familiar with J but it also appears to have something similar. However the resulting code seems a bit more convoluted than the K version. +/ (I. a>3) { a


More idiomatic J might look like this: +/a#~a>3 .


Thanks! Should probably brush up on my APL, as I have last really used APL2 on a mainframe nearly 3 decades ago.

But I have gotten lazy and too comfortable with K.... oh well.


Concise! Thanks.

If I were to explore K today, where do I start and what version would I pick?


Q/KDB+ for something production ready now.

k9 (Shakti) for a simpler product that's in the active language design phase and with not as much integrations - yet.

ngn/k for an actively developed version that's free and targets k6-era (for now).


I had to google "ngn/k" [1]. Interesting project, and also interesting what google returned:

   1 Nigerian naira / Boltzmann constant =
   1.96791577 × 1020 m-2 kg-1 s2 K U.S. dollars

1 - https://bitbucket.org/ngn/k


Does either k9 (Shakti) or ngn/k have built-in timeseries database / qSQL[1], table / keyed table datatypes or something comparable?

--

[1] qSQL is actually a DSL implemented in K on top of kdb functional queries


k9: yes to all.


Does anyone know pricing on k9? Like could a small software shop or bootstrapped business use it?


I'm sure they'd be open to discussing that with you! Try Fintan: f@shakti.com


I see the one letter email is spreading..... I’m actually surprised Arthur can live with such a long and verbose email address - 12 whole letters is almost enough for him to write an music player or something.


Thanks for doing it, I played with your code, and it was inspiring.



There have been a bunch of discussions on it, yeah. It's a fun subject!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: