home ¦ Archives ¦ Atom ¦ RSS

Broekema: CLPython

Neato! William Broekema has developed an implementation of Python written in Common Lisp. That makes for four different languages Python has been implemented in: C, Java, CL and Python. For PLDI snobs, some of the signs of a language being "real" is that it has multiple implementations, indicating a diversity of implementation strategies, and that it self-hosts, meaning that the language can be implemented within itself. Self-hosting also means that the language at least approaches having an operational semantics, if not a formal semantics. (Don't shoot me real PLDI researchers!!). While there are plenty of other languages to hack around on, I would think working on program analysis and software engineering tools for Python code might be a valuable line of research.

Another interesting usage for such implementations is in the development of restricted execution environments. Say you want to give a Common Lisp application an embedded scripting language. The obvious choice is to use eval as an escape hatch into the same Common Lisp environment, but that's fraught with security issues. Instead you expose CLPython, where you can carefully craft the scripting environment to prevent bad things from happening.

Finally, I have to imagine CLPython could be straightforwardly transliterated to Scheme, whence one could start to show off all those snazzy applications Scheme's continuations to implement Python's funky control structures.

© Brian M. Dennis. Built using Pelican. Theme by Giulio Fidente on github.