Kvikkalkul

From Wikipedia, the free encyclopedia

Kvikkalkul is an esoteric programming language ostensibly developed by the Swedish Navy in the 1950s and used on the SABINA computer. It came to fame in 1994 when someone made an anonymous post to USENET regarding it. Kvikkalkul's origins are probably not as claimed, but instead it was likely invented as a joke, like INTERCAL. Unlike INTERCAL, it is not overtly humorous, and contains nothing terribly silly.[citation needed]

Kvikkalkul was allegedly developed on Baudot code systems, and used only the "figures" mode, so the only characters in Kvikkalkul source are whitespace, digits, and a handful of punctuation characters. However, not even all of the punctuation characters available in "figures" mode is used, most notably the addition sign remains unused. The complete absence of letters is touted as a virtue because it makes it impossible to have misleading comments and object names. Without these crutches, reading a Kvikkalkul program requires one to work out what the program actually does.

The main data type is a fixed-point ones' complement fractional number, originally of 15 bits but more in later implementations. The minimum representable number is a little above −1 (−1 + 2-14 with 15 bits), and the maximum representable number is a little below +1 (+1 − 2-14 with 15 bits). The all-bits-one value represents overflow. This rather strange data type is perfectly workable, in some ways simply the opposite of the more conventional choice of representing only integers. It has some interesting theoretical properties which are discussed in the USENET posts.

The language contains ordinary arithmetic and comparison operators, and unconditional, conditional, and assigned jumps. There is no concept of subroutines, but there are routines at well-known labels and a convention of using a particular register to hold a return address (returning by an assigned jump). It has a built-in concept of I/O streams, and the USENET posts describe the mainframe environment with which they interface. All of this is reasonably normal for a mainframe language of the era, but looks a little surreal when expressed without letters.

A standard function library was described by the USENET posts, including I/O routines and floating point arithmetic. Characters (five-bit Baudot characters, of course) could be stored three to a 15-bit word, but this representation is impossible to handle except by library routines. Floating point data is similarly packed into a word and handled by library. Interestingly, integer arithmetic is also handled as an alien data type by library routines.

Among esoteric programming languages Kvikkalkul is unusual in being neither hopelessly unusable nor very minimal. As a programming language it has two really unusual features (the fixed-point data type and the non-alphabetic syntax). The effects of these two features are explored well in a language fleshed out with otherwise-normal (for its purported era) supporting features.

[edit] External links

Languages