K

From APL Wiki
Jump to navigation Jump to search

K denotes a family of programming languages designed by Arthur Whitney, which is sold by Kx Systems and Shakti and also supported by several independent implementations. K is an ASCII-only language influenced by Whitney's previous APL design A+. It has fewer primitives in part because it represents arrays as nested lists, unifying rank and depth, and encourages Scheme-like functional programming with first-class functions. Whitney presented the first K implementation (K0) in 1992, and soon founded Kx Systems to develop it further with versions numbering K1 through K6. K4 is now the implementation language for the time-series database kdb+ as well as derivative language Q. Whitney has developed further versions of K at Shakti, beginning with K7. Notable non-commercial implementations include Kona based on K3, and ngn/k and oK based on K6.

Releases

See The Evolution of Database Software.

Year Version
1992 K0
1994 K1
1996 K2
2000 K4
unreleased K5
unreleased K6
2018 K7 (Shakti)
doesn't exist K8
2020 K9 (Shakti)

Primitives

K3

From the Kona Wiki.

Verb Monadic Dyadic Triadic Tetradic
+ flip (Transpose) plus
- negate minus
* first times
% reciprocal divide
| reverse max|or
& where min|and
^ shape power
! enumerate (includes Iota) rotate|mod
< grade up less than
> grade down greater than
= group equals
~ not, attribute match
@ atom at index amend/trap amend
? range (Unique) function inverse/find/draw/deal/sample invert-guess
_ floor drop|cut
, enlist (like Enclose) join
# count take|reshape
$ format dollar (conversions)
. make/unmake dictionary dot index amend/trap amend
: colon assignment
Adverb Definition
/ over (includes Reduce and Power)
\ scan
' each
/: each right
\: each left
': eachpair (like Windowed Reduce)

The name K

K's single-letter name parallels J, and Arthur Whitney had offered design input on J shortly before publishing K. Unlike J, K is often written k, without capitalization. Whitney has given various explanations of the choice of letter,[1] including "keys to the kingdom".[2]

External links

References

  1. Arthur Whitney. Re: Why call it K? response 1, response 2.
  2. Arthur Whitney. "K". Vector Journal volume 10 issue 1.
APL dialects [edit]
Maintained APL+WinAPL2APL64APL\ivApletteAprilCo-dfnsDyalog APLDyalog APL Visiondzaima/APLGNU APLKapNARS2000Pometo
Historical A Programming LanguageA+ (A) ∙ APL#APL2CAPL\360APL/700APL\1130APL\3000APL.68000APL*PLUSAPL.jlAPL.SVAPLXExtended Dyalog APLIverson notationIVSYS/7090NARSngn/aplopenAPLOperators and FunctionsPATRowanSAXSHARP APLRationalized APLVisualAPL (APLNext) ∙ VS APLYork APL
Derivatives AHPLBQNCoSyELIGleeIIvyJJellyK (Goal, Klong, Q) ∙ KamilaLispLang5LilNialRADUiua
Overviews Comparison of APL dialectsTimeline of array languagesTimeline of influential array languagesFamily tree of array languages