[pypy-dev] re-boxing of CPython types.

William Leslie william.leslie.ttg at gmail.com
Thu Apr 23 09:02:12 CEST 2009


Hello!

2009/4/23 Luke Kenneth Casson Leighton <lkcl at lkcl.net>:
>>> however i believe that it would be relatively easy to go from this
>>> "good enough" / "relaxed" mode to "full python compliance" - the
>>> "strict" mode as i call it.
>>
>>
>> Exactly how? How do you map real python to javascript without killing the
>> performance gain any js interpreter is going to give you?
>
>  ahh, i'm _so_ glad you asked :)
>
>  one way to explain it is:
>

[description of how to have cpython call back to javascript for implementation?]

I don't think that's what Leonardo was getting at, but rather that if
you have to support python semantics, at some point you've got to deal
with that overhead. For example, you have to do bounds checking on all
list subscription, because javascript won't raise exceptions for you
in that case. I couldn't work it out poking about in the source how
pyjamas deals with this, or the MRO, or python's scoping rules, et
cetera.

The point then is you're now implementing all those semantics in
javascript rather than C, so you're dealing with an extra level of
abstraction.

William Leslie



More information about the Pypy-dev mailing list