Monday, November 17, 2014

pLisp FAQ

What is pLisp?
pLisp is an integrated Lisp development environment.

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).

What features does pLisp support?

1. Basic operators like CAR, CDR, and other language primitives
2. Other operators and utility functions written in pLisp itself
3. Exception handling in the form of '(try .. (catch ..) ..)'
4. Garbage collection
5. Foreign function interface
6. Ability to store and load images (both at the system level and at the level of individual objects)
7. Macros
8. Debugger (break, resume, inspect variables)
9. A package/namespace system
10. Continuations
11. A basic but complete object system that supports inheritance, encapsulation, etc.
12. Graphical IDE

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 right now Linux-only. I may port it to other platforms in the future.

What about the license?
pLisp is licensed under GPL v3.

How do I install pLisp?
pLisp is installed by running 'make' on the provided make file.

What do I need to install pLisp?
You will need a) the GTK+3.0 development package (libgtk-3-dev) b) the Tiny C Compiler development files (libtcc.h and libtcc.a) and c) libffi

pLisp also uses Emin Martinian's Red Black Tree code in its GC implementation (this code is shipped along with pLisp, so you don't have to go out and grab it).

How do I report bugs and other issues?

You can email me at rajesh dot jayaprakash @ gmail dot com

Where is the documentation?
A user manual is in the works. I have some blog posts that talk about pLisp internals. I may expand these posts into a developers' manual in the future.

Friday, November 14, 2014

pLisp Updates

Thought I'd share some updates related to pLisp.
  1. pLisp has been migrated completely to Linux. I was already doing this in a half-assed way by using Cygwin, but faced issues with migrating to GTK 3.0, so a move to Linux made sense. I also wanted to make it completely portable, but one look at the horror that is autoconf/automake made me beat a quick retreat.
  2. I have been working on native code compilation, and it's been a partial success. Most of a closure/macro's code (the assembly Lisp that was being generated for the VM's consumption) is now native, except for the FRAME instruction. This instruction is problematic mainly because of the need to handle continuations. We need to maintain the calling stack even when we're doing native code, so the reliance on the present 'instruction set' (reg_accumulator, reg_current_stack, et al) is still there, making going full-native still some way off. I guess I need to grok Appel's Compiling With Continuations before I can do this. The Tiny C Compiler is used for the native code compilation; we dynamically create function pointers by converting the Lisp assembly code to C and invoking the TCC API to convert the C code to native code.
  3. Command line options have been introduced. Now you can run pLisp in console mode (-c), invoke it with an image (-i) or use it to just evaluate a single expression and quit (-e).
  4. A user manual and FAQ are in the works. I'm also looking for a new descriptive title ("pLisp is a Lisp-1 interpreter" doesn't really do it justice; since the UI draws a lot of inspiration from Smalltalk, maybe I'll change it to "Don't Lisp. Talk". Provocative much?)