<?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: Attacking PyPy</title>
	<atom:link href="http://www.philhassey.com/blog/2007/11/30/attacking-pypy/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.philhassey.com/blog/2007/11/30/attacking-pypy/</link>
	<description>games, tech, web, stuff, biz, and bilge</description>
	<pubDate>Wed, 03 Dec 2008 06:58:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: philhassey</title>
		<link>http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-217</link>
		<dc:creator>philhassey</dc:creator>
		<pubDate>Sat, 01 Dec 2007 22:54:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-217</guid>
		<description>Chris - 

shed-skin only translates programs that are written in it's version of Rpython.  Both PyPy's Rpython and shed-skin's Rpython support roughly the same sub-set python.

The notable difference between the code outputted is:

shed-skin produces human readable C++ code (with C++ classes, namespaces, etc)
PyPy produces (fairly) unreadable C code.

Phil</description>
		<content:encoded><![CDATA[<p>Chris - </p>
<p>shed-skin only translates programs that are written in it&#8217;s version of Rpython.  Both PyPy&#8217;s Rpython and shed-skin&#8217;s Rpython support roughly the same sub-set python.</p>
<p>The notable difference between the code outputted is:</p>
<p>shed-skin produces human readable C++ code (with C++ classes, namespaces, etc)<br />
PyPy produces (fairly) unreadable C code.</p>
<p>Phil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christopher Armstrong</title>
		<link>http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-216</link>
		<dc:creator>Christopher Armstrong</dc:creator>
		<pubDate>Sat, 01 Dec 2007 22:18:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-216</guid>
		<description>There's a major difference: ShedSkin is a general Python to C++ translator. PyPy's translator translated your *R*Python to C. ShedSkin has to do a lot more work to make sure that it supports all the dynamism of Python, whereas the C backend just needs to support the very non-dynamic RPython.</description>
		<content:encoded><![CDATA[<p>There&#8217;s a major difference: ShedSkin is a general Python to C++ translator. PyPy&#8217;s translator translated your *R*Python to C. ShedSkin has to do a lot more work to make sure that it supports all the dynamism of Python, whereas the C backend just needs to support the very non-dynamic RPython.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philhassey</title>
		<link>http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-215</link>
		<dc:creator>philhassey</dc:creator>
		<pubDate>Sat, 01 Dec 2007 17:28:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-215</guid>
		<description>Nothing comes to mind other than C vs C++ overhead.</description>
		<content:encoded><![CDATA[<p>Nothing comes to mind other than C vs C++ overhead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Dufour</title>
		<link>http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-212</link>
		<dc:creator>Mark Dufour</dc:creator>
		<pubDate>Sat, 01 Dec 2007 11:18:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-212</guid>
		<description>hi phil,

any idea where the 30% difference stems from? possibly something minor I might fix?

mark dufour.</description>
		<content:encoded><![CDATA[<p>hi phil,</p>
<p>any idea where the 30% difference stems from? possibly something minor I might fix?</p>
<p>mark dufour.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philhassey</title>
		<link>http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-210</link>
		<dc:creator>philhassey</dc:creator>
		<pubDate>Fri, 30 Nov 2007 16:09:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-210</guid>
		<description>Markus:
Actually - you've got to consider all the SDL binding stuff too .. I did this ages ago, but thanks for the reminder - I think I'll check pyrex out again and see how  it suits me.  Maybe I'll do an article about that next :)

Carl:
Yeah, by PyPy I meant Rpython.  Feel free to do whatever you like with the contents of that .zip file.  public domain as far as I'm concerned.  

You couldn't use ShedSkin's FFI on top of CPython .. ShedSkin's FFI is literally C++ with a few helper classes + you have to write a bit of dummy code in python demonstrating how the functions will be used.  You don't actually have to write any ctypes / rffi -esque stuff.  (Check out my example lib/_gfx.* from my previous post to see what it looks like.)</description>
		<content:encoded><![CDATA[<p>Markus:<br />
Actually - you&#8217;ve got to consider all the SDL binding stuff too .. I did this ages ago, but thanks for the reminder - I think I&#8217;ll check pyrex out again and see how  it suits me.  Maybe I&#8217;ll do an article about that next <img src='http://www.philhassey.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Carl:<br />
Yeah, by PyPy I meant Rpython.  Feel free to do whatever you like with the contents of that .zip file.  public domain as far as I&#8217;m concerned.  </p>
<p>You couldn&#8217;t use ShedSkin&#8217;s FFI on top of CPython .. ShedSkin&#8217;s FFI is literally C++ with a few helper classes + you have to write a bit of dummy code in python demonstrating how the functions will be used.  You don&#8217;t actually have to write any ctypes / rffi -esque stuff.  (Check out my example lib/_gfx.* from my previous post to see what it looks like.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carl Friedrich Bolz</title>
		<link>http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-209</link>
		<dc:creator>Carl Friedrich Bolz</dc:creator>
		<pubDate>Fri, 30 Nov 2007 14:57:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-209</guid>
		<description>Yay, that is extremely cool! We should steal that SDL wrapper :-). Can you test ShedSkin's FFI on top of CPython without translating the program first?</description>
		<content:encoded><![CDATA[<p>Yay, that is extremely cool! We should steal that SDL wrapper :-). Can you test ShedSkin&#8217;s FFI on top of CPython without translating the program first?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Markus Gritsch</title>
		<link>http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-205</link>
		<dc:creator>Markus Gritsch</dc:creator>
		<pubDate>Fri, 30 Nov 2007 13:53:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-205</guid>
		<description>Nice posts.  To make the list (ShedSkin, PyPy) complete, you can also use Pyrex (http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/) to build amazingly fast extension modules.  Some time ago I also played around with some Mandelbrot examples.  Here is the Pyrex code for the inner loop:

def performIterations (double p_a, double p_b, long p_max):
    cdef double r, i, x, y, d
    r = i = x = y = d = 0.0
    cdef long n
    n = 0
    while d &#60; 4.0 and n &#60; p_max:
        x = r; y = i;
        r = x * x - y * y + p_a
        i = 2 * x * y + p_b
        d = r * r + i * i
        n = n + 1
    return n

The advantage is, that Pyrex compiles the above code to C-Code, which can then be compiled to a .pyd.  On Windows for example, the size of this .pyd is only 8 kB.  No other library is needed in contrast to ShedSkin.</description>
		<content:encoded><![CDATA[<p>Nice posts.  To make the list (ShedSkin, PyPy) complete, you can also use Pyrex (http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/) to build amazingly fast extension modules.  Some time ago I also played around with some Mandelbrot examples.  Here is the Pyrex code for the inner loop:</p>
<p>def performIterations (double p_a, double p_b, long p_max):<br />
    cdef double r, i, x, y, d<br />
    r = i = x = y = d = 0.0<br />
    cdef long n<br />
    n = 0<br />
    while d &lt; 4.0 and n &lt; p_max:<br />
        x = r; y = i;<br />
        r = x * x - y * y + p_a<br />
        i = 2 * x * y + p_b<br />
        d = r * r + i * i<br />
        n = n + 1<br />
    return n</p>
<p>The advantage is, that Pyrex compiles the above code to C-Code, which can then be compiled to a .pyd.  On Windows for example, the size of this .pyd is only 8 kB.  No other library is needed in contrast to ShedSkin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xtian</title>
		<link>http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-203</link>
		<dc:creator>xtian</dc:creator>
		<pubDate>Fri, 30 Nov 2007 07:22:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/11/30/attacking-pypy/#comment-203</guid>
		<description>Cool!

When you say "implemented in PyPy", do you mean you implemented it in RPython?</description>
		<content:encoded><![CDATA[<p>Cool!</p>
<p>When you say &#8220;implemented in PyPy&#8221;, do you mean you implemented it in RPython?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
