K: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
No edit summary
(9 intermediate revisions by 4 users not shown)
Line 8: Line 8:
| file ext                = .k
| file ext                = .k
| developer                = [[Arthur Whitney]]
| developer                = [[Arthur Whitney]]
| latest release version  = K7 "Shakti" / 2019
| latest release version  = K9 "Shakti" / 2020
| implementation language  = [[wikipedia:C_(programming_language)|C]], [http://kparc.com/b/ B]
| implementation language  = [[wikipedia:C_(programming_language)|C]], [http://kparc.com/b/ B]
| platforms                = macOS, Linux, Windows, kOS
| platforms                = macOS, Linux, Windows, [[kOS]]
| license                  = Free for personal use / Proprietary commercial software (free open source implementations exist)
| license                  = Free for personal use / Proprietary commercial software (free open source implementations exist)
| website                  = [https://kx.com/ Kx Systems], [https://shakti.com/ Shakti]
| website                  = [https://kx.com/ Kx Systems], [https://shakti.com/ Shakti]
| documentation            = [http://kparc.com/k.txt K4] [https://kparc.github.io/ref/ K7]
| documentation            = [http://kparc.com/k.txt K4] [https://kparc.github.io/ref/ K9]
| download                = [https://kx.com/connect-with-us/download/ K4], [https://shakti.com/download/ K7]
| download                = [https://kx.com/connect-with-us/download/ K4], [https://shakti.com/download/ K9]
| influenced by            = [[A+]], [[J]], [[wikipedia:Scheme_(programming_language)|Scheme]]
| influenced by            = [[A+]], [[J]], [[wikipedia:Scheme_(programming_language)|Scheme]]
| influenced              = [[Q]], [[RAD]], [[Kona]], [[Klong]], [[oK]], [[ngn/k]]
| influenced              = [[Q]], [[RAD]], [[Kona]], [[Klong]], [[oK]], [[ngn/k]]
| run online              = [https://kparc.io/kc K7]
| run online              = [https://kparc.io/kc K7]
}}
}}
'''K''' denotes a family of programming languages designed by [[Arthur Whitney]] and commercialized by Morgan Stanley, Kx Systems, and Shakti. In 1985, while at Morgan Stanley, Whitney created the statically typed A dialect of APL. His colleagues extended A into [[A+]] in 1988. Finally, Whitney presented the first K implementation in 1992, a "reduced instruction set" dialect which only used ASCII [[glyph|glyphs]] and limited arrays to [[list model|(nested) vectors]]. For a long time, K's main role was as implementation language for [[Q]], the query language of kdb+, which is an in-memory, column-based database. K7 ("Shakti K") is the first K to have full Unicode support, and it also uses a limited set non-ASCII symbols in the core language, for example <source lang=apl inline>Ø</source> and <source lang=apl inline>∞</source>.
'''K''' denotes a family of programming languages designed by [[Arthur Whitney]] and commercialized by Morgan Stanley, Kx Systems, and Shakti. In 1985, while at Morgan Stanley, Whitney created the statically typed A dialect of APL. His colleagues extended A into [[A+]] in 1988. Finally, Whitney presented the first K implementation in 1992, a "reduced instruction set" dialect which only used ASCII [[glyph|glyphs]] and limited arrays to [[list model|(nested) vectors]]. For a long time, K's main role was as implementation language for [[Q]], the query language of kdb+, which is an in-memory, column-based database. K7 (the first "Shakti K") was the first K to have full Unicode support, and it also uses a limited set non-ASCII glyphs in the core language, for example <source lang=apl inline>Ø</source> and <source lang=apl inline>∞</source>, however non-ASCII glyphs were removed in the subsequent K9.


== Releases ==
== Releases ==
Line 41: Line 41:
|-
|-
| 2018      || K7 (Shakti)
| 2018      || K7 (Shakti)
|-
| unreleased || K8
|-
| 2020      || K9 (Shakti)
|}
|}


Line 52: Line 56:
! Verb                            !! Monadic                          !! Dyadic                                !! Triadic          !! Tetradic
! Verb                            !! Monadic                          !! Dyadic                                !! Triadic          !! Tetradic
|-
|-
| <source lang=k inline>+</source> || flip ([[Transpose]])            || [[plus]]                              ||                  ||
| <code>+</code> || flip ([[Transpose]])            || [[plus]]                              ||                  ||
|-
|-
| <source lang=k inline>-</source> || [[negate]]                      || [[minus]]                              ||                  ||
| <code>-</code> || [[negate]]                      || [[minus]]                              ||                  ||
|-
|-
| <source lang=k inline>*</source> || [[first]]                        || [[times]]                              ||                  ||
| <code>*</code> || [[first]]                        || [[times]]                              ||                  ||
|-
|-
| <source lang=k inline>%</source> || [[reciprocal]]                  || [[divide]]                            ||                  ||
| <code>%</code> || [[reciprocal]]                  || [[divide]]                            ||                  ||
|-
|-
| <source lang=k inline>|</source> || [[reverse]]                      || [[max]]|[[or]]                        ||                  ||
| <code><nowiki>|</nowiki></code> || [[reverse]]                      || [[max]]|[[or]]                        ||                  ||
|-
|-
| <source lang=k inline>&</source> || [[where]]                        || [[min]]|[[and]]                        ||                  ||
| <code>&</code> || [[where]]                        || [[min]]|[[and]]                        ||                  ||
|-
|-
| <source lang=k inline>^</source> || [[shape]]                        || [[power]]                              ||                  ||
| <code>^</code> || [[shape]]                        || [[power]]                              ||                  ||
|-
|-
| <source lang=k inline>!</source> || enumerate (includes [[Iota]])    || [[rotate]]|[[mod]]                    ||                  ||
| <code>!</code> || enumerate (includes [[Iota]])    || [[rotate]]|[[mod]]                    ||                  ||
|-
|-
| <source lang=k inline><</source> || [[grade up]]                    || [[less than]]                          ||                  ||
| <code><</code> || [[grade up]]                    || [[less than]]                          ||                  ||
|-
|-
| <source lang=k inline>></source> || [[grade down]]                  || [[greater than]]                      ||                  ||
| <code>></code> || [[grade down]]                  || [[greater than]]                      ||                  ||
|-
|-
| <source lang=k inline>=</source> || [[group]]                        || [[equals]]                            ||                  ||
| <code>=</code> || [[group]]                        || [[equals]]                            ||                  ||
|-
|-
| <source lang=k inline>~</source> || [[not]], attribute              || [[match]]                              ||                  ||
| <code>~</code> || [[not]], attribute              || [[match]]                              ||                  ||
|-
|-
| <source lang=k inline>@</source> || [[atom]]                        || [[Index function|at index]]            ||  [[amend]]/trap  ||  [[amend]]
| <code>@</code> || [[atom]]                        || [[Index function|at index]]            ||  [[amend]]/trap  ||  [[amend]]
|-
|-
| <source lang=k inline>?</source> || range ([[Unique]])              || function inverse/find/draw/deal/sample ||  invert-guess    ||
| <code>?</code> || range ([[Unique]])              || function inverse/find/draw/deal/sample ||  invert-guess    ||
|-
|-
| <source lang=k inline>_</source> || [[floor]]                        || [[drop]]|[[Cut (K)|cut]]              ||                  ||
| <code>_</code> || [[floor]]                        || [[drop]]|[[Cut (K)|cut]]              ||                  ||
|-
|-
| <source lang=k inline>,</source> || enlist (like [[Enclose]])        || [[Catenate|join]]                      ||                  ||
| <code>,</code> || enlist (like [[Enclose]])        || [[Catenate|join]]                      ||                  ||
|-
|-
| <source lang=k inline>#</source> || [[count]]                        || [[take]]|[[reshape]]                  ||                  ||
| <code>#</code> || [[count]]                        || [[take]]|[[reshape]]                  ||                  ||
|-
|-
| <source lang=k inline>$</source> || [[format]]                      || dollar (conversions)                  ||                  ||
| <code>$</code> || [[format]]                      || dollar (conversions)                  ||                  ||
|-
|-
| <source lang=k inline>.</source> || make/unmake dictionary          || dot index                              ||  [[amend]]/trap  ||  [[amend]]
| <code>.</code> || make/unmake dictionary          || dot index                              ||  [[amend]]/trap  ||  [[amend]]
|-
|-
| <source lang=k inline>:</source> || colon                            || [[assignment]]                        ||                  ||
| <code>:</code> || colon                            || [[assignment]]                        ||                  ||
|}
|}


Line 96: Line 100:
! Adverb                            !! Definition
! Adverb                            !! Definition
|-
|-
| <source lang=k inline>/</source>  || over (incudes [[Reduce]] and [[Power operator|Power]])
| <code>/</code>  || over (includes [[Reduce]] and [[Power operator|Power]])
|-
|-
| <source lang=k inline>\</source>  || [[scan]]
| <code>\</code>  || [[scan]]
|-
|-
| <source lang=k inline>'</source>  || [[each]]
| <code>'</code>  || [[each]]
|-
|-
| <source lang=k inline>/:</source> || each right
| <code>/:</code> || each right
|-
|-
| <source lang=k inline>\:</source> || each left
| <code>\:</code> || each left
|-
|-
| <source lang=k inline>':</source> || eachpair (like [[Windowed Reduce]])
| <code>':</code> || eachpair (like [[Windowed Reduce]])
|}
|}


{{APL dialects}}
==External links==
* [https://ngn.bitbucket.io/k.html Overview of K implementations]
{{APL dialects}}[[Category:K dialects]]

Revision as of 09:39, 19 June 2020

K denotes a family of programming languages designed by Arthur Whitney and commercialized by Morgan Stanley, Kx Systems, and Shakti. In 1985, while at Morgan Stanley, Whitney created the statically typed A dialect of APL. His colleagues extended A into A+ in 1988. Finally, Whitney presented the first K implementation in 1992, a "reduced instruction set" dialect which only used ASCII glyphs and limited arrays to (nested) vectors. For a long time, K's main role was as implementation language for Q, the query language of kdb+, which is an in-memory, column-based database. K7 (the first "Shakti K") was the first K to have full Unicode support, and it also uses a limited set non-ASCII glyphs in the core language, for example Ø and , however non-ASCII glyphs were removed in the subsequent K9.

Releases

See The Evolution of Database Software.

Year Version
1992 K0
1994 K1
1996 K2
2000 K4
unreleased K5
unreleased K6
2018 K7 (Shakti)
unreleased 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)

External links

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