Python IS slow ! [was] Re: Python too slow for real world

Markus Kohler markus_kohler at hp.com
Thu Apr 29 04:13:46 EDT 1999


>>>>> "Paul" == Paul Prescod <paul at prescod.net> writes:

    Paul> Markus Kohler wrote:
    >> 
    >> 
    >> You are right that one should choose the right tool for a
    >> problem, but I disagree that Python is optimized for the
    >> general case. Squeak a free Smalltalk implementation
    >> (www.squeak.org), is already much faster ( about 3 times
    >> actually ) than python and it has even a true Garbage
    >> Collector.

    Paul> This is a little off-topic but I'm curious whether squeak
    Paul> has an embedding API. Is there any languge that is as easy
    Paul> to embed as Python, and also has full garbage collection?

No really off-topic, because not using a GC makes embedding much easier, because 
objects do not move around. Squeak has 'plugins' but these are not yet good
enough to allow embedding of arbitrary C code. The main problem is of course
that some C code cannot use Squeak allocated objects because the address of the object
may change because of garbage collection. Also Squeak currently lacks an easy general
mechanism to callback Squeak code from C. 

In summary one can say that with a decent GC (generational copying + mark and sweep) 
embedding is more diffcult. Anyway I think a fairly simple embedding API with could
be done, it's just more work to do once. 
Visualworks a commercial Smalltalk implementation shows it's possible to do it. 
They also have a COM integration for example. 

I don't know of any other language with a decent garbage that is easy to embed. 

Maybe SmallEiffel does it. I is a free Eiffel compiler that translates to C has an (optional) GC
and allows to call C code. 

Markus
-- 
Markus Kohler  mailto:markus_kohler at hp.com




More information about the Python-list mailing list