
K (2005) - lelf
http://archive.vector.org.uk/art10010830
======
snicker7
I work in the financial industry and code in K3 (among a number of other
languages).

Things I like: highly orthogonal & minimalistic design (basically vectors and
functions acting on vectors), easy C FFI, well documented, satisfying to
minify production code, my inflated salary (+job security for some).

Things I dislike: proprietary, impossible to skim, APL/J/K "culture", over-
marketed, functions/operators overloaded in very unintuitive ways, lack of
lexical scoping, interpreted languages falling out of vogue.

Overall, I recommend every coder to try K (or J or APL) at least once. They
compare favorably to NumPy/R in many respects.

~~~
kick
k3; 1010data? If so, I'm really curious: has the k3 fork you guys have
bifurcated far enough that it no longer resembles k3? It makes me really
curious, because substantially modified k doesn't really seem like k much at
all anymore.

 _Things I dislike: [...] APL /J/K "culture",_

Ow. It cuts like a knife. Right in the heart! Is it the silly jokes? The bad
memes in almost every presentation? That we think our approach is better than
everyone else's because it produces better code, faster? That we like math?

~~~
ttvecthrowaway
1010er here. I don't think Arthur would have trusted us with a fork if that
was even a remote possibility. I find it true to the design and aesthetic of
k3--you'd never notice if you didn't use the new features and they seem quite
natural.

~~~
kick
Thank you so much for answering! That's fascinating! I hope that at some point
someone expands on what features have been added.

------
jim-jim-jim
I've been seeing K mentioned a lot around here recently. Fostering interest in
any array language is a good thing imo, but I'm curious about what draws
people to K over J in particular. They're both ASCII based with APL heritage,
but afaik J is free software and K isn't.

~~~
jnordwick
Performance, KDB+, simplicity.

I've heard it said that J is for people with brains too big for K. J can be
difficult with its hooks, forks, trains, and other complex function
application constructs.

Job prospects too. K is heavily used in the financial sector (even YC has
postings for K jobs in its monthly listings) and pays extremely well for what
is basically a database developer.

~~~
jim-jim-jim
Thanks for the info. I think J's implicit combinators have made me a better
tacit programmer, but over reliance on them can make things frustratingly
ambiguous.

The monadic/dyadic overloading in all these langs doesn't always help either.
I recall somebody here recently writing a K implementation where there was
explicit syntax for the uh... adicity(?) of operators, but I forgot to
bookmark it. Anybody know what I'm talking about?

~~~
uryga
k (well, some version of it) has something along those lines:

> _[the] `:` in `|:` is used to force the verb `|` to be interpreted as a
> monad, as by default ambiguities are resolved in favour of dyads._

