PiLisp—An interpreted Lisp inspired by Clojure.

Alpha. Much works, much may change.

The PiLisp Native project is an extension of pilisp that takes advantage of features and packages available only for Dart's native compilation target.

This is the pilisp_native package on pub.flutter-io.cn.

Features

See the definitions in the pilisp-native-pilisp for core PiLisp definitions that are (re)defined in this package.

This is the pilisp package on pub.flutter-io.cn.

Usage

  • Download a release for standalone CLI usage.
  • dart pub add pilisp to add as a library to your Dart project.

For CLI use, download the latest release for your platform and run the pl executable.

$ pl
pl>

Run the help command for all options:

$ pl help
Run a PiLisp REPL, or try the subcommands for more options.

Usage: pl <command> [arguments]

Global options:
-h, --help    Print this usage information.

Available commands:
  eval   Evaluate PiLisp code passed as arguments.
  load   Load PiLisp code saved in files.
  repl   Start a PiLisp REPL.

Run "pl help <command>" for more information about a command.

For use in your Dart programs, PiLisp.loadString will read and evaluate program source:

PiLisp.loadString('(+ 1 2 3 4)');

Additional information

The name "PiLisp" was originally a shortened form of "Piped Lisp," because a first prototype of this language was developed while building a REPL for the Shortcut project management SaaS product that included a rudimentary Lisp whose defining feature was use of the pipe character | as an equivalent of Clojure's thread-first macro ->.

Build

  1. Clone this repository
  2. Run dart pub get
  3. Run ./script/compile

Acknowledgements

Initial implementation of the reader was based on ClojureDart's reader.cljd licensed under the Eclipse Public License (EPL-1.0).

A rewrite of the reader was adapted from dlox's scanner.dart licensed under the MIT License.

Much of PiLisp's implementation (both Dart and PiLisp code) was copied and adapted directly from the Java and Clojure source code in the Clojure project licensed under the Eclipse Public License (EPL-1.0).

License

Copyright © Daniel Gregoire 2022–2023

Eclipse Public License - v 2.0

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.

Libraries

builder
This library is not intended to be imported by typical end-users unless you are creating a custom compilation pipeline. See documentation for details, and build.yaml for how these builders are configured by default.
pilisp_native
PiLisp for Native Targets