Skip to content

shikantaza/pLisp

Repository files navigation

The only thing left to do is to add whatever is needed to open a lot of little windows everywhere.

-Christian Queinnec, Lisp in Small Pieces


What is pLisp?

pLisp is an integrated development environment for Lisp. While it aims to be a friendly Lisp development system for beginners, its feature-set is comprehensive enough to address the needs of a small-to-medium sized Lisp project.

What features does pLisp support?

  • Basic operators like CAR, CDR, and other language primitives

  • Other operators and utility functions written in pLisp itself

  • Exception handling in the form of '(try .. (catch ..) ..)'

  • Garbage collection

  • Foreign function interface

  • Ability to store and load images (both at the system level and at the level of individual objects)

  • Macros

  • Debugger (break, resume)

  • Package/Namespace system

  • Continuations

  • Graphical IDE with context-sensitive help, syntax colouring and autocomplete

What dialect of Lisp is pLisp based on?

pLisp is not based on any single Lisp dialect, but draws inspiration from Scheme. However, its macro system is based on Common Lisp (backquote, comma and comma-at).

Why do we need yet another Lisp system?

pLisp started out as a hobby project, an implementation of an interpreter embodying the concepts in Paul Graham’s "Roots of Lisp". As its feature-set kept growing, my dissatisfaction with existing Lisp development systems and my missing the beauty, power and elegance of Smalltalk environments in these systems prompted me to make pLisp more than just a command-line interpreter and add features like a system browser, workspace, and other good stuff.

My current objective with pLisp is for it to serve as a) a friendly Lisp environment for beginners and b) an end-to-end demonstration of the construction of a Lisp-based programming language system from scratch (object system design, virtual machines and intermediate code generation, garbage collection, serialization, just-in-time compilation, exceptions/continuations, and so on). And also serve as my personal programming environment, of course.

What platforms is pLisp available on?

pLisp is available for Linux, Windows and OS X.

What about the license?

pLisp is licensed under GPL v3.

How do I install pLisp?

Linux

pLisp can be installed using the 'dpkg' command (sudo dpkg -i <plisp deb file>). The following dependencies need to be satisfied first (you can install these packages using the package manager of your choice):

libgtk-3-0
libgtksourceview-3.0-0
libffi6
tcc (required only for 32-bit)

Note: If you get the error "tcc: error: file '/usr/local/lib/tcc/libtcc1.a' not found" on launching pLisp after installation, create a symbolic link to this file (found in the installation directory of tcc) in /usr/local/lib/tcc. I am investigating this.

Windows

Simply unzip the downloaded zip file to a location of your choice. You will also need the GTK and GTKSourceView packages for Windows, which can be installed using MSY2 and pacman. For example (from an MSYS2 shell):

pacman -S mingw-w64-i686-gtk3
pacman -S mingw-w64-i686-gtksourceview3

Before running pLisp, ensure that the PATH environment variable has been updated to reflect the location of the MSYS2 DLLs. For example:

set PATH=%path%;c:\msys32\mingw32\bin

OS X

Unzip the downloaded zip file and move the pLisp application (pLisp.app) to the directory of your choice (typically 'Applications'). You can then run pLisp as you w ould any other OS X application (from the Launcher, Spotlight, and so on). Please note that this will launch pLisp in the current user’s home directory, so if you would like automatic opening of an image on startup, you should create/save the image as 'plisp.image' in your home directory.

How do I report bugs and other issues?

You can email me at rajesh dot jayaprakash at pm dot me, or use the ‘Issues’ feature in Github.

Where is the documentation?

Online help is available within pLisp, a user manual and a language reference document are also available. I have some blog posts that talk about pLisp internals. I may expand these posts into a developers' manual in the future.

Here is a short paper on pLisp in ELS 2018, and a paper on the pLisp compiler in ELS 2020.

Installing pLisp From Source

Linux - 32-bit

You will need autoconf, automake, libtool, and GCC to install pLisp. In addition, the following dependencies need to be taken care of:

All these packages can be installed using the package manager that comes with your distro or from the package’s home page.

Linux - 64-bit

You will need autoconf, automake, libtool, GCC, and g++ to install pLisp. In addition, the following dependencies need to be taken care of:

All these packages can be installed using the package manager that comes with your distro or from the package’s home page.

To build and install pLisp, type './configure LLVMDIR=<llvmdir>' (where <llvmdir> is the directory where LLVM/Clang is installed), 'make', and 'sudo make install'.

OS X

Option #1: The conventional route

The same steps to be followed for Linux 64-bit can be followed, with the dependencies to be installed using Homebrew. pLisp will be installed in /usr/local/bin, and you can invoke it from a Terminal session (or create an OS X command script).

Option #2: Building and deploying pLisp as an OS X application

(Note: due to issues with the app bundling process for OS X, we need to start with an existing app bundle for building/deploying pLisp in OS X)

You will need Homebrew Homebrew to install pLisp’s dependencies. Install the toolchain and packages mentioned above for Linux (64 bit) using Homebrew.

Once these dependencies have been installed, install pLisp by following these steps:

  • Download the latest zip file (e.g., pLisp-0.1.30.zip) from the 'pLisp/downloads/osx' directory.

  • Copy/Move the pLisp.app directory from the above zip file to a directory of your choice (say, TEMP; e.g., ~/temp).

  • Open a Terminal and navigate to the 'pLisp/scripts' directory.

  • Update the PATH, CFLAGS, and LLVMDIR in the build_osx_dmg.sh script in this directory to match your setup.

  • run 'sh ./build_osx_dmg.sh TEMP/pLisp.app TEMP/plisp'. This will build pLisp and update the pLisp.app directory with the latest version.

  • Drag/Move the updated pLisp.app directory to the Applications directory.

Once thus installed, pLisp can be invoked by the usual means (Launcher, Spotlight, etc.).

Windows

  • Install MSYS2

  • Install gcc, make, flex, bison, pkg-config, GTK3, GtkSourceView3 using the pacman utility from an MSYS2 shell:

    pacman -S <package name>
  • Install the Tiny C Compiler. You will have to do it the './configure; make; sudo make install' way.

  • Install the Boehm Garbage Collector using './configure; make; sudo make install'.

  • Install pLisp from the MSYS2 shell by './configure', 'make' and 'sudo make install' at the command line after navigating to the directory to which you downloaded/extracted the pLisp files.

Note: pLisp can be installed on Cygwin; however, issues with compiling TCC on Cygwin make this quite cumbersome.