A brief introduction to Kont, a new language based on continuations
I've had a request to describe the concatenative programming language I have been working on, Kont. Kont came out of an attempt to design a programming language in which every program was expressed in continuation-passing style. A concatenative language is a language in which programs are formed by the concatenation of smaller primitives, ala Forth. This works well for continuation-passing style programming, because if the language primitives are continuation-passing then any concatenation of them will also be in continuation-passing style.
Kont is a language with two stacks, a data stack and a continuation stack. The data stack is affected by running continuations which have effects on the data stack much like in Forth or Factor. The continuation stack is the current continuation, expressed as a stack. Continuations can be a primitive continuation, which is atomic, a quoted value, or a composed continuation, which is like a cons cell of two continuations. Kont's execution semantics are simple: a continuation is popped off of the continuation stack. If it is a primitive continuation it is executed according to the semantics of that continuation. If it is a quoted value, then that value is pushed on the data stack. If it is a composed continuation, both parts of the composed continuation are pushed on the stack. The first part of that composed continuation will then be executed according to these rules.