[pypy-dev] fast

Maciej Fijalkowski fijall at gmail.com
Sun Jan 11 13:26:22 CET 2009


We had this discussion couple of times already, but I'll try to recap.

On Sun, Jan 11, 2009 at 12:57 PM, inhahe <inhahe at gmail.com> wrote:
> With trace trees, hidden classes, aggressive type speculation, etc.,
> javascript engines run code about as fast as unoptimized C.
> And I know that Python isn't any more intractable than Javascript
> because pyjamas automatically translates from one to the other.

Well, wrong:

1. pyjamas is translating python syntax to js syntax (even not all of
them). Which mean mostly that semantics are python. That said, you
cannot run the same program under python and under js after pyjamas
and expect the same result. Simple example would be as follow:

d[index]

In python, if d is a dictionary, this will raise KeyError, if d is a
list this will raise IndexError, if d is a custom object, it'll try to
call it's __getitem__. In JS however (after pyjamas) this will simply
be translated to d[index], which will return undefined if index is not
there (and not raise any exception).

2. python is far more complex than javascript, someone tried to count
LOC of our python implementation vs our javascript implementation and
it was something in order of 6-10x more code for python. It's also far
more dynamic.

3. Psyco runs programs (let's say integer computations) as far as
unoptimized C. Our prototype JIT does as well and we're working hard
on improving things (in fact we work a lot on JIT these days).

>
> So however you're doing it now.. you're doing it wrong. ;)

Well, tell us how to do it better/faster? Your points are rather
shallow as it seems you didn't look into anything in detail. Look
deeper, maybe you can give us a useful advice.

>
> If CPython won't do it, maybe you will..

Thanks for trust :)

cheers,
fijal



More information about the Pypy-dev mailing list