Small, Fast, & Simple

May 4, 2015

The K Programming Language

Small
Fast
Simple

One of the most interesting languages I’ve toyed with is K. K is a vector programming language like APL and J and makes several major departures from mainstream languages. It favors terse expressions with short variable names, forcing the programmer to examine the whole expressions rather than the individual pieces. Compared to API and J, K has very few operators. Higher-order operators provide additional functions. K elides common functions like filter and reduce in favor of highly orthogonal and composable operators. For example, filtering a list to even-valued entries is done as follows:

xs[&0=xs!2]