<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ikke&#039;s blog &#187; webkit</title>
	<atom:link href="http://eikke.com/tag/webkit/feed/" rel="self" type="application/rss+xml" />
	<link>http://eikke.com</link>
	<description>&#039;cause this is what I do</description>
	<lastBuildDate>Sun, 13 Feb 2011 14:58:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Embedding JavaScript in Python</title>
		<link>http://eikke.com/embedding-javascript-in-python/</link>
		<comments>http://eikke.com/embedding-javascript-in-python/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 23:05:16 +0000</pubDate>
		<dc:creator>Nicolas</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[javascriptcore]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://eikke.com/embedding-javascript-in-python/</guid>
		<description><![CDATA[Reading some posts about embedding languages/runtimes in applications on Planet GNOME reminded me I still had to announce some really quick and incomplete code blob I created some days after last GUADEC edition (which was insanely cool, thanks guys). It takes WebKit&#8216;s JavaScriptCore and allows you to embed it in some Python program, so you, [...]]]></description>
			<content:encoded><![CDATA[<p>Reading some posts about embedding languages/runtimes in applications on <a href="http://planet.gnome.org" title="Planet GNOME">Planet GNOME</a> reminded me I still had to announce some really quick and incomplete code blob I created some days after last <a href="http://www.guadec.org" title="GUADEC">GUADEC</a> edition (which was insanely cool, thanks guys).</p>
<p>It takes <a href="http://www.webkit.org" title="WebKit">WebKit</a>&#8216;s JavaScriptCore and allows you to embed it in some <a href="http://www.python.org" title="Python">Python</a> program, so you, as a Python developer, can allow consumers to write plugins using JavaScript. Don&#8217;t ask me whether it&#8217;s useful, maybe it&#8217;s not, but anyway.</p>
<p>There&#8217;s one catch: currently there is no support to expose custom Python objects to the JavaScript runtime: you&#8217;re able to use JavaScript objects and functions etc. from within Python, but not the other way around. I started working on this, but the JSCore API lacked some stuff to be able to implement this cleanly (or I missed a part of it, that&#8217;s possible as well), maybe it has changed by now&#8230; There is transparent translation of JavaScript base types: unicode strings, booleans, null (which becomes None in Python), undefined (which becomes jscore.UNDEFINED) and floats.</p>
<p>I did not work on the code for quite a long time because of too much real-job-work, maybe it no longer compiles, sorry&#8230; Anyway, it&#8217;s available in git <a href="http://git.nicolast.be/?p=python-jscore.git;a=summary" title="python-jscore git">here</a>, patches welcome etc. I guess <a href="http://git.nicolast.be/?p=python-jscore.git;a=blob;f=test/test_object.py;h=1604e4db7bb1e9333bcbed305ec3107921708ab0;hb=HEAD#l261">this</a> is the best sample code around. It&#8217;s using <a href="http://www.cython.org" title="Cython">Cython</a> for compilation (never tried with Pyrex, although this might work as well). If anyone can use it, great, if not, too bad, I did learn Cython doing this <img src='http://eikke.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://eikke.com/embedding-javascript-in-python/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

