Greg Hewgill (ghewgill) wrote,
Greg Hewgill

psil manifesto

I haven't talked about Psil (my implementation of Lisp on Python) for a while. It's been on the back burner while I've explored other things (such as Iceland), but I recently got a copy of Let Over Lambda which has reignited my interest.

One of the reasons I'm exploring Lisp languages is as a learning exercise. There's hardly any better way to really learn a language than to implement an interpreter or compiler for it. But in the wider context, I think it's a good thing to have an implementation of Lisp on top of an existing platform - the Java people already have that with Clojure. There doesn't appear to be an equivalent for the Python ecosystem yet.

I sat down to try to list my motivations for building this project. Without further ado, here is the Psil Manifesto (which should be considered a work in progress):

Psil Manifesto

Psil is a new general-purpose programming language in the Lisp family of languages. Psil is implemented on top of Python, allowing easy access to existing Python libraries.

  • Best features from Lisp and Scheme
  • Complete language in its own right
  • Built upon the Python standard libraries
  • Strong interoperability with Python code

Best features from Lisp and Scheme

Lisp and its family of related languages offer what some consider to be the pinnacle of programming language expressiveness. With a simple yet powerful macro facility, the foundation of metaprogramming, Lisp can be the base language on which domain-specific languages can be built.

Lisp and Scheme both carry some amount of historical baggage with them, particularly in names of standard functions and macros. Psil can make a clean transition from these old names (eg. setf or nconc) while keeping names that are the very essence of lisp (eg. cons and car).

Scheme's functional focus reflects the current trend toward functional languages and immutable data structures. This is likely to become more important in the future.

Complete language in its own right

Psil is designed to be a general purpose programming language on its own. Although it relies on the Python standard library, Psil should be able to do everything Python can do.

Built upon the Python standard libraries

Python has an extensive standard library, often said to come with "batteries included". One of the greatest hurdles in learning to use a new language is not necessarily the language syntax and semantics, but just learning which functions you can call to do interesting things. Psil makes this easy for programmers already familiar with Python.

Strong interoperability with Python code

Psil can call any Python library function. Psil code can be embedded in Python code, and the Psil code has visibility to the Python environment in which it is run. Python "callable" objects can be created in Psil, and can be called just like any other Python function. Classes and modules can be implemented in Psil.

Tags: psil
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded