 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Sankuru Blog: A pluggable compiler and virtual machine in PHP
by Chris Cornutt January 10, 2012 @ 11:53:15
On the Sankuru blog today the next post in the series about creating a compiler in PHP has been posted. In this latest tutorial he shows how to set up a plugin architecture for the compiler that allows you to quickly and easily extend it beyond its base functionality.
A plugin architecture allows multiple developers to work on the same application and let yet another person assemble their work later on. It allows the plugin developer to understand just his plugin API without having to understand all the details of the entire application.
He describes a few platforms that already have the concept of plugins including Joomla, Mediawiki and SugarCRM. He explains what a plugin architecture should be and what it shouldn't be. All of this is his first steps towards building a plugin-enabled compiler and virtual machine in PHP.
voice your opinion now!
compiler virtualmachine plugin architecture tutorial
Sankuru Blog: Adding support for if/while/do while, to a simple compiler & virtual machine in PHP
by Chris Cornutt January 04, 2012 @ 11:40:22
Improving on his last post about creating a bytecode compiler in PHP, the Sankuru blog has a new post in the series looking at extending the basic compiler to add support for if/while and do while logic.
In order to obtain a turing-complete programming language, that is, a language in which we can implement and execute any arbitrary algorithm, that is, that other turing-complete machines can execute too, we now need to add a way of (conditionally) branching, that is, the IF statement, and at least one way of repeating statements, that is the WHILE or the DO WHILE statements.
He includes a simple TL-based script as an end goal for the compiler to be able to execute and shows how to add rules for it to the lexer/parser. Rules for the "if" are relatively simple, but there's a hitch in dealing with embedded "while" statements he had to work around. The post ends with the bytecode results for the sample program and the resulting output from the compiled versions execution.
voice your opinion now!
bytecode compiler virtual machine while if whiledo logic
Brian Swan's Blog: Why is PHP 5.3 on Windows faster than previous PHP versions?
by Chris Cornutt October 13, 2011 @ 08:42:12
In a new post to his blog Brian Swan explains why the latest versions of PHP (the 5.3.x series) are faster now on Windows than some previous versions have been. (Hint: updated technology can work wonders sometimes)
[Rasmus Lerdorf recently said at a Seattle meetup] "If you aren't running PHP 5.3 on Windows, you're lucky…because you have a 40% performance boost coming." He clarified this by saying that, with some help from Microsoft, improvements were made in PHP 5.3 that led to a 40% performance improvement of PHP on Windows. Because he didn't go into the details of why this performance boost was realized, I got questions in email the next day asking about why.
The information in a borrowed slide (from a presentation by Pierre Joye) shows what the differences between the versions are - things like the use of a more modern compiler (VC9 vs VC6), calls to the Win32 API directly and better library management.
voice your opinion now!
windows performance improvement compiler library management win32 api
Community News: Facebook Releases HipHop for PHP
by Chris Cornutt February 02, 2010 @ 12:30:39
Facebook has made their official announcement about their secretive PHP project today and have scheduled an event for them to give the world more information on the project.
Today I'm excited to share the project a small team of amazing people and I have been working on for the past two years; HipHop for PHP. With HipHop we've reduced the CPU usage on our Web servers on average by about fifty percent, depending on the page. Less CPU means fewer servers, which means less overhead. This project has had a tremendous impact on Facebook. We feel the Web at large can benefit from HipHop, so we are releasing it as open source this evening in hope that it brings a new focus toward scaling large complex websites with PHP.
The post elaborates a bit more on what the tool is (not really a compiler, more of an optimizer) and why they decided to go this direction. There's a bit of description on how the tool works and how the transformation happens.
Stay tuned to this post around 7:30pm Pacific time for more information.
voice your opinion now!
facebook release hiphop compiler optimize
ReadWriteWeb.com: CONFIRMED Facebook Gets Faster, Debuts Homegrown PHP Compiler
by Chris Cornutt February 02, 2010 @ 10:45:12
If you've been following along with some of the articles about the compiler Facebook is developing for PHP, you might want to check out these comments from ReadWriteWeb.com (by Mike Melanson) with more from his point of view.
According to our sources, Facebook has been working on a PHP compiler that will increase speed by around 80% and offer a just-in-time (JIT) compilation engine that will offer a number of advantages. The project is very similar to Google's Unladen Swallow project, which rebuilt the Python compiler, boosting the speed fivefold and opening the door for multi-language integration.
Included are also some comments from Richard Crowley about what Facebook could be releasing, a compiler that would still allow PHP to remain interpreted but provide the speed of being compiled. Some of the comments on the post wonder how something like this compiler compares to an opcode cache and doubts on whether it will end up being open sourced at all.
You can also get another opinion on what will be released in this article from the All Facebook blog. They reinforce that the announcement will come today and how much potential something like this could have to change what PHP could become.
voice your opinion now!
compiler facebook rumor jit
Software Development Times: Facebook rewrites PHP runtime
by Chris Cornutt February 01, 2010 @ 08:09:52
According to this new article from the Software Development Times Facebook has rewritten the PHP runtime from scratch and will be releasing it soon as an open source project.
So, why has Facebook rewritten the PHP runtime? Because PHP is obviously too slow for their tastes. A few years ago, I had a coffee meeting with some of the folks from Zend. When they asked what I had been hearing about PHP in the market from my sources, I hemmed and hawed, then told them that I had heard people complaining about how slow PHP was.
Other sources suggest the release won't be a full runtime but instead a sort of compiler for PHP applications including an interview with a Facebook employee who drops a hint about their future plans for the language.
voice your opinion now!
facebook runtime rewrite compiler
Derick Rethans' Blog: PHP's two-pass compiler
by Chris Cornutt January 28, 2009 @ 12:06:34
While working on an issue with debugging a script of his via XDebug, Derick Rethans was reminded of something that is an integral part of the PHP language - its two phase compiler.
During the first pass, it will find out to which opcode it needs to jump in the jump instructions. However, the PHP engine (and Xdebug) expects a memory address to jump to while executing your script. In the second pass, the compiler will then go over the generated opcodes and calculate the memory address to jump to from the jumps to opcode numbers.
Because of the way that XDebug was handling the checks (with the user-defined error handler) and how the opcodes inside of PHP are handled, the user-defined handler happened in between the first and second phases and the latter run couldn't find the resources it was looking for, thus the crash.
voice your opinion now!
two phase compiler xdebux vld userdefined error handler opcode resource
|
Community Events
Don't see your event here? Let us know!
|