<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: PyXPCOM vs. jsbridge</title>
	<atom:link href="http://www.toolness.com/wp/?feed=rss2&#038;p=486" rel="self" type="application/rss+xml" />
	<link>http://www.toolness.com/wp/?p=486</link>
	<description>The Blog of Atul Varma</description>
	<pubDate>Tue, 07 Sep 2010 09:56:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
		<item>
		<title>By: error fix</title>
		<link>http://www.toolness.com/wp/?p=486#comment-3611</link>
		<dc:creator>error fix</dc:creator>
		<pubDate>Mon, 16 Aug 2010 12:04:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.toolness.com/wp/?p=486#comment-3611</guid>
		<description>We do this all the time in Komodo. Python works similarly, you don’t need to createInstance on a python object to pass it through xpcom, so long as the com_interface is defined in the class. That helps to reduce overhead on the python side.</description>
		<content:encoded><![CDATA[<p>We do this all the time in Komodo. Python works similarly, you don’t need to createInstance on a python object to pass it through xpcom, so long as the com_interface is defined in the class. That helps to reduce overhead on the python side.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shane Caraveo</title>
		<link>http://www.toolness.com/wp/?p=486#comment-1559</link>
		<dc:creator>Shane Caraveo</dc:creator>
		<pubDate>Fri, 13 Feb 2009 19:21:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.toolness.com/wp/?p=486#comment-1559</guid>
		<description>I thought I'd comment on a couple points.  Not trying to be an XPCOM fanboy, and jsbridge looks very interesting, just relating my experience with PyXPCOM.

You don't need to write xpcom wrappers to use js objects as xpcom objects unless...the other language needs to createInstance/getService to get the object.  If you want to pass a js object from chrome to a pyxpcom instance (in fact any xpcom instance), you only need to be sure your js class implements the functions defined in IDL for the interface you are calling.  jsconnect handles the magic for you.  We do this all the time in Komodo.  Python works similarly, you don't need to createInstance on a python object to pass it through xpcom, so long as the com_interface is defined in the class.  That helps to reduce overhead on the python side.

XPCOM is really not that slow (it's not blazing fast either) unless you are iterating over something across XPCOM boundaries.  We often unwrap the object if it's a python xpcom object, or rearchitect a bit to avoid those situations.  At this point, when we have performance issues, it's almost never an XPCOM issue.

Using the system python is fine so long as you are not involving binary components or the user builds the components on their system.  Mozilla is built with UCS2, linux distros vary between UCS2 and UCS4 for at least the python build.  That can cause havoc to say the least.  The other issue of course is, the user upgrading some module that then breaks your application.  

Small or non-binary based projects may not run into these issues, but they are significant for larger projects that do binary distros.  For example, if PyXPCOM were part of Firefox, IMO Firefox would be distributing/embeding python to avoid these issues.  Firefox actually has lots of home-grown or embeded code (expat is an example) rather than relying on system provided code to avoid dependencies on external systems.</description>
		<content:encoded><![CDATA[<p>I thought I&#8217;d comment on a couple points.  Not trying to be an XPCOM fanboy, and jsbridge looks very interesting, just relating my experience with PyXPCOM.</p>
<p>You don&#8217;t need to write xpcom wrappers to use js objects as xpcom objects unless&#8230;the other language needs to createInstance/getService to get the object.  If you want to pass a js object from chrome to a pyxpcom instance (in fact any xpcom instance), you only need to be sure your js class implements the functions defined in IDL for the interface you are calling.  jsconnect handles the magic for you.  We do this all the time in Komodo.  Python works similarly, you don&#8217;t need to createInstance on a python object to pass it through xpcom, so long as the com_interface is defined in the class.  That helps to reduce overhead on the python side.</p>
<p>XPCOM is really not that slow (it&#8217;s not blazing fast either) unless you are iterating over something across XPCOM boundaries.  We often unwrap the object if it&#8217;s a python xpcom object, or rearchitect a bit to avoid those situations.  At this point, when we have performance issues, it&#8217;s almost never an XPCOM issue.</p>
<p>Using the system python is fine so long as you are not involving binary components or the user builds the components on their system.  Mozilla is built with UCS2, linux distros vary between UCS2 and UCS4 for at least the python build.  That can cause havoc to say the least.  The other issue of course is, the user upgrading some module that then breaks your application.  </p>
<p>Small or non-binary based projects may not run into these issues, but they are significant for larger projects that do binary distros.  For example, if PyXPCOM were part of Firefox, IMO Firefox would be distributing/embeding python to avoid these issues.  Firefox actually has lots of home-grown or embeded code (expat is an example) rather than relying on system provided code to avoid dependencies on external systems.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Lee</title>
		<link>http://www.toolness.com/wp/?p=486#comment-1552</link>
		<dc:creator>Steve Lee</dc:creator>
		<pubDate>Thu, 12 Feb 2009 09:52:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.toolness.com/wp/?p=486#comment-1552</guid>
		<description>For the Maavis Firefox extensions I used a fork of the Outfox js/xul/Python connectivity platform (simple JSON message passing). I skipped the JS as is all XUL. This works well enough for simple purposes. 

I chose to package up python with py2exe but take on board your Python as platform thoughts. In my case ease of installation was important and py2exe takes care of all the dependent modules as well plus avoids side-by-sdie python version issues on Windows (only one is the default).

http://www.assembla.com/wiki/show/maavis
http://code.google.com/p/outfox/</description>
		<content:encoded><![CDATA[<p>For the Maavis Firefox extensions I used a fork of the Outfox js/xul/Python connectivity platform (simple JSON message passing). I skipped the JS as is all XUL. This works well enough for simple purposes. </p>
<p>I chose to package up python with py2exe but take on board your Python as platform thoughts. In my case ease of installation was important and py2exe takes care of all the dependent modules as well plus avoids side-by-sdie python version issues on Windows (only one is the default).</p>
<p><a href="http://www.assembla.com/wiki/show/maavis" rel="nofollow">http://www.assembla.com/wiki/show/maavis</a><br />
<a href="http://code.google.com/p/outfox/" rel="nofollow">http://code.google.com/p/outfox/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alvin Wang</title>
		<link>http://www.toolness.com/wp/?p=486#comment-1551</link>
		<dc:creator>Alvin Wang</dc:creator>
		<pubDate>Wed, 11 Feb 2009 23:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.toolness.com/wp/?p=486#comment-1551</guid>
		<description>I had the same issue when I started developing a Cross-cloud control application.  I could embed Python into it but it was a waste.  I turned the whole thing into a Python module and open sourced it instead.  For those that are interested, it is at http://code.google.com/p/cloudwizard/</description>
		<content:encoded><![CDATA[<p>I had the same issue when I started developing a Cross-cloud control application.  I could embed Python into it but it was a waste.  I turned the whole thing into a Python module and open sourced it instead.  For those that are interested, it is at <a href="http://code.google.com/p/cloudwizard/" rel="nofollow">http://code.google.com/p/cloudwizard/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
