TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

294 pointsby chrispsn12 months ago

43 comments

doug-moen12 months ago
FYI: This only implements a subset of K (I&#x27;d estimate 1&#x2F;3).<p>Calling it a &#x27;release&#x27; is an overstatement. The docs state that it is a work in progress. It&#x27;s also quite buggy (it&#x27;s easy to get a segmentation fault). The version I saw in January was about 1&#x2F;3 the size of this version, and also buggy. I hope that the final version of this code is less buggy and more usable.<p>If you want to learn the K language, don&#x27;t use this version. Any of the other open source K projects are better than this (more complete, less buggy, better documented). This project is good if you want to learn more about the Arthur Whitney C coding style, because it is so small. Other projects written in this style (some open source K implementations, the J language) are huge by comparison.
评论 #40545809 未加载
评论 #40563607 未加载
stefano12 months ago
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&#x2F;month just to do it?<p>I also wonder if the commercial version has anti-benchmark clauses like some database vendors. I&#x27;ve always seen claims that K is much faster than anything else out there, but I&#x27;ve never seen an actual independent benchmark with numbers.<p>Edit: according to <a href="https:&#x2F;&#x2F;mlochbaum.github.io&#x2F;BQN&#x2F;implementation&#x2F;kclaims.html" rel="nofollow">https:&#x2F;&#x2F;mlochbaum.github.io&#x2F;BQN&#x2F;implementation&#x2F;kclaims.html</a>, commercial licenses do indeed come with anti-benchmark clauses, which makes it very hard to take the one in this post at face value.
评论 #40545306 未加载
评论 #40545195 未加载
评论 #40545112 未加载
评论 #40549673 未加载
评论 #40545203 未加载
JonChesterfield12 months ago
Interesting things in here.<p><pre><code> #define _(e) ({e;}) &#x2F;&#x2F;!&lt; isolate expression e in its own lexical scope and clamp it with ; &#x2F;&#x2F;!&lt; note the outer parens, which is a very powerful c trick: they turn _(e) into a so called &#x2F;&#x2F;!&lt; r-value, which basically means we can do x=_(e) for as long as e evaluates to or returns &#x2F;&#x2F;!&lt; at least anything at all, i.e. not void. this macro is fundamental to k&#x2F;simple implementation. </code></pre> I didn&#x27;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.<p>edit:<p>-Wpedantic on gcc will tell me ISO C doesn&#x27;t like the construct but it still compiles it happily.<p>Clang offers -Wgnu-statement-expression-from-macro-expansion<p>So it looks likely that this is the GNU statement expression extension after all and not a part of C. Shame.
评论 #40545307 未加载
评论 #40545163 未加载
评论 #40546661 未加载
dchest12 months ago
Everyone here charges too little for software.<p><pre><code> the free(MIT license) version is shakti.com&#x2F;k&#x2F;k.zip the supported version(supported and 10 to 100 times faster) is $100K per month(minimum) </code></pre> <a href="https:&#x2F;&#x2F;groups.google.com&#x2F;g&#x2F;shaktidb&#x2F;c&#x2F;5SPufca3mo4" rel="nofollow">https:&#x2F;&#x2F;groups.google.com&#x2F;g&#x2F;shaktidb&#x2F;c&#x2F;5SPufca3mo4</a>
评论 #40545408 未加载
评论 #40546040 未加载
评论 #40545327 未加载
freedomben12 months ago
For those who haven&#x27;t heard of or aren&#x27;t familiar with K, the Wikipedia page[1] has a remarkably helpful brief overview:<p>&gt; <i>K is a proprietary array processing programming language developed by Arthur Whitney and commercialized by Kx Systems. The language serves as the foundation for kdb+, an in-memory, column-based database, and other related financial products. The language, originally developed in 1993, is a variant of APL and contains elements of Scheme. Advocates of the language emphasize its speed, facility in handling arrays, and expressive syntax.</i><p>There was also a great thread on HN about it as well[2].<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;K_(programming_language)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;K_(programming_language)</a><p>[2] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28493283">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28493283</a>
评论 #40546763 未加载
hakanderyal12 months ago
For people not accustomed to the style of Whitney, you can read various HN threads from the past to learn more about why he writes programs the way he does.<p>It’s deliberate and powerful.<p>Here is a recent one: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39026551">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39026551</a><p>There was an epic post some years ago but couldn’t find it now from my phone.
omnicognate12 months ago
I&#x27;m going to have to take another run at learning this corner of computing soon, but it&#x27;s a prospect I&#x27;m not relishing. Everything about it rubs me up the wrong way.<p>If you&#x27;d like an antidote, have a read of Gerald Jay Sussman&#x27;s books, where you&#x27;ll see profound concepts from maths and physics captured in succinct and expressive (as opposed to merely terse) code, accompanied by eloquent explanations devoid of boasts or name dropping and provided free of charge online. That will change the way you think about computing too, but it will be a more pleasant experience.
评论 #40545984 未加载
frankjr12 months ago
The code looks heavily obfuscated. It&#x27;s more like &quot;source available&quot; than open source. E.g.<p><pre><code> g(_M,W-=1&lt;&lt;f;xx=M[f];M[f]=x)Ui(M_,Ux=M[i];x?(W+=1&lt;&lt;i,M[i]=xx,x):30&gt;i?_M(i,M_(i+1))+(2*n0&lt;&lt;i):OO())f(_r,pt?x:65535&amp;rx?(--rx,x):e(if(!Tx)n(_r(xU))_M(mx,x-n0);x))f(r_,pt?x:65535&amp;++rx?x:OO()) </code></pre> Edit: Looking at it a bit more, I can&#x27;t tell if the code is obfuscated or if the author really wrote it like this...
评论 #40544526 未加载
评论 #40544512 未加载
评论 #40544499 未加载
评论 #40544505 未加载
评论 #40544524 未加载
defrost12 months ago
K by Arthur Whitney: <a href="http:&#x2F;&#x2F;archive.vector.org.uk&#x2F;art10010830" rel="nofollow">http:&#x2F;&#x2F;archive.vector.org.uk&#x2F;art10010830</a><p><i>vector</i> the journal of the British APL Association
评论 #40546770 未加载
rwillink12 months ago
He showed K @ Royal Society &amp; bunch of apl &amp; 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..
评论 #40544646 未加载
评论 #40548557 未加载
评论 #40544654 未加载
评论 #40549521 未加载
评论 #40546798 未加载
评论 #40544974 未加载
eigenvalue12 months ago
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.
评论 #40545086 未加载
评论 #40545003 未加载
评论 #40544756 未加载
mlochbaum12 months ago
Functionality is, at this time, extremely limited (and the first kfun was out in January so I don&#x27;t think there&#x27;s really any intention to get this to usability on a short timeframe). No support for paired syntax like parentheses, functions in braces, and square brackets for indexing and function calls. No stranding or tacit functions. I doubt it&#x27;s Turing complete. Many primitives are unimplemented and others are flaky: for instance calling count (#) on an atom can give an arbitrary number, print garbage, segfault, or allocate memory until it&#x27;s killed. But it&#x27;s got vector instruction support.<p>If you&#x27;re looking for a practical k implementation, I recommend ngn&#x2F;k, and several other implementations are listed at <a href="https:&#x2F;&#x2F;k.miraheze.org&#x2F;wiki&#x2F;Running_K" rel="nofollow">https:&#x2F;&#x2F;k.miraheze.org&#x2F;wiki&#x2F;Running_K</a> .
NKosmatos12 months ago
He might be a smart person, with a very high IQ and on a different level than the rest of us, but by writing with this style, with no comments, with no proper capitalization&#x2F;style and with this attitude, he’s putting me off (IMHO).<p>Oftentimes, the way something is presented and how the language is used, might be as important as the thing itself ;-)
评论 #40548982 未加载
评论 #40545360 未加载
评论 #40545387 未加载
nickpeterson12 months ago
Well I know what the next episode of the arraycast is going to talk about now.
评论 #40544818 未加载
xelxebar12 months ago
Just packaged it up on my private Guix channel. Here&#x27;s the package def (along with the one for ngn&#x2F;k as well) if anyone&#x27;s interested: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;xelxebar&#x2F;c37ab9285b297fed3e9e0f9ce781db9b" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;xelxebar&#x2F;c37ab9285b297fed3e9e0f9ce78...</a>
andrepd12 months ago
This reads like the incomprehensible ramblings of a mentally ill patient scribbling in the walls. There is zero context, zero explanation. Very vague or incomplete statements scattered all over the place. I don&#x27;t understand what someone not already familiar with the project is supposed to take away from this.<p>Is the terseness of the site mean to reproduce the terseness of the language? Is that the gimmick?
评论 #40545022 未加载
mrob12 months ago
Is there some application that demonstrates the utility of this language?<p>E.g. it&#x27;s tempting to dismiss Haskell as something invented by mathematicians more concerned with the elegance of their abstractions than actually getting things done, but Pandoc is so undeniably good and useful that you&#x27;re forced to admit Haskell can be a good choice. What&#x27;s the Pandoc of K?
评论 #40545374 未加载
评论 #40546665 未加载
评论 #40548924 未加载
nivertech12 months ago
Is this line in <i>a.c</i> enough for MIT license?<p><pre><code> &#x2F;&#x2F;k(c)2024 arthur whitney(l)MIT</code></pre>
评论 #40544740 未加载
KRAKRISMOTT12 months ago
This is probably his last attempt at leaving a legacy given his age. I wonder if Wolfram would do something similar.
评论 #40544825 未加载
victorbjorklund12 months ago
Can someone explain how it can be &quot;faster&quot; than anything else?
评论 #40544837 未加载
评论 #40544832 未加载
doug-moen12 months ago
Since this was posted, the source code was changed, and a makefile was added.<p>The new version requires ARM 64 or Intel 64 with AVX2. It requires clang-13 (clang-14 and later won&#x27;t work). Gcc doesn&#x27;t work.<p>With clang-14, I got build errors. First error: .&#x2F;a.h:38:30: error: use of unknown builtin ‘__builtin_ia32_pminub256’ [-Wimplicit-function-declaration]<p>Seems to be related to this LLVM change which removed the above builtin: <a href="https:&#x2F;&#x2F;reviews.llvm.org&#x2F;D117798" rel="nofollow">https:&#x2F;&#x2F;reviews.llvm.org&#x2F;D117798</a><p>When I replaced __builtin_ia32_pminub256 with __builtin_elementwise_min and ditto for max, then it compiles and apparently works.
klibertp12 months ago
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!
评论 #40546809 未加载
评论 #40544713 未加载
1vuio0pswjnm712 months ago
Other than ngn&#x2F;k ...<p><a href="https:&#x2F;&#x2F;ktye.github.io&#x2F;kdoc.htm" rel="nofollow">https:&#x2F;&#x2F;ktye.github.io&#x2F;kdoc.htm</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;ktye&#x2F;i&#x2F;releases&#x2F;download&#x2F;latest&#x2F;k.c">https:&#x2F;&#x2F;github.com&#x2F;ktye&#x2F;i&#x2F;releases&#x2F;download&#x2F;latest&#x2F;k.c</a><p>IIRC, some old UNIX versions had an APL interpeter in the userland. For me, a k interpreter could be the ultimate UNIX utility. But interoperability with pipes and other UNIX utilities is awkward to say the least, as is having to use other programming languages as duct tape.
i_don_t_know12 months ago
The link to the archive ‘k.zip’ has moved to <a href="https:&#x2F;&#x2F;shakti.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;shakti.com&#x2F;</a> with terse documentation in the ‘education’ section.
评论 #40550020 未加载
dlkf12 months ago
Does the page 404 for anyone else? Is this a Europe thing?
lenkite12 months ago
<a href="https:&#x2F;&#x2F;shakti.com&#x2F;k&#x2F;k.zip" rel="nofollow">https:&#x2F;&#x2F;shakti.com&#x2F;k&#x2F;k.zip</a> gives 404 not found
评论 #40551696 未加载
PeterZaitsev12 months ago
Some big claims, but I wonder if there are some published repeatable benchmarks<p>Also when someone claims 1000x better Performance I want to know why. For example MySQL or PostgreSQL -&gt; Clickhouse I can clearly attribute to column store, compression, vectorization, parallel execution on multiple CPU cores and machines...
评论 #40546992 未加载
delta_p_delta_x12 months ago
The website, the comments in this thread, and the various C snippets shared here all make me feel very stupid.
评论 #40549456 未加载
vmsp12 months ago
I think the link for k.zip was just removed.<p>EDIT: shakti.com&#x2F;k&#x2F;k.zip is now returning 404.
评论 #40545754 未加载
hardlianotion12 months ago
That&#x27;s ... er ... cryptic.
评论 #40544595 未加载
koolala12 months ago
Coukd this run in Wasm on OPFS - like how SQlite got official support for OPFS?
tosh12 months ago
How does it compare to the k that you can license from shakti or to ngn&#x2F;k?
评论 #40549477 未加载
评论 #40544835 未加载
djoldman12 months ago
Eat your heart out:<p><a href="https:&#x2F;&#x2F;codeberg.org&#x2F;ngn&#x2F;k&#x2F;src&#x2F;branch&#x2F;master&#x2F;0.c" rel="nofollow">https:&#x2F;&#x2F;codeberg.org&#x2F;ngn&#x2F;k&#x2F;src&#x2F;branch&#x2F;master&#x2F;0.c</a>
tetris1112 months ago
Clicking through the page, I&#x27;m still not quite sure what I&#x27;m seeing.
评论 #40544466 未加载
评论 #40544469 未加载
carlsborg12 months ago
If you ask ChatGPT to reply in the style of Arthur Whitney, you get amazingly concise summaries. Like a language verion of this code. I use that prompt often.
cristaloleg12 months ago
New link <a href="https:&#x2F;&#x2F;shakti.com&#x2F;k.zip" rel="nofollow">https:&#x2F;&#x2F;shakti.com&#x2F;k.zip</a>
vadiml12 months ago
Apl always was kind of write only language. But now you probly can paste all code in chat gpt and it will explain it
secwang12 months ago
How to compile these codes under clang15?
cies12 months ago
Not very informative homepage... A lang+db? Fast on one machine? Or does it distribute?
评论 #40544507 未加载
dpflan12 months ago
“for: hedgefunds banks manufacturers formula1 ..”
hiAndrewQuinn12 months ago
... Ah, so this is regexes but for math. Got it.
secondary_op12 months ago
And I though that Skala, FP (monad in X is just a monoid in the category of endofunctors of X) people are pretentious sect, this is so much worse, given their customer base, I immediately presume that this is nothing more than approach to deliberately make things unintelligible for as many people as possible, so that your white collar hedge fund guy would have heart stroke just by glancing at this source code, not even trying to read or understand it, that is one way to treat people and make business, it is despicable. Industry needs to formalise this into well known phenomena much like Security through obscurity [1] so that kind hearted pragmatic people avoid this like a plague.<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Security_through_obscurity" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Security_through_obscurity</a>
评论 #40549508 未加载
评论 #40545432 未加载
PufPufPuf12 months ago
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?
评论 #40545176 未加载
评论 #40544853 未加载
评论 #40545452 未加载
评论 #40544805 未加载