ShenSharp Save

Shen for the Common Language Runtime

Project README

Shen Version Latest Nuget Build Status

Shen for the Common Language Runtime

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.

Refer to the CI build script (.travis.yml) for build instructions.

Shen Resources

CLR Platform Support Status

  • .NET Standard 2.1, .NET Core 3.1

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 Shen.exe
Open Source Agenda is not affiliated with "ShenSharp" Project. README Source: rkoeninger/ShenSharp
Stars
32
Open Issues
2
Last Commit
5 months ago
License

Open Source Agenda Badge

Open Source Agenda Rating