PHPDeveloper.orghttp://www.phpdeveloper.org
Up-to-the Minute PHP News, views and communityen-usTue, 31 Mar 2015 15:50:44 -050030http://www.phpdeveloper.org/news/22398http://www.phpdeveloper.org/news/22398
Similar to how the language specification was released for PHP a little while back, the HHVM team has announced a new specification for Hack, the language they've created as a part of the HipHop VM project that's similar to PHP.

When we announced Hack, we were very excited for the community to get their hands on a programming language that has helped Facebook engineers become more productive in their day-to-day development and became, alongside PHP, the language used when developing applications running on HHVM. At the time of release, we had documentation geared for the programmer using Hack to develop applications. However, we did not have official documentation for those that might want to create a Hack implementation of their own or something like a Hack conformance test-suite. This specification fills that gap. It is the document for the Hack implementer, and an excellent supplemental document for the Hack user.

The remainder of the post talks about some of the reasoning behind creating the specification, pointing to resources where you can help contribute and a few thanks to some of the people that worked on it.

Link: http://hhvm.com/blog/8537/announcing-a-specification-for-hack]]>Fri, 20 Feb 2015 13:51:15 -0600http://www.phpdeveloper.org/news/21792http://www.phpdeveloper.org/news/21792
In the latest post to the HHVM (HipHop VM) blog Sara Golemon recounts the journey of a thousand bytecodes and the process that it takes to decompose a PHP file and optimize it for execution in the HHVM environment.

Compilers are fun. They take nice, human readable languages like PHP or Hack and turn them into lean, mean, CPU executin' turing machines. Some of these are simple enough a CS student can write one up in a weekend, some are the products of decades of fine tuning and careful architecting. Somewhere in that proud tradition stands HHVM; In fact it's several compilers stacked in an ever-growing chain of logic manipulation and abstractions. This article will attempt to take the reader through the HHVM compilation process from PHP-script to x86 machine code, one step at a time.

The process is broken down into six different steps, each with a description and some code examples where relevant:

Lexing the PHP to get its tokens

Parsing the token results into an AST (and optimizing it along the way)

Compilation to Bytecode

HHBBC Optimization

Intermediate Representation

Virtual Assembly

Emitting machine code

Link: http://hhvm.com/blog/6323/the-journey-of-a-thousand-bytecodes]]>Mon, 06 Oct 2014 12:49:38 -0500http://www.phpdeveloper.org/news/21657http://www.phpdeveloper.org/news/21657
The HHVM (HipHop VM from Facebook) has released an update on their blog today discussing some of the long term support they plan to provide for the project and what kinds of things it will involve.

HHVM is known for its very intense and quick development pace: currently we ship to GitHub the exact same code we use to run the Facebook site within minutes of every commit, and we release a full version every 8 weeks. That is great and at the same time scary if you are trying to build a business or infrastructure around it. The HHVM team at Facebook understands that in order to reach every corner of the PHP landscape our users need to have some sort of commitment, in order to plan their deployments accordingly and to know how upstream will react to security and stability fixes in already released versions, for example.

Starting with HHVM v3.3, they'll be supporting two major versions at all times. They provide a table of versions and dates to give you an idea of when the support coverage period is and when they'll end. There's also some discussions about the packaged released for the various linux distributions and what kinds of updates might be included in the long-term support (LTS) updates.

Link: http://hhvm.com/blog/6083/hhvm-long-term-support]]>Wed, 03 Sep 2014 10:50:20 -0500http://www.phpdeveloper.org/news/21243http://www.phpdeveloper.org/news/21243
On the HHVM blog today they've announce the release of the latest version of the popular project, version 3.1.0. This version fixes a few issues (including a segfault) and crossed into their semi-annual "lockdown" to work directly on the project.

If you remember last time we focused on framework unit tests, performance, and growing beards. This time, our frameworks were in good shape thanks to Fred and our Open Academy students, but our github story was not as pretty. At the start of lockdown we had 60 pull requests and nearly 450 issues. So our focus this time was github health and of course as always, perf.

In the end they closed out 251GitHub issues and made things 16% more efficient in the process. They list out some of the updates in this release including:

Link: http://hhvm.com/blog/5195/hhvm-3-1-0]]>Fri, 30 May 2014 11:56:54 -0500http://www.phpdeveloper.org/news/20842http://www.phpdeveloper.org/news/20842
On the HHVM blog today a new post talks about some of the work they've been doing to introduce one of the common PHP extensions, MySQLi, into the HHVM system. The post walks you through some of the process the author followed to work up the implementation.

To prepare for what was to be my big project, I rewrote the ini parser to better match Zend. [...] After warming up with the parser, I was ready to start my big project: implement MySQLi. This has been a long requested feature for HHVM. And, this extension is required to help meet our compatibility goals.

He walks you through some of the preparation steps for the work integrating the extension and the tools used for these initial steps. He briefly steps through the actual implementation and the testing of the feature (and some changes made to allow the tests to run faster). He mentions a few roadblocks hit along the way, the current status of the effort (182 passing tests, 114 failing) and some of the missing pieces yet to be worked.

