it's not working
Arthur Whitney is an esteemed computer scientist who led the design on a few well-known pieces of software:
The A, K, and Q programming languages
kdb, a high-performance database built on K used in fintech
Shakti, which is like kdb but faster, designed for trillion-row datasets.
I've never even seen a trillion numbers, much less calculated them, but kdb is apparently a standard tool on Wall Street. They probably care about money, so I'll assume kdb does its job well. His languages take significantly after APL, which was a very popular language for similar applications before the invention of (qwerty) keyboards.
But I'm not here to talk about boring things like "using software to make incomprehensible amounts of money in finance" or "human beings and their careers", I'm here to talk about how a guy writes C code weird. For a very simple version of the programming language K, there's a publicly available interpreter he wrote in a few days using about 50 lines of C to show the basics of interpreter writing. This is the C (specifically the January 16, 2024 version #2):
a.h
typedef char*s,c;s Q=(s)128; #define _(e...) ({e;}) #define x(a,e...) _(s x=a;e) #define $(a,b) if(a)b;else #define i(n,e) {int $n=n;int i=0;for(;i<$n;++i){e;}} #define Q(e) if(Q==(e))return Q; #define Qs(e,s) if(e)return err(__func__,s); #define Qr(e) Qs(e,"rank") #define Qd(e) Qs(e,"domain") #define Qz(e) Qs(e,"nyi") #define _s(f,e,x...) s f(x){return _(e);} #define _i(f,e) _s(f,e,c x) #define f(f,e) _s(f,e,s x) #define F(f,e) _s(f,e,s a,s x) #define ax (256>x) #define ix (c)x #define nx x[-1] #define xi x[i] #define aa x(a,ax) #define ia x(a,ix) #define na x(a,nx) #define oo w("oo
")
... continue reading