[Sugar-devel] python hulahop article

Benjamin Smedberg benjamin at smedbergs.us
Mon Jul 27 12:17:51 EDT 2009


On 7/27/09 11:28 AM, Luke Kenneth Casson Leighton wrote:
> On 7/27/09, Brendan Eich <brendan at mozilla.com> wrote:
>> XPCOM is self-deprecating. It's excessively costly for both callers and
>> implementors of its interfaces, both in runtime overhead and in
>> expressiveness restrictions.
> 
>  i'd say that that's a price paid for the incredible power and
> flexibility of what it brings, but hey, nobody said it would be easy
> :)   i'm dead impressed that you got XPCOM right, and that it works as
> expected, by providing seamless inter-language communication - and now
> am a bit puzzled that it's to be deprecated.

Our primary goal is making the fastest and best web platform available.
XPCOM has served its purpose but causes our code to be very verbose and hard
to maintain, in addition to some significant performance penalties.

Seamless inter-language communication was a nice (intentional) by-product of
XPCOM, but is not a core goal as our codebase continues to evolve.

All of the web APIs are defined and tested in terms of their reflection into
JS. The future for PyXPCOM and the other language bridges is to be a
reflection of JS, not a reflection of binary-xpcom.

There is already a binary reflection of basic JS in the form of NPObject
which is used by plugins. It's possible that PyXPCOM could reflect itself in
terms of the NPObject API: this might even give you compatibility with other
engines which support the NPAPI/NPOBject (Safari/Chrome/Opera). On the other
hand using raw JSAPI calls would be faster, removing a layer of indirection.

>> We aren't going to drop it but we are already
>> optimizing around it, and removing it in future APIs.
> 
>  mmm, history will tell if that's a mistake or not.  please don't
> remove it _until_ the new API which replaces python-xpcom is fully
> completed.  that would _definitely_ be a mistake.

We are not going to intentionally break other reflection layers without good
reason, but neither are we going to slow down with improvements to the
Mozilla platform in order for non-core functions like PyXPCOM to catch up.
Our primary focus needs to be staying competitive as a web platform/browser
and improving the readability/maintainability of our codebase.

--BDS


More information about the Sugar-devel mailing list