<?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>Digitivity &#187; compiler</title>
	<atom:link href="http://digitivity.org/tag/compiler/feed" rel="self" type="application/rss+xml" />
	<link>http://digitivity.org</link>
	<description>The Digital Productivity Blog</description>
	<lastBuildDate>Sat, 24 Dec 2011 17:34:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Facebook Announces a Better, Faster PHP: HipHop PHP</title>
		<link>http://digitivity.org/771/facebook-announces-a-better-faster-php-hiphop-php-c-plus-plus-compiler</link>
		<comments>http://digitivity.org/771/facebook-announces-a-better-faster-php-hiphop-php-c-plus-plus-compiler#comments</comments>
		<pubDate>Wed, 03 Feb 2010 17:52:31 +0000</pubDate>
		<dc:creator>Digitivity</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[HipHop]]></category>
		<category><![CDATA[HPHP]]></category>
		<category><![CDATA[HPHPi]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://digitivity.org/?p=771</guid>
		<description><![CDATA[<p>Posted in <a href="http://digitivity.org/category/audience/developer" title="Developer">Developer</a></p>PHP is the programming language that runs many web applications, including WordPress. PHP's slower than many other languages, but it's fast to develop in.

Now Facebook, which also runs on PHP, has announced a new version of PHP that runs twice as fast. 



Related posts:<ol><li><a href='http://digitivity.org/165/how-facebook-runs-php-and-mysql' rel='bookmark' title='Permanent Link: How Facebook Runs PHP and MySQL'>How Facebook Runs PHP and MySQL</a></li>
<li><a href='http://digitivity.org/1034/heises-2-click-solution-for-facebook-privacy' rel='bookmark' title='Permanent Link: Heise&#8217;s 2-Click Solution for Facebook Privacy'>Heise&#8217;s 2-Click Solution for Facebook Privacy</a></li>
<li><a href='http://digitivity.org/1111/facebook-timeline-will-let-you-know-who-unfriended-you' rel='bookmark' title='Permanent Link: Facebook Timeline Will Let You Know Who Unfriended You'>Facebook Timeline Will Let You Know Who Unfriended You</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>PHP</strong> is the <strong>programming language</strong> that runs many web applications, including <strong>WordPress</strong>. PHP&#8217;s slower than many other languages, but it&#8217;s fast to develop in.</p>
<p>Now <strong>Facebook</strong>, which also runs on PHP, has <a href="http://developers.facebook.com/news.php?blog=1&amp;story=358">announced</a> a <strong>new version</strong> of PHP that runs <strong>twice as fast</strong>.</p>
<p>This also means that if you have a popular <strong>WordPress blog</strong>, you might only have to have <strong>half the server size</strong> you use now.</p>
<h2>How PHP Works</h2>
<p><img class="alignleft size-full wp-image-774" title="Turtle" src="http://digitivity.org/blog/wp-content/uploads/2010/02/1191761_turtle_2.jpg" alt="Turtle" width="100" height="74" /><br />
<strong> PHP</strong>, in its usual incarnation, is an <strong>interpreted language</strong>. This means that a program (such as a PHP module in the Apache webserver) reads the PHP instructions in your script and executes them in turn. Every time the PHP script is executed, it has to be turned into machine code, even if the script runs 1000 times per hour. Obviously, this is <strong>inefficient</strong>, but people put up with it because PHP is considered easier to develop in than other languages.</p>
<p><img src="http://digitivity.org/blog/wp-content/uploads/2010/02/985320_rabbit.jpg" alt="Rabbit" title="Rabbit" width="100" height="75" class="alignleft size-full wp-image-776" /><br />
By comparison, <strong>C++</strong> is a language which is usually <strong>compiled</strong> (changed to machine instructions which run directly on the <strong>CPU</strong>). This happens only once, and every time the program runs, it runs <strong>directly</strong> on the processor. Because there&#8217;s no intermediate  interpretation step, C++ programs run <strong>much faster</strong>.</p>
<h2>Facebook&#8217;s HipHop PHP</h2>
<p><strong>Facebook</strong> announced what they are calling <strong>HipHop PHP</strong>, which translates PHP into <strong>C++</strong>. Then you use <tt>g++</tt>, the GNU C++ compiler, to compile the C++ program.</p>
<p>Here&#8217;s how the process works:</p>
<div id="attachment_772" class="wp-caption alignnone" style="width: 522px"><a href="http://digitivity.org/blog/wp-content/uploads/2010/02/HipHop_transformation_process.png"><img class="size-medium wp-image-772" title="HipHop PHP Transformation Process" src="http://digitivity.org/blog/wp-content/uploads/2010/02/HipHop_transformation_process-512x320.png" alt="HipHop PHP Transformation Process" width="512" height="320" /></a><p class="wp-caption-text">HipHop PHP Transformation Process</p></div>
<p>Facebook says compilation of their PHP code results in <strong>savings of 50%</strong> in server usage.</p>
<p>They also released <strong>HPHPi</strong>, which is an optimized <strong>PHP interpreter</strong> that doesn&#8217;t require you re-compile your code.</p>
<h3>Download HipHop PHP</h3>
<p>Facebook is going to <strong>release</strong> the code to <strong>HPHP</strong> under the PHP license on <strong>Github</strong> for download at this <a href="http://github.com/facebook/hiphop-php/wikis">address</a> (but it&#8217;s not there yet).</p>
<h2>Caveats</h2>
<p>In order to optimize PHP to the maximum, they left out some rarely used dynamic functionality, such as the <tt>eval()</tt> function.</p>
<p>I&#8217;ll report more on <strong>HipHop PHP</strong> as Facebook releases more information.</p>
<h2>Resources</h2>
<p><a href="http://developers.facebook.com/news.php?blog=1&amp;story=358">Facebook HipHop PHP announcement</a></p>
<p><a href="http://www.ustream.tv/recorded/4409735">HipHop release video</a></p>
<p><a href="http://groups.google.com/group/hiphop-php-dev">Facebook HipHop developer mailing list</a></p>
<p><a href="http://blogs.zdnet.com/BTL/?p=30331">ZDNet article</a></p>
<p><a href="http://www.brandonsavage.net/hiphop-for-php-who-benefits-who-doesnt/">HipHop for PHP: Who Benefits?</a></p>
<p><a href="http://www.besttechie.net/2010/02/02/facebook-introduces-hiphop-for-php/">BestTechie article</a></p>
<p><a href="http://feed2meme.com/2010/02/03/facebook-hopes-to-revolutionize-php-with-“hip-hop”/">Feed2Meme article</a></p>
<p><a href="http://www.developer.com/lang/php/article.php/3862461/Facebooks-HipHop-Goes-Public-With-a-New-PHP-Runtime.htm">Facebook&#8217;s HipHop Goes Public With a New PHP Runtime</a></p>
<p><a href="http://www.phpcompiler.org/">PHPC: A PHP Compiler</a></p>
<p><a href="http://www.roadsend.com/home/index.php">Roadsend PHP compiler</a></p>
<p><a href="http://therumpus.net/2010/01/conversations-about-the-internet-5-anonymous-facebook-employee/?full=yes">An interview with a Facebook employee about PHP</a></p>
<p><a href="http://www.taranfx.com/facebook-php-hiphop-open-source">PHP Facebook release</a></p>


<p>Related posts:<ol><li><a href='http://digitivity.org/165/how-facebook-runs-php-and-mysql' rel='bookmark' title='Permanent Link: How Facebook Runs PHP and MySQL'>How Facebook Runs PHP and MySQL</a></li>
<li><a href='http://digitivity.org/1034/heises-2-click-solution-for-facebook-privacy' rel='bookmark' title='Permanent Link: Heise&#8217;s 2-Click Solution for Facebook Privacy'>Heise&#8217;s 2-Click Solution for Facebook Privacy</a></li>
<li><a href='http://digitivity.org/1111/facebook-timeline-will-let-you-know-who-unfriended-you' rel='bookmark' title='Permanent Link: Facebook Timeline Will Let You Know Who Unfriended You'>Facebook Timeline Will Let You Know Who Unfriended You</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://digitivity.org/771/facebook-announces-a-better-faster-php-hiphop-php-c-plus-plus-compiler/feed</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: digitivity.org @ 2013-05-20 15:31:25 -->