Every so often a newbie Lisper pops up on comp.lang.lisp and says "I want to make a web application. Python is really easy to get up and running but Lisp is much harder". Sometimes they get called a troll, but some people will also say they have a valid point.
Python was originally defined to be easily embedded, so you can link it into a C/C++ program as a dynamically linked library (DLL). Lisp's common foreign function interface (CFFI) lets you call into linked libraries from lisp. Python-on-lisp puts these two pieces together, so that you can call python from lisp. This is a two way bridge, so python can return its results back to lisp. Crucially, this makes python's rather extensive libraries available from within common lisp.
You can get pythononlisp-0.2.tar.gz, an ASDF-installable tarball.
This is an Alpha release, I cannot be held responsible for any damage or loss that occurs from running this Lisp program. Always start a new Lisp session in case Lisp crashes, and make a backup of any important files in the directory it resides in.
Python-on-lisp is defined to use the asdf-install system, making installation fairly automatic. More details are contained in the documentation and source code of the download bundle. But quick instructions are as follows:
This will also install dependencies like cffi
(asdf:operate 'asdf:load-op :pythononlisp)
If you want to load pythononlisp without asdf, load cffi, then do:
(LOAD "packages.lisp") and (LOAD "pythononlisp.lisp")
(py::py "print \"Hello from python\"")
(py::py get-web-page "http://www.google.com")
You could call the project PyEval, like Lisp's eval function.
Python-On-Lisp will look for the DLL or object code file for Python in the default location for your platform. On Windows and OSX this should just work, as well as on Debian Linux. However, if you have installed it in an unusual place, or are using an unusual platform, you may need to specify this information yourself by amending the call to (CFFI:DEFINE-FOREIGN-LIBRARY python-library ...) in pythonlisp.lisp
For further instructions, consult the documentation in the package itself.
I'm hoping to get CVS up and running so all changes are logged, etc.
You can browse our SVN repository or download the current development tree via anonymous svn, as described here