Shen (programming language)

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Shen is a functional programming language developed by Mark Tarver and introduced in September 2011. It is a successor to Qi.

Shen is a Lisp with pattern matching with guards, lambda calculus consistency, macros, optional lazy evaluation, optional static type checking, an integrated fully functional Prolog, and an inbuilt compiler-compiler.

Shen runs under a reduced instruction Lisp and is intended for portability to many platforms.


In his 2009 address "The Next Lisp"[1] to the European Conference on Lisp Mark Tarver addressed himself to the shortcomings of Lisp and of his own work Qi. In regards to the latter, Tarver identified the principal problem as Qi's reliance on Common Lisp as a platform. The solution he suggested was to develop a very small virtual Lisp similar to John McCarthy's Lisp 1.5 into which all Qi source would be compiled. This small Lisp was called Kernel Lisp in his talk and later became called KLambda. This minimised version of Qi would release the spirit of Qi to develop beyond the confines of Common Lisp and for this reason the new release was called Shen (the Chinese for 'spirit').


Shen was released in September 2011 and the specification was changed slightly in the succeeding months. The language stabilised around a version of KLambda that contained 46 primitive functions.[2] The initial response was very positive and within the space of 14 months Shen was ported to CLisp, SBCL, ECL, Scheme, Clojure, JavaScript and Java.

Shen was not simply a clone of Qi however. The language showed significant differences in licensing and design. The license is not GPL-consistent[3] allowing free development and sharing as long as the specification was respected, while choosing not to observe Freedom 1. Shen allowed pattern matching over lists as did Qi, but added pattern-matching over strings and vectors.[4] A significant development in the language was the appearance of a macro system[5] for allowing the user to develop his own notation. A standard library is under development for Shen.


  1. ^ Mark Tarver. "The Next Lisp". Retrieved 2012-12-13. 
  2. ^ Mark Tarver. "Shendoc 8.0". Retrieved 2012-12-13. 
  3. ^ Mark Tarver. "The Shen License". Retrieved 2012-12-13. 
  4. ^ Mark Tarver. "Shen pattern matching". Retrieved 2012-12-13. 
  5. ^ Mark Tarver. "Shen Macros". Retrieved 2012-12-13. 

External links[edit]