Source / features.html

<!DOCTYPE html>
	<title>PyPy :: Features</title>
	<meta http-equiv="content-language" content="en" />
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="author" content="PyPy Team" />
	<meta name="description" content="PyPy" />
	<meta name="copyright" content="MIT" />
	<meta name="document-rating" content="general" />
	<link rel="stylesheet" type="text/css" media="screen" title="default" href="css/site.css" />
	<link rel="alternate" type="application/rss+xml" title="RSS Feed for PyPy" href="" />
  <link rel="stylesheet" type="text/css" href="css/jquery-ui-1.8.14.custom.css" />
	<script type="text/javascript" src=""></script>
	<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
	<script type="text/javascript" src=""></script>
  <script type="text/javascript" src="js/jquery-ui-1.8.14.custom.min.js"></script>
  <script type="text/javascript" src="js/detect.js"></script>
  <script type="text/javascript" src="js/script2.js?bust=1"></script>
<script type="text/javascript">
	var _gaq = [['_setAccount', 'UA-7778406-3'], ['_trackPageview']];
	if (document.location.protocol !== 'file:') {
		(function() {
			var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
			ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
			(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
<div id="body-outer"><div id="body-inner"><div id="body" class="clearfix">
<div id="header">
	<div id="menu-follow">
		<div><a href="" title="Follow the conversation on Twitter"><img src="" alt="Follow the conversation on Twitter" width="14px" height="14px" /></a></div>
    <div><a href=""><img src="" width="14px" height="14px" /></a></div>
		<div><a href="" title="Subscribe to the RSS Feed"><img src="" alt="Subscribe to the RSS Feed" width="14px" height="14px" /></a></div>
	<div id="logo"><a href=""><img src="image/pypy-logo.png" alt="PyPy" height="110px" /></a></div>
	<hr class="clear-left" />
	<div id="menu-sub"><a href="index.html">Home</a><span class="menu-sub-sep"> | </span><a href="features.html">Features</a><span class="menu-sub-sep"> | </span><a href="download.html">Download</a><span class="menu-sub-sep"> | </span><a href="compat.html">Compatibility</a><span class="menu-sub-sep"> | </span><a href="performance.html">Performance</a><span class="menu-sub-sep"> | </span><a href="">Dev Documentation</a><span class="menu-sub-sep"> | </span><a href="">Blog</a><span class="menu-sub-sep"> | </span><a href="people.html">People</a><span class="menu-sub-sep"> | </span><a href="contact.html">Contact</a><span class="menu-sub-sep"> | </span><a href="py3donate.html">Py3k donations</a><span class="menu-sub-sep"> | </span><a href="numpydonate.html">NumPy donations</a><span class="menu-sub-sep"> | </span><a href="tmdonate.html">STM/AME donations</a></div>
	<hr class="clear" />
<div id="content">
<div id="main">
<h1 class="title">Features</h1>
<p><strong>PyPy 2.0 beta1</strong> implements <strong>Python 2.7.3</strong> and runs on Intel
<a class="reference external" href="">x86 (IA-32)</a> , <a class="reference external" href="">x86_64</a> and <a class="reference external" href="">ARM</a> platforms, with PPC being underway.
It supports all of the core language, passing the Python test suite
(with minor modifications that were already accepted in the main python
in newer versions). It supports most of the commonly used Python
standard library modules.  For known differences with CPython, see our
<a class="reference external" href="compat.html">compatibility</a> page.</p>
<p>If you are interested in helping to move forward, see our <a class="reference external" href="howtohelp.html">howtohelp</a> page.</p>
<div class="section" id="speed">
<p>Our <a class="reference external" href="download.html#with-a-jit-compiler">main executable</a> comes with a Just-in-Time compiler.  It is
<a class="reference external" href="">really fast</a> in running most benchmarks.  <a class="reference external" href="download.html#with-a-jit-compiler">Try it out!</a></p>
<div class="section" id="sandboxing">
<p>PyPy's <em>sandboxing</em> is a working prototype for the idea of running untrusted
user programs. Unlike other sandboxing approaches for Python, PyPy's does not
try to limit language features considered &ldquo;unsafe&rdquo;. Instead we replace all
calls to external libraries (C or platform) with a stub that communicates
with an external process handling the policy.</p>
<p>To run the sandboxed process, you need <a class="reference external" href="download.html#sandboxed-version">pypy-sandbox</a>.  You also need to
get the <a class="reference external" href="download.html#translate">full sources</a> (step 1 only).  Run:</p>
<pre class="literal-block">
cd pypy/pypy/translator/sandbox path/to/pypy-sandbox
<p>You get a fully sandboxed interpreter, in its own filesystem hierarchy
(try <tt class="docutils literal"><span class="pre">os.listdir('/')</span></tt>).  For example, you would run an untrusted
script as follows:</p>
<pre class="literal-block">
mkdir virtualtmp
cp virtualtmp/ --tmp=virtualtmp pypy-sandbox /tmp/
<p>Note that the path <tt class="docutils literal">/tmp/</tt> is a path inside the sandboxed
filesystem.  You don't have to put <tt class="docutils literal"></tt> in the real <tt class="docutils literal">/tmp</tt>
directory at all.</p>
<p>To read more about its features, try <tt class="docutils literal"> <span class="pre">--help</span></tt> or go to
<a class="reference external" href="">our documentation site</a>.</p>
<div class="section" id="stackless">
<p>Support for <a class="reference external" href="">Stackless</a> and greenlets are now integrated in the normal
PyPy.  More detailed information is available <a class="reference external" href="">here</a>.</p>
<p>Note that there is still an important performance hit for programs using
Stackless features.</p>
<div class="section" id="other-features">
<h1>Other features</h1>
<p>PyPy has many secondary features and semi-independent
projects.  We will mention here:</p>
<ul class="simple">
<li><strong>the .NET backend:</strong> you get a version of <tt class="docutils literal"><span class="pre">pypy-net</span></tt> that runs
natively in the .NET/CLI VM.  Of particular interest is <a class="reference external" href="">the cli-jit
branch</a>, in which you can make a version of <tt class="docutils literal"><span class="pre">pypy-net</span></tt> which also
contains a high-level JIT compiler (it compiles your Python programs
Just in Time into CLR bytecodes, which are in turn compiled natively
by the VM).</li>
<li><strong>the Java backend:</strong> PyPy can run on the Java VM, but more care is
needed to finish this project. Writing a backend for our high-level
JIT compiler would be excellent.  <a class="reference external" href="contact.html">Contact us</a>!</li>
<li><strong>Other languages:</strong>  we also implemented other languages that makes
use of our RPython toolchain: <a class="reference external" href="">Prolog</a> (almost complete), as
well as <a class="reference external" href="">Smalltalk</a>, <a class="reference external" href="">JavaScript</a>, <a class="reference external" href="">Io</a>, <a class="reference external" href="">Scheme</a> and <a class="reference external" href="">Gameboy</a>.</li>
<div id="sidebar">