Link: http://www.hhvm.com/blog/3689/implementing-mysqli]]>Thu, 27 Feb 2014 11:15:39 -0600http://www.phpdeveloper.org/news/20835http://www.phpdeveloper.org/news/20835
In their latest post the HHVM project (of Facebook) has laid out the next six months ahead for the development and progression on the project. In it they talk some about their "themes" and overall Open Source goals planned for the first part of 2014.

The HHVM team has just wrapped up its planning for the first half of 2014. We'd like to share our plans, providing you a bit of context. We've been making steady progress on HHVM's compatibility with PHP in the wild, but we still have a lot of work ahead of us. We're using unit test pass rates as a proxy for success measurement, but you can help by adding HHVM to your Travis configuration, and reporting bugs and issues through GitHub. We are resourced to help support a couple of major HHVM deployments, which we hope has the side effect of exposing us to "non-Facebook" deployment and maintenance challenges.

We are also going to push for a more open development model, with the goal of increasing our community participation. We'll have more to say on what this means later on. Stay tuned!

They also cover some of the work being done to increase the overall efficiency, reducing CPU time and memory consumption. There's also mention of work being done on a guide to "hacking" in the HHVM, reducing some complexity in the compiler and the conversion to a full HNI extension interface.

Link: http://www.hhvm.com/blog/3743/hhvm-the-next-six-months]]>Wed, 26 Feb 2014 11:09:35 -0600http://www.phpdeveloper.org/news/20814http://www.phpdeveloper.org/news/20814
Juan Treminio passed along a note about his GUI-based virtual machine builder PuPHPet and some recent advancements in what it supports.

PuPHPet just added support for HHVM via FastCGI for Apache/Nginx and needs your help to create a VM and report any bugs encountered to make the experience as smooth as possible.

PuPHPet makes creating Vagrant/Puppet configurations much simpler and does a lot of the hard work for you. The project is also open sourced on GitHub so you can always add support for anything you might not see.

Link: https://puphpet.com/]]>Fri, 21 Feb 2014 09:36:36 -0600http://www.phpdeveloper.org/news/20796http://www.phpdeveloper.org/news/20796
Allan MacGregor has a new post sharing some of his research into getting Magento working on the HHVM (the HipHop VM) and some of the benchmarks of the results.

Magento is (in)famous for its performance, specially when scaling to a large numbers products, transactions or even catalog rules, seasoned Magento developers have probably hit at least one of this performance bottle necks more than once. [...] And while all the optimizations help, in the end there is a major performance bottleneck that is not as easily surpassed and that is PHP performance, since PHP is an interpreted language there is price to pay in terms of speed of execution and overall performance.

He introduces the HHVM briefly for those not familiar with it and some of the work already in progress to make Magento cooperate. He walks you though a complete installation of both the HHVM, cloning it from GitHub, and configuring it with the settings needed for Magento to run correctly. Once the HHVM instance is started, he runs some tests with siege comparing the results from the built-in PHP web server versus the HHVM install.

Link: http://coderoncode.com/2014/02/17/magento-hhvm.html]]>Tue, 18 Feb 2014 09:12:59 -0600http://www.phpdeveloper.org/news/20684http://www.phpdeveloper.org/news/20684
On the HipHop Virtual Machine blog today they're announcing a new option for those that "just can't wait" to get the latest and greatest HHVM version - nightly packages.

If you just can't wait to get your hands on the latest HHVM code, but you don't want to spend the time to compile it, we have a present for you. Every midnight, we run a script that pulls whatever is in master, compiles it, does a sanity check, builds a package and sends it off to the repo. You can then use it by adding the HHVM repo normally and then installing the "hhvm-nightly" package instead of the "hhvm" package. The nightly package should work identically to the current 8 week release cycle package; it will just have all the most recent commits with much less of the testing and hardening (so beware).

The post also includes three examples of the commands to grab this nightly release (via dl.hhvm.com) and install the "hhvm-nightly" package.

Link: http://www.hhvm.com/blog/3203/nightly-packages]]>Thu, 23 Jan 2014 09:19:10 -0600http://www.phpdeveloper.org/news/20562http://www.phpdeveloper.org/news/20562
On the Facebook HHVM (HipHop VM) blog there's a recent post sharing some of their progress towards parity with the PHP language inside the tool (and the results of their "three week lockdown").

On November 4th, the HHVM team went on a 3-week performance and parity lockdown. The lockdown officially ended on November 22th. Overall, this lockdown was a qualified success. [...] Going into lockdown, the team knew that awesome performance alone would not suffice in making HHVM a viable PHP runtime to be used out in the wild. It actually had to run real, existing PHP code reliably.

In the post they include some numbers from their testing, the pass/fail status of the unit test suites for several major PHP projects including Composer, Joomla, Laravel, Slim and phpMyAdmin (with an overall parity of 98.58%). They share the raw numbers of the results and describe some of the testing environment, including some "assumptions and caveats" about the process. They also contributed back fixes as a part of the work, putting pull requests out there for several projects. They finish the post with some of the performance numbers, noting that they passed their goal and made it to 16% for an instance of facebook.com.