Just wanna say a quick thanks to all of you here, <br><br>Very informative. <br><br>Thanks,<br><br><div class="gmail_quote">On Sun, Oct 9, 2011 at 11:08 AM, Steven D&#39;Aprano <span dir="ltr">&lt;<a href="mailto:steve@pearwood.info">steve@pearwood.info</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">Walter Prins wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
As for the compiler/interpreter argument, I&#39;ll just point out again that<br>
actually Python in its various forms can either be compiled and/or<br>
interepreted, it depends on you really.  For compiled Python flavours, see<br>
for example Cython (<a href="http://cython.org/" target="_blank">http://cython.org/</a>) which provides a way to write C/C++<br>
modules for Python effectively in Python syntax.  (Cython arguably also<br>
makes the &quot;need to write wrapper&quot; comment a moot point.)   <br>
</blockquote>
<br></div>
Cython is not Python. It is a separate language similar to Python, based on Python, but not actually Python. It&#39;s actually a superset of Python. Any Python code should be legal in Cython, but not all Cython code is legal in Python.<br>

<br>
See, for example:<br>
<br>
<a href="http://docs.cython.org/src/userguide/tutorial.html#primes" target="_blank">http://docs.cython.org/src/<u></u>userguide/tutorial.html#primes</a><br>
<br>
and notice that the Cython code:<br>
<br>
<br>
def primes(int kmax):<br>
    cdef int n, k, i<br>
    cdef int p[1000]<br>
    # ...<br>
<br>
gives you a SyntaxError in Python.<br>
<br>
Credit where credit is due: Cython is a wonderful tool and very useful to anyone wanting to write C extensions for Python, but it isn&#39;t Python. That&#39;s not a limitation or a bad thing: it couldn&#39;t do what it sets out to do if it were Python.<br>

<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Or see Shedskin (<div class="im"><br>
<a href="http://shed-skin.blogspot.com/" target="_blank">http://shed-skin.blogspot.com/</a><u></u>), a Python to C++ static compiler), <br>
</div></blockquote>
<br>
<br>
Shedskin, on the other hand, is a subset of Python: it can only work with a restricted set of Python features. So also not Python.<br>
<br>
<a href="http://code.google.com/p/shedskin/" target="_blank">http://code.google.com/p/<u></u>shedskin/</a><br>
<br>
But still a very useful and valuable tool.<div class="im"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
or Psyco<br>
(<a href="http://psyco.sourceforge.net/introduction.html" target="_blank">http://psyco.sourceforge.net/<u></u>introduction.html</a> ), a JIT (Just In Time)<br>
compiler for CPython.  <br>
</blockquote>
<br></div>
Psyco, on the other hand, is an add-on to Python: it runs inside the CPython compiler, as an importable module, rather than being a separate Python interpreter.<div class="im"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Or see Pypy (<a href="http://pypy.org/" target="_blank">http://pypy.org/</a>) which is another<br>
reimplementation of the Python language with an optimizing JIT compiler.<br>
(The following post re realtime image processing in Python is rather<br>
impressive:<br>
<a href="http://morepypy.blogspot.com/2011/07/realtime-image-processing-in-python.html" target="_blank">http://morepypy.blogspot.com/<u></u>2011/07/realtime-image-<u></u>processing-in-python.html</a>)<br>
</blockquote>
<br>
<br></div>
PyPy is very impressive, and it truly is an independent implementation of Python, like CPython, Jython, IronPython and Stackless. It is faster than CPython (although requires more memory) and in certain restricted micro-benchmarks faster than C.<br>

<br>
Yes, faster than C.<br>
<br>
<a href="http://morepypy.blogspot.com/2008/01/rpython-can-be-faster-than-c.html" target="_blank">http://morepypy.blogspot.com/<u></u>2008/01/rpython-can-be-faster-<u></u>than-c.html</a><br>
<a href="http://morepypy.blogspot.com/2011/02/pypy-faster-than-c-on-carefully-crafted.html" target="_blank">http://morepypy.blogspot.com/<u></u>2011/02/pypy-faster-than-c-on-<u></u>carefully-crafted.html</a><br>
<a href="http://morepypy.blogspot.com/2011/08/pypy-is-faster-than-c-again-string.html" target="_blank">http://morepypy.blogspot.com/<u></u>2011/08/pypy-is-faster-than-c-<u></u>again-string.html</a><br>
<br>
<br>
<br>
This just goes to show that *languages* aren&#39;t faster or slower than other languages. Languages just are. But *implementations* can be faster or slower.<br><font color="#888888">
<br>
<br>
<br>
-- <br>
Steven</font><div><div></div><div class="h5"><br>
______________________________<u></u>_________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/tutor</a><br>
</div></div></blockquote></div><br>