K (programming language)

K is a proprietary array processing programming language developed by Arthur Whitney and commercialized by Kx Systems.

The language serves as the foundation for kdb+, an in-memory, column-based database, and other related financial products.

Advocates of the language emphasize its speed, facility in handling arrays, and expressive syntax.

At the same time he formed Kx Systems to commercialize the product and signed an exclusive contract with Union Bank of Switzerland (UBS).

The languages contain a rich set of primitive functions designed for processing arrays.

In addition, the language contains special operators that combine with primitive functions to perform types of iteration and recursion.

The second core distinction of K is that functions are first-class objects, a concept borrowed from Scheme.

Consequently, the Hello world-program is trivial: The following expression sorts a list of strings by their lengths: The expression is evaluated from right to left as follows: A function to determine if a number is prime can be written as: The function is evaluated from right to left: If x is not prime then one of the values returned by the modulo operation will be 0 and consequently the minimal value of the list.

The function below can be used to list all of the prime numbers between 1 and R with: The expression is evaluated from right to left K is the foundation for a family of financial products.