Good news all around! &nbsp;Thanks for sending this out guys.<br><br>Paul<br><br><br><div><span class="gmail_quote">On 10/3/07, <b class="gmail_sendername">Armin Rigo</b> &lt;<a href="mailto:arigo@tunes.org">arigo@tunes.org</a>
&gt; wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
Hi all,<br><br>A quick note to tell you some new things that PyPy can do since the 1.0<br>release: more built-in modules, PyPy-on-Java-VMs, and secure sandboxing<br>for Python.<br><br>In more details:<br><br><br>* Threads and weakrefs are now working properly.&nbsp;&nbsp;(There is a GIL -
<br>&nbsp;&nbsp;global lock - just like in CPython for now.)&nbsp;&nbsp;(As in the 1.0 release,<br>&nbsp;&nbsp;you can also have stackless &amp; greenlets instead of threads.)<br><br><br>* Some missing built-in modules have been written, like zlib.<br>
&nbsp;&nbsp;The complete list of known-to-be-working built-in modules is:<br><br>&nbsp;&nbsp;&nbsp;&nbsp; _codecs, gc, _weakref, array, marshal, errno,<br>&nbsp;&nbsp;&nbsp;&nbsp; math, _sre (regular expressions), operator, symbol, _random,<br>&nbsp;&nbsp;&nbsp;&nbsp; _socket, unicodedata, mmap, fcntl, time, select,
<br>&nbsp;&nbsp;&nbsp;&nbsp; crypt, signal, readline (only readline.readline()),<br>&nbsp;&nbsp;&nbsp;&nbsp; termios, zlib, struct, md5, sha<br><br>&nbsp;&nbsp;Of course, all the standard library of Python 2.4, written in Python,<br>&nbsp;&nbsp;works out of the box.&nbsp;&nbsp;Also, the following modules have a working pure
<br>&nbsp;&nbsp;Python implementation in PyPy: binascii, cPickle, cStringIO, cmath,<br>&nbsp;&nbsp;collections, datetime, functional, imp, itertools.<br><br><br>* These two facts together mean that pypy-c can now run some very<br>&nbsp;&nbsp;serious programs, like the server for the bub-n-bros game :-)
<br>&nbsp;&nbsp;I&#39;ve also successfully used py.execnet for a while.<br><br><br>* Antonio and Niko are doing some very good work on the Java backend.<br>&nbsp;&nbsp;With minor tweaks we can now build a pypy-jvm.&nbsp;&nbsp;FWIW it seems to give<br>
&nbsp;&nbsp;better performance than Jython.&nbsp;&nbsp;It&#39;s not 100% comparable because<br>&nbsp;&nbsp;pypy-jvm is not thread-aware or thread-safe yet, while Jython gives<br>&nbsp;&nbsp;you free threading; OTOH pypy-jvm doesn&#39;t generate Java bytecodes<br>
&nbsp;&nbsp;on-the-fly (although it might do so in the future).&nbsp;&nbsp;All in all<br>&nbsp;&nbsp;pypy-jvm is still experimental, but stay tuned :-)<br><br><br>* Sandboxing: it is possible to compile a version of pypy-c that runs<br>&nbsp;&nbsp;fully &quot;virtualized&quot;, 
i.e. where an external process controls all<br>&nbsp;&nbsp;input/output.&nbsp;&nbsp;Such a pypy-c is a secure sandbox: it is safe to run<br>&nbsp;&nbsp;any untrusted Python code with it.&nbsp;&nbsp;The Python code cannot see or<br>&nbsp;&nbsp;modify any local file except via interaction with the external
<br>&nbsp;&nbsp;process.&nbsp;&nbsp;It is also impossible to do any other I/O or consume more<br>&nbsp;&nbsp;than some amount of RAM or CPU time or real time.&nbsp;&nbsp;This works with no<br>&nbsp;&nbsp;OS support at all - just ANSI C code generated in a careful way.&nbsp;&nbsp;It&#39;s
<br>&nbsp;&nbsp;the kind of thing you could embed in a browser plug-in, for example<br>&nbsp;&nbsp;(it would be safe even if it wasn&#39;t run as a separate process,<br>&nbsp;&nbsp;actually).<br><br>&nbsp;&nbsp;For comparison, trying to plug CPython into a special virtualizing C
<br>&nbsp;&nbsp;library is not only OS-specific, but unsafe, because one of the known<br>&nbsp;&nbsp;ways to segfault CPython could be used by an attacker to trick CPython<br>&nbsp;&nbsp;into issuing malicious system calls directly.&nbsp;&nbsp;The C code generated by
<br>&nbsp;&nbsp;PyPy is not segfaultable, as long as our code generators are correct -<br>&nbsp;&nbsp;that&#39;s a lower number of lines of code to trust.&nbsp;&nbsp;For the paranoid, in<br>&nbsp;&nbsp;this case we also generate systematic run-time checks against buffer
<br>&nbsp;&nbsp;overflows.<br><br>&nbsp;&nbsp;For more information on this topic please see:<br>&nbsp;&nbsp;<a href="http://codespeak.net/pypy/dist/pypy/doc/sandbox.html">http://codespeak.net/pypy/dist/pypy/doc/sandbox.html</a><br><br><br>Thanks,<br><br>
Armin &amp; cfbolz around<br>_______________________________________________<br><a href="mailto:pypy-dev@codespeak.net">pypy-dev@codespeak.net</a><br><a href="http://codespeak.net/mailman/listinfo/pypy-dev">http://codespeak.net/mailman/listinfo/pypy-dev
</a><br></blockquote></div><br>