A Java implementation of the Shen programming language
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Shen-JVM

Shen-JVM is a compiler of Shen programming language to Java bytecode written in Java 6.

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

The Android version of Shen-JVM is available on Google Play, which is a full featured Shen REPL with a customized keyboard.

Other ports of Shen by the Shen-JVM author includes

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

Download from GitHub releases

Download the JAR file (shen-jvm-x.x.x.jar) from releases

Download from JCenter

Gradle

dependencies {
    compile 'compile 'com.shenjvm:shen-jvm:x.x.x'
}

repositories {
    jcenter()
}

Maven

<dependency>
    <groupId>com.shenjvm</groupId>
    <artifactId>shen-jvm</artifactId>
    <version>x.x.x</version>
    <type>pom</type>
</dependency>
<repository>
    <id>jcenter</id>
    <name>jcenter-bintray</name>
    <url>https://jcenter.bintray.com</url>
</repository>

Build from sources

Shen-JVM uses Gradle as a build tool.

gradle wrapper
  • Build Shen-JVM
./gradlew uberJar

or

gradlew uberJar
  • Clean previous builds and build Shen-JVM
./gradlew clean uberJar

or

gradlew clean uberJar

The JAR file will be generated as PROJECT_HOME/build/libs/shen-jvm-x.x.x.jar

Run Shen-JVM (from releases)

java -jar shen-jvm-x.x.x.jar

or if rlwrap is installed

rlwrap java -jar shen-jvm-x.x.x.jar

When running the Shen test suite, it is recommended to increase the heap size and thread stack size using the Java options such as below. Especially the thread stack size is important and otherwise a stack overflow might occur.

java -Xms200m -Xmx2g -Xss4m -jar shen-jvm-x.x.x.jar

or

rlwrap java -Xms200m -Xmx2g -Xss4m -jar shen-jvm-x.x.x.jar

Run Shen-JVM (built from sources)

java -jar ./build/libs/shen-jvm-x.x.x.jar

or with rlwrap and Java options

rlwrap java -Xms200m -Xmx2g -Xss4m -jar ./build/libs/shen-jvm-x.x.x.jar

Run Shen Test

(cd "shen/test")
(load "README.shen")
(load "tests.shen")

or the one-liner

(cd "shen/test")(load "README.shen")(load "tests.shen")

Quit Shen-JVM

Pass an exit status

(exit 1)

Learn Shen

License

Shen

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

Shen-JVM

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