Python compilers?

Martijn Faassen m.faassen at vet.uu.nl
Mon Sep 27 14:43:55 EDT 1999


Nolan Darilek <nolan at ethereal.dhis.org> wrote:
[snip]
> So, are there any native Python compilers? Someone on IRC mentioned a project
> called Viper, and my searches seem to indicate that it is under
> development, but is there any information on the web about its status?

John Skaller is actively working on it, last I heard. He is first working on
viperi, however, a Python interpreter, after that he plans to move on to
viperc, a Python compiler. viperi seems to actually run Python code, but
I don't think viperc is out of the design phase yet.
John wants to do all kinds of grand things with viper, such as type
inference and other advanced code analysis.

> Also, What is swallow? I tried doing a websearch for swallow and
> Python, and ended up with tons of Holy Grail references, but nothing
> to answer my question. :) I ask because I've seen swallow coupled with
> viper in a few messages; is swallow another python/pseudopython
> interpreter/compiler?

Swallows was an earlier vaporware project that I came up with. The idea
behind Swallow is to implement a compiler for a limited subset of Python
(along with nonintrusive type annotations). This could be used to create
Python based fast extension modules.

Currently I lack the time to do a lot about it, though. Maybe later, but
currently it is complete vaporware! No website. :)

Cool that people ask, though.. What some posts and a cool name can do. :)

There *are* actual Python to C compilers out there; others can point you
to the relevant web pages better than I could. The disappointment here is
that they tend to create executables that aren't significantly faster
than Python. That's why for Swallow I think the subset part + type 
annotations were essential (as concepts). My hope is that this could
lead to translation to actually *fast* C (or native) code. And the
restrictions also allow us to skip the difficult parts of type 
inferencing and dealing with lots of Python's dynamism.
 
> One final question. How compatible/cross-platform are Python
> bytecodes? If I wanted to distribute applications in Python while
> hiding the sources from the user, would it be possible to distribute
> .pyc files, or the bytecodes specific to a specific version/platform?

As far as I'm aware Python's bytecodes are fully portable to other 
platforms.

Regards,

Martijn

-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?




More information about the Python-list mailing list