[http://www.math.bas.bg/bantchev/place/k.html](http://www.math.bas.bg/bantchev/place/k.html)

------
dlevine
We used K/KDB at my first job out of college. One one hand, it was fast and
terse.

The downside was that the code was nearly impossible to read by anyone but the
original author, and for some reason they encouraged one-letter variables.
This actually propagated to the rest of the code base (com.a.x).

~~~
kick
Single letter variables are actually a feature, not a bug. (I think you'll be
able to find some passionate defenses of it if you use HN search, better than
I can do certainly.)

------
rpz
I've noticed the term "low code" being mentioned more often lately, but never
in relation to array programming languages. In my opinion languages like k, q,
apl and j are the most flexible and expressive low code programming platforms
on the market.

------
chrispsn
FWIW, this is from 1993, not 2005.
[http://archive.vector.org.uk/10](http://archive.vector.org.uk/10)

------
jnordwick
> K stands for “keys to the kingdom”.

Lol. It's actually just the letter after J, since K was supposed to be the
next in the APL-ish family.

~~~
rpz
Arthur wrote the article :)

~~~
jnordwick
Ha, I didn't notice that. But I've heard it before on the K list. I think it
is more of a backronym than a serious statement. This is a guy who names his
source files a.c, b.c, c.c, ..., z.c.

I'm unsure why Ken Iverson named the J language that though.

~~~
earenndil
Probably because A through I were already taken.

------
bollu
I wrote a post on learning the prototype J interpreter that was written by
Arthur Whitney: [http://bollu.github.io/#incunabulum-for-the-21st-century-
mak...](http://bollu.github.io/#incunabulum-for-the-21st-century-making-the-j-
interpreter-compile-in-2020)

It's an enjoyable codebase to stare at and figure out

------
dmitriz
> v: 3 4 /a vector, i.e. a list of 2 atoms.

> v+'v /v plus EACH v, i.e. (3+3;4+4).

> 6 8

How is for EACH working here? Adding v (a 2-vector) to each element gives a
2-vector, so why isn't the result a 2-vector of 2-vectors?

~~~
chrispsn
It applies element-wise across both arrays. What you're describing is more
like an each-right (+/:) or each-left (+\:).

    
    
        2019-09-25 14:44:44 2core 3gb avx2 © shakti l test
         v:3 4
         v+v
        6 8
         v+'v
        6 8
         +'[v;v]
        6 8
         v+/:v
        6 7
        7 8
        
         +/:[v;v]
        6 7
        7 8

~~~
dmitriz
Indeed, that was my confusion, thanks!

------
anonu
Interested to see what happens with Shakti, the newer iteration of Kdb

~~~
7thaccount
I wish their site said more.

~~~
kick
Are you on the mailing list? It's a bit slow, but seriously cool to see random
people bring up strange bugs and Arthur going "thanks! fixed in the next
release." over and over again like clockwork.

~~~
7thaccount
No, but I might add myself.

Speaking of fast bug fixes. 8th is a commercial Forth-like language for
embedded, desktop, server, and iOS/Android that is kind of like that. It is
basically a small (few MB) binary that is a full REPL that can cross-compile
your code into an encrypted binary. It has nice GUI, SQL, Rest,
REPL,JSON/CSV/XML...etc support all built-in as well as a bunch of other
goodies. Releases happen very regularly and reported bugs are fixed incredibly
fast. There is a forum with a lot of activity from the fairly small user base.
Probably not everyone's cup of tea, but I've had a blast playing with the free
version. The professional version is like $250 and after your free upgrades
wear out you can then upgrade for a reduced cost. Full source is also
available in the Enterprise edition with an NDA. In some ways it has some
similarities with K.

Long story short to see hundreds of posts requesting some obscure feature of
edge condition and seeing a reply a few hours later with "fixed". It seems to
be a pretty mature language for one person to build. I have not bought a
professional edition yet as I'm having fun with the free one and this is
probably not something big corporate IT would like. If I start building enough
tools at home, I might go in that direction. Also, no affiliation with the
project, they just seem to get a lot of my wish list right. I really wish it
was a free/open source project as I bet it would catch on more.

~~~
kick
Yeah, I've heard of 8th! Absolutely sucks that it's proprietary, it's
seriously cool. It's one of my favorite examples of how single-man dev "teams"
are the most efficient.

~~~
7thaccount
Yeah, you get some advantages with a large language, but there is no coherant
harmonizing force even with a BDFL like in Perl and Python.

Arthur's work is seriously impressive and something to motivate me to write my
own tools.

------
Koshkin
You can pry C from my cold, dead hands.

~~~
kick
No one's asking you to get rid of C; Arthur (the guy who wrote this article)
actually wrote his own C compiler a few years ago!

Ever-elegant, it does away with precedence, which makes for much prettier
code.

[http://www.kparc.com/b/](http://www.kparc.com/b/)

~~~
gautamcgoel
Holy shit, this is the craziest C code I've ever seen!

~~~
kick
Is it? I find it quite beautiful. Have you read the ngn/k source?

~~~
gautamcgoel
No I haven't. I'll take a look. When I said the code looked crazy, I didn't
mean to suggest it was bad code. It seems quite dense, I'd really like some
explanation for how it works.

~~~
kick
Courtesy of 'yiyus:

[https://docs.google.com/document/d/1W83ME5JecI2hd5hAUqQ1BVF3...](https://docs.google.com/document/d/1W83ME5JecI2hd5hAUqQ1BVF32wtCel8zxb7WPq-D4f8/edit?usp=sharing)

Also 'tlack's attempt at it:

[https://github.com/tlack/b-decoded](https://github.com/tlack/b-decoded)

