logoalt Hacker News

hunterpaynetoday at 9:24 AM3 repliesview on HN

https://en.wikipedia.org/wiki/K_(programming_language)

As far as I can tell, it seems to be something halfway between TempleOS and MUMPS but its a programming language instead of an OS. I don't think you are missing some deep meaning. Its more that this is written in an esoteric language which seems to be more overloaded than Perl by someone who maybe isn't so great at clear communications. He's just looking at ways to make more efficient code in K (the language). But it does look sort of like he is talking about math theorems (he isn't).


Replies

thomasmgtoday at 10:15 AM

> more overloaded than Perl by someone who maybe isn't so great at clear communications.

I have the same feeling. The root of K is APL, but to avoid special characters (I assume), the same symbol has multiple meanings (overloaded), depending on eg. the position, the data type, and the context. The idea is that "programs should be short enough to fit in your head." The challenge is, similar to Perl and Regex syntax, it's very hard and often cryptic to read.

I do think a concise syntax is useful, for a programming language. But at the same time, the syntax should be readable, and that probably means that each symbol or operator must only have one meaning, and that meaning should be (more or less) obvious.

K is an array language. Even an integer is actually an array of one element. I think that makes sense for a tiny language: This is the simplest possible type system. You can even support strings, when using eg. metadata or using a heuristic like "a string is always zero terminated" (which is what I used for my tiny language).

show 2 replies
afctoday at 11:41 AM

> by someone who maybe isn't so great at clear communications

I don't think that's fair. If you're familiar with the programming language, his writing is fairly clear. If you're not, maybe you're just not in his target audience.

IOW, optimizing his text for people familiar with the language is probably a better choice than teaching the language, which would distract him from his goal.

actionfromafartoday at 12:18 PM

I think of K like a super-geeky version of Excel, for people who do quant stuff. People do very useful, cryptic stuff in convoluted, bespoke Excel sheets, updated and grown over decades with 37 variants of almost-but-not-quite the same VB function, etc. I imagine the K world is very similar, except K users can meet in London pubs and trade little snippets of K handwritten on scraps of paper between them like Pokemon cards.