Shen

There is now a drive to place Shen under BSD; you can help support for this here.

You do not have to pay any money at this stage. Pledges of at least £1000 receive a link to a site of your choice from this page for 5 years if the appeal is successful. Any sponsor sponsoring the full amount receives this link for life .

We have collected just over £2000 towards the goal of £8500. Help us to the next stage of our project by contributing. To see more of what we are planning, see here.

Pledged on 9th November 2014: £2192.52 - for the current total go to this page..

Shen is a portable functional programming language that offers

  • pattern matching,
  • λ calculus consistency,
  • macros,
  • optional lazy evaluation,
  • static type checking,
  • an integrated fully functional Prolog,
  • and an inbuilt compiler-compiler.

Shen has one of the most powerful type systems within functional programming. Shen runs under a reduced instruction Lisp and is designed for portability. The word ‘Shen’ is Chinese for spirit and our motto reflects our desire to liberate our work to live under many platforms. Shen includes sources and is absolutely free for commercial use. It currently runs under CLisp and SBCL, Clojure, Scheme, Ruby, Python, the JVM and Javascript. The second edition to The Book of Shen is now available here .

(0-) (define super
       [Value Succ End] Action Combine Zero ->
         (if (End Value)
             Zero
             (Combine (Action Value)
                      (super [(Succ Value) Succ End]
                             Action Combine Zero))))
@{super}@

(1-) (define for
       Stream Action -> (super Stream Action do 0))
@{for}@

(2-) (define filter
       Stream Condition ->
         (super Stream
                (/. Val (if (Condition Val) [Val] []))
                append
                []))
@{filter}@

(3-) (for [0 (+ 1) (= 10)] print)
#{0123456789}#@{0}@

(4-) (filter [0 (+ 1) (= 100)]
             (/. X (integer? (/ X 3))))
@{[0 3 6 9 12 15 18 21 24 27 30 33... etc]}@