Comment by userbinator
5 years ago
Its density is many times higher than most C programs, but that's no big obstacle to understanding if you don't attempt to "skim" it; you need to read it character-by-character from top to bottom. It starts off defining some basic types, C for Character and I for Integer, and then the all-important Array. This is followed by some more shorthand for printf, return, and functions of one and two arguments, all of the array type. The DO macro is used to make iteration more concise.
Then the function definitions begin. ma allocates an array of n integers (this code is hardcoded for a 32-bit system), mv is basically memcpy, tr (Total Rank?) is used to compute the total number of elements, and ga (Get/Generate Array) allocates an array.
This is followed by the definitions of all the primitive operations (interestingly, find is empty), a few more globals, and then the main evaluator body. Lastly, main contains the REPL.
While I don't think this style is suitable for most programmers, it's unfortunate that the industry seems to have gone towards the other extreme.
Btw, this is considered more or less canonical k style. (with q being a slighty more readable version of this)
It takes some time getting used to it, but, once you get the hang of it, going back to e.g. Python/Pandas is painful.