Giter Site home page Giter Site logo

shen-cl's Introduction

Shen Version Build Status

Shen for Common Lisp

Shen for Common Lisp by Mark Tarver, with contributions by the Shen Language Open Source Community.

This codebase currently supports the following implementations:

This port acts as the standard implementation of the Shen language. It is also the fastest known port, running the standard test suite in 4-8 seconds on SBCL, depending on hardware.

Bug reports, fixes and enhancements are welcome. If you intend to port Shen to another variety of Common Lisp, consider doing so as a pull request to this repo.

Features

shen-cl supports calling underlying Common Lisp functions by prefixing them with lisp..

(lisp.sin 6.28)
-0.0031853017931379904

Common Lisp code can also be injected inline using the (lisp. "COMMON LISP SYNTAX") syntax. The lisp. form takes a single string as its argument. Also keep in mind that shen-cl puts Common Lisp into case-sensitive mode where CL functions and symbols are upper-case so they don't conflict with symbols defined for Shen.

(lisp. "(SIN 6.28)")
-0.0031853017931379904

(lisp. "(sin 6.28)")
The function COMMON-LISP-USER::sin is undefined.

The function shen-cl.exit is included, which takes a single integer argument, terminates the process, returning the argument as the exit code.

Prerequisites

You will need to have recent versions of the Common Lisp implementations you want to work with installed and available as the Makefile requires. Installation is different depending on operating system.

Support for Common Lisp implementations varies over different operating systems. By default, only implementations available in binary form are built with the make all command. Check the value of the All variable in the Makefile to see which are supported for your OS and architecture.

Check the project page for any CL implementation to build from source if necessary.

Linux

CLisp, ECL and SBCL are available through apt. Just run sudo apt install clisp ecl sbcl.

ECL requires libffi-dev to build, which can also be retrieved through apt.

There is a separately available debian package for Clozure. Download and install with dpkg -i.

If the version of SBCL available throught apt is too old, a sufficiently new version is available from debian.

macOS

CLisp, Clozure, ECL and SBCL can be acquired through Homebrew with brew install clisp clozure-cl ecl sbcl.

FreeBSD, OpenBSD and NetBSD

Below is a summary of currently supported implementations per BSD variant. As always, you should check for yourself the availability of these CLs with the package manager of the particular BSD you are running, e.g., pkg search sbcl or pkg_info -Q sbcl.

FreeBSD OpenBSD NetBSD
CLisp N/A pkg_add clisp pkg_add clisp
CCL pkg install ccl N/A N/A
ECL pkg install ecl pkg_add ecl pkg_add ecl
SBCL pkg install sbcl pkg_add sbcl pkg_add sbcl (i386 Only)

Also, you will need to install GNU make. This repo's Makefile is a GNU make makefile and typing make ... is likely to invoke the system make (BSD make) and quit on you harshly, complaining about parsing errors. Hence, it is necessary to ensure that the gmake package/port is installed, and replace make ... in the instructions below with gmake ....

Windows

CLisp has an installer and a zip package on SoureForge. You'll have to include clisp.exe as well as libintl-8.dll and libreadline6.dll in on your PATH to ensure the clisp build of shen-cl will run.

Clozure will need to be installed manually:

  • Download the zip from here and extract it under Program Files.
  • Add the Clozure directory to your PATH or add a script named ccl.cmd to somewhere in your PATH containing something like:
@echo off
"C:\Program Files\ccl\wx86cl64.exe" %*

ECL needs to be built from source. Refer to the appveyor.yml config for build procedure. Requires Visual Studio 2015+ tools. ECL support is spotty on Windows and is not included in make all when on Windows.

SBCL has an msi package on its download page.

The Makefile might not be entirely Windows-friendly, so a toolset like GOW can fill the gap, or use MGWIN or Cygwin.

Building

The Makefile automates all build and test operations.

Target Operation
fetch Download and extract Shen sources.
build-X Build executable.
test-X Run test suite.
X Build and run test suite.
run-X Start Shen REPL.
release Creates archive of compiled binaries.

X can be clisp, ccl, ecl, sbcl or it can be all, which will run the command for all of the preceding.

Running

An executable is generated for each platform in its platform-specific output directory under bin/ (e.g. bin/sbcl/shen.exe). Per typical naming conventions, it is named shen.exe on Windows systems and just shen on Unix-based systems.

Startup scripts can be specified on the command line by preceding them with a -l flag. If any startup scripts are specified this way, they will be loaded in order and then (shen-cl.exit 0) will be called. If none are, the Shen REPL will start as usual. Either way, all command line arguments will be accessible with (value *argv*).

When starting Shen via make, command line arguments can be passed through like this: make run-sbcl Args="-l bootstrap.shen -flag".

Releases

Archives of pre-built binaries are created using the make release command. They will appear under release/, named with the operating system and current git tag or short commit hash.

Currently, only the license file and the SBCL build are included (named shen[.exe]).

Each tagged release on the project downloads page should have a set of pre-built archives. Be sure to archive the build of that specific commit, like this:

make pure
git checkout v1.2.3
make fetch
make sbcl
make release

shen-cl's People

Contributors

rkoeninger avatar tizoc avatar cryptorick avatar cxxxr avatar

Watchers

Rohit Yadav avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.