A C implementation of the Shen programming language
C Shen C++ Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
shen
src
.gitignore
Makefile
README.md

README.md

Shen-C

Shen-C is a C port of the Shen programming language.

Shen is a portable functional programming language developed by Mark Tarver that offers

  • Pattern matching
  • Lambda calculus consistency
  • Macros for defining domain specific languages
  • Optional lazy evaluation
  • Optional static type checking based on Sequent calculus
  • An integrated fully functional Prolog
  • An inbuilt compiler-compiler, Shen-YACC

Shen-C is implemented in C99 currently as an interpreter, mainly tested on macOS using Clang. Should also work with GCC.

The iOS version of Shen-C is available on the App Store, which is a full featured Shen REPL with a customized keyboard for both iPhone and iPad.

Other ports of Shen by the Shen-C author includes

Installation for macOS

  1. Install Boehm GC by Homebrew or from sources
  brew install libgc
  1. Change directory to the project root

  2. Compile Shen-C

make

A binary file named shen-c will be created under the project_root/bin directory.

Installation for other platforms

Install Boehm GC, and change the Makefile to match the platform.

Usage

  1. Run Shen-C REPL by using make command
make repl

or if rlwrap is installed

make rrepl
  1. Run Shen-C REPL directly

Set the SHEN_C_HOME environment variable to the Shen-C project root
If you are using bash for a Unix shell

export SHEN_C_HOME=/home/user/shen-c

and then

alias shen-c='$SHEN_C_HOME/bin/shen-c'

or if rlwrap is installed

alias shen-c='rlwrap $SHEN_C_HOME/bin/shen-c'

and finally

shen-c
  1. Quit Shen-C REPL
(quit)

or with an exit status

(exit 1)

Learn Shen

License

Shen

Copyright (c) 2010-2015, Mark Tarver
Shen is released under the BSD License.

Shen-C

Copyright (c) 2017, Tatsuya Tsuda
Shen-C is released under the MIT License.