Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Shen Elisp

Shen Elisp

This is an implemenatation of the Shen programming language in Elisp. The end goal is to provide:

  1. an easy way to play with Shen with no other installation hassle (assuming you use Emacs).
  2. a first-class development experience when writing Shen. The idea is that an editor that understands the code can be much more helpful than one that does not. To this end the roadmap involves a full gamut of source code introspection and debugging tools.


This port is completely self-contained. However since it leans heavily on the relatively new lexical-binding feature Emacs 24.3 or above is required.

Also note the installation will emit a large number of byte-compiler warnings. Nothing to worry about but they are annoying and my attempts to silence them have thus far failed.


To install the package directly from Github using `quelpa` tool:

      :repo "deech/shen-elisp"
      :fetcher github
      :files ("shen*.el"))
   :upgrade 't)

Since this is alpha software the :upgrade 't at the end always pulls the latest version.

If you are a Spacemacs user you can do the following:

  1. Add the following to the dotspacemacs-additional-packages variable:
dotspacemacs-additional-packages '(
                                    :location (recipe :repo "deech/shen-elisp"
                                                      :fetcher github
                                                      :files ("shen*.el"))
                                    :upgrade 't)
  1. SPC : spacemacs/emacs-reload
  2. Invoke shen/repl after installation has completed.

It also uses the `quelpa` tool underneath.


Once the package is installed the Shen REPL should start with:

M-x shen/repl

Getting Started

To get started here is a sample REPL session showing how to

  • define a function,
  • toggle typechecking
  • evaluate an expression and
  • load a sample file

This session assumes a file called add.shen in the tmp directory containing:

(define add
  { number --> number }
  X -> (+ X 1))
Shen, copyright (C) 2010-2015 Mark Tarver, Shen 19.2
running under Elisp, implementation: Elisp
port 1.7 ported by Aditya Siram

(0-) (define say-hello-to Name -> (@s "Hello " Name))

(1-) (say-hello-to "World")
"Hello World"

(2-) (tc +)

(3+) (map (/. X (+ 1 X)) [1 2 3])
[2 3 4] : (list number)

(4+) (load "/tmp/add.shen")

add : (number --> number)
run time: 0 secs

typechecked in 93 inferences
loaded : symbol

(5+) (add 1)
2 : number

(6+) (add "some string")

type error

To learn more about Shen see the the website.


The port is still alpha so some REPL features which you might expect are not available. This is being addressed. Starting with the most unpleasant:

  • multi-line definitions are not allowed in the REPL. If you hit Return before completing a function definition, for example, the REPL spits out a cryptic error with a list of bytes.
  • Ctrl-G does not work. This leaves the REPL in a state where the only thing you can do is delete the buffer, followed by M-x shen/repl. Any functions/datatypes defined in the REPL, however are saved.
  • When expressions/functions etc are compiled to Elisp the byte-compiler spits out warnings that may steal focus away from the REPL.
  • The REPL still emits Elisp errors on occasion.
  • comments are not supported in the REPL.


This port is a literate program written using org-babel so the complete source is documented in It has also been exported to shen-elisp.html for easy browsing.


No description, website, or topics provided.



No packages published
You can’t perform that action at this time.