[plt-scheme] Spy

From: Daniel Pinto de Mello e Silva (daniel.silva at gmail.com)
Date: Mon Jun 11 01:34:37 EDT 2007

Hi Jakub,

The code lives at SourceForge and the website is


The PyCon paper you mentioned and the accompanying Scheme Workshop
report give a good overview of the project.  The Scheme Workshop
website hosts a PDF of the proceedings, including the paper itself:


You can also find a more detailed account in the documentation section
of the Spy website under "Implementing a Python to Scheme Compiler."


If you're interested in reading the source code, you can browse the CVS tree:


The papers describe a native Scheme implementation of the Python
language.  The approach did not work well when interacting with
Python's foreign function interface (C extensions).  The Python
standard library also proved too large for us to implement and

The second Spy implementation (still in CVS under python/c) consisted
of parts of a modified CPython interpreter hacked to act as a MzScheme
C extension and share C data types to avoid boxing between cpython and
mzscheme objects.  In this case we got most of the standard library
for free, but mixing CPython's and MzScheme's automatic memory
managers was causing a lot of headaches.

A third approach was to embed CPython via an external MzScheme C
extension, give in to full object boxing, and keep the memory models
separate.  You can find this code in the "python/embed" directory and
in the "python/c-bindings.ss" module.  This embedding is meant to be
accessed via the scheme module language "full-spy-language.ss".  You
can find examples of this in the files ending with ".spy" in the
"examples" directory.  See the README and HACKING files for more

The first approach might be what you really want when you have the
resources, and it's worked well for many groups: Jython, IronPython,
Mono, GCJ + GNU Classpath, and so on.  Embedding is the quickest way
to get something up, and it's good enough when you don't mind running
an external interpreter.  Take a look at Pedro Pinto's Dot-Scheme for
an example:


On 6/10/07, Jakub Piotr Cłapa <jpc at pld-linux.org> wrote:
> Does anybody know something about the Python in PLT Scheme project?
> There is one conference paper [1] and one defunct website [2] which had
> robots.txt blocking so it's unavailable even on archive.org.
> I was interested in the source code because Python was my top language
> before I got to learning Scheme and I would love to learn something from
> it (or even use some pieces in my own work). :)
> [1] http://www.python.org/pycon/dc2004/papers/25/
> [2] spyweb.hopto.org/
> --
> regards,
> Jakub Piotr Cłapa
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.