Skip to content
/ shen-c Public

A C implementation of the Shen programming language

Notifications You must be signed in to change notification settings

otabat/shen-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 as an interpreter, mainly tested on macOS (Apple Silicon) using Clang.

Besides macOS (Apple Silicon), Ubuntu 20.04 LTS (x86_64/AArch64) is a minor supported OS.

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

  1. Download a release build from releases
  2. Unarchive a release build
tar xvf shen-c-{VERSION}-{OS}-{ARCH}.tar.gz

Usage

  1. Run Shen-C REPL from a release build

Run the shell script under the build directory.

cd shen-c-{VERSION}-{OS}-{ARCH}
./shen-c
  1. Quit Shen-C REPL

Pass an exit status

(exit 1)

Build from source

  1. Install the required softwares

For macOS install Boehm GC by Homebrew or from sources

  brew install libgc

For Linux (Ubuntu)

Install make

sudo apt install make

Install Clang

sudo apt install clang

Install Boehm GC

sudo apt install libgc-dev
  1. Change directory to the project root

  2. Build Shen-C

To build a non-release build

make

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

To build a release build

make release

A release build will be created under the release directory.

Run non-release build

There are several ways to run a non-release build.

  • Run the shell script under the project root.
./shen-c
  • Run Shen-C REPL by using the make command
make repl

or if rlwrap is installed

make rrepl
  • Run Shen-C REPL from a compiled binary

Set the SHEN_C_HOME environment variable to the project root for a Unix shell

export SHEN_C_HOME=/path/to/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

Learn Shen

License

Shen

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

Shen-C

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

About

A C implementation of the Shen programming language

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages