ShenSharp is a port of the Shen language to the CLR.
Shen is a portable, functional programming language by Mark Tarver. It is a descendant of the LISP family of languages which also includes features commonly found in ML family languages. Shen offers pattern matching, a unique macro system, optional lazy evaluation, configurable static type checking, logic programming and a built-in compiler-compiler.
ShenSharp is built by loading the Shen kernel as Kλ and translating the resulting environment to F# ASTs and building that into a CLR assembly. Shen code loaded by this compiled kernel is translated into optimized expressions and evaluated on demand. Some optimizations used include inlining direct references to global symbols, expression simplification and tail call optimization using trampolines.
This port passes all tests in the Shen standard test suite, making this a certifiable implementation. Current test run time is about 40 seconds in the Windows/.Net build on AppVeyor.
CLR Platform Support Status
Guided Tour of the Code
- Types - Defines types for Kλ Values, Functions, Environment and IO
- Evaluator - Interprets Kλ syntax trees, rendering Kλ values and performing side effects
- Builtins - Primitive functions required by Kλ
- Startup - Builds a primitive Kλ environment
- Reader - Parses Kλ code
- Compiler - Translates an environment of Kλ expressions into a F# module AST
- Runtime - Helpful functions for embedding Shen in another application
- ExtensionMethods - Extension method versions of functions in Runtime to give API a C# feel
- RunRepl -
Interpretation of command line arguments passed to