K: Difference between revisions

Jump to navigation Jump to search
3,860 bytes added ,  19:27, 11 December 2019
K3 primitive tables
No edit summary
(K3 primitive tables)
(One intermediate revision by the same user not shown)
Line 20: Line 20:
}}
}}
'''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 Stanly, 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 Stanly, 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>.
== Releases ==
See [https://shakti.com/database-software-history/ The Evolution of Database Software].
{|class=wikitable
! Year      !! Version
|-
| 1992      || K0
|-
| 1994      || K1
|-
| 1996      || K2
|-
| 2000      || K4
|-
| unreleased || K5
|-
| unreleased || K6
|-
| 2018      || K7 (Shakti)
|}
== Primitives ==
=== K3 ===
From the [https://github.com/kevinlawler/kona/wiki#verbs Kona Wiki].
{|class=wikitable
! Verb                            !! Monadic                          !! Dyadic                                !! Triadic          !! Tetradic
|-
| <source lang=k inline>+</source> || flip ([[Transpose]])            || [[plus]]                              ||                  ||
|-
| <source lang=k inline>-</source> || [[negate]]                      || [[minus]]                              ||                  ||
|-
| <source lang=k inline>*</source> || [[first]]                        || [[times]]                              ||                  ||
|-
| <source lang=k inline>%</source> || [[reciprocal]]                  || [[divide]]                            ||                  ||
|-
| <source lang=k inline>|</source> || [[reverse]]                      || [[max]]|[[or]]                        ||                  ||
|-
| <source lang=k inline>&</source> || [[where]]                        || [[min]]|[[and]]                        ||                  ||
|-
| <source lang=k inline>^</source> || [[shape]]                        || [[power]]                              ||                  ||
|-
| <source lang=k inline>!</source> || enumerate (includes [[Iota]])    || [[rotate]]|[[mod]]                    ||                  ||
|-
| <source lang=k inline><</source> || [[grade up]]                    || [[less than]]                          ||                  ||
|-
| <source lang=k inline>></source> || [[grade down]]                  || [[greater than]]                      ||                  ||
|-
| <source lang=k inline>=</source> || [[group]]                        || [[equals]]                            ||                  ||
|-
| <source lang=k inline>~</source> || [[not]], attribute              || [[match]]                              ||                  ||
|-
| <source lang=k inline>@</source> || [[atom]]                        || [[Index function|at index]]            ||  [[amend]]/trap  ||  [[amend]]
|-
| <source lang=k inline>?</source> || range ([[Unique]])              || function inverse/find/draw/deal/sample ||  invert-guess    ||
|-
| <source lang=k inline>_</source> || [[floor]]                        || [[drop]]|[[cut]]                      ||                  ||
|-
| <source lang=k inline>,</source> || enlist (like [[Enclose]])        || join                                  ||                  ||
|-
| <source lang=k inline>#</source> || [[count]]                        || [[take]]|[[reshape]]                  ||                  ||
|-
| <source lang=k inline>$</source> || [[format]]                      || dollar (conversions)                  ||                  ||
|-
| <source lang=k inline>.</source> || make/unmake dictionary          || dot index                              ||  [[amend]]/trap  ||  [[amend]]
|-
| <source lang=k inline>:</source> || colon                            || [[assignment]]                        ||                  ||
|}
{|class=wikitable
! Adverb                            !! Definition
|-
| <source lang=k inline>/</source>  || over (incudes [[Reduce]] and [[Power operator|Power]])
|-
| <source lang=k inline>\</source>  || [[scan]]
|-
| <source lang=k inline>'</source>  || [[each]]
|-
| <source lang=k inline>/:</source> || each right
|-
| <source lang=k inline>\:</source> || each left
|-
| <source lang=k inline>':</source> || eachpair (like [[Windowed Reduce]])
|}


{{APL dialects}}
{{APL dialects}}

Navigation menu