I experimented a bit with the Lisp compiler targeting Python bytecode .
Here you can see a small video here .
This is just a proof-of-concept toy, but it is an IMO a viable way, and the end result could be called and called from python freely (and it would be compatible with any python extension library). However, all this preserves the power of macros (metaprogramming is probably the area that Python is further from lisp).
Targeting Python source code instead is rather unpleasant, because there are explicit syntax restrictions that make Lisp compilation difficult (for example, assignment is not an expression, statement statement is not allowed in iamba, captured variables are read-only in Python 2.x).
However, VM runtime does not have these limitations, and Python bytecode is good enough.
Currently, my toy can target Python 2.x, Python 3.x and even works with PyPy (so you get a JIT compiler too).
Of course, striving to become a full-fledged implementation of Common Lisp would be an IMO error from a technical point of view, but a Lisp dialect based on Python execution types and compatible with the Python object system could become a sensible tool with practical applications.
source share