Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does HHVM (HipHop) support Postgresql/arbitary pecl extensions?

Facebook made a big announcement today -- HHVM is replacing the original hiphop compiler.

The old HipHop had limited support for extensions -- including, IIRC, no postgres support.

Does HHVM support all pecl extensions? How much of the standard PHP library does it support?

What doesn't HHVM support?

like image 711
Frank Farmer Avatar asked Nov 29 '12 23:11

Frank Farmer


2 Answers

In the year since I originally answered this question, things have changed dramatically. HHVM now publishes an extension list. While they don't yet build in support for ext/pgsql, they point to a this third party extension that implements ext/pgsql and provides Postgres support for PDO. They now also publish documentation on writing your own extensions.

My original answer is below. Please keep in mind that HHVM has completely superseded HipHop and that links and information below are now out of date.


Does HHVM support all pecl extensions?

All current PHP extensions are inexorably tied to the current PHP codebase, Zend API, and existing PHP VM.

HipHop and HHVM are separate implementations of the PHP language, using different methods to execute PHP code. They do not use the existing PHP codebase, the Zend ZPI, or the PHP VM. Any existing PHP extensions, such as those hosted on PECL, can not be directly ported to HipHop/HHVM.

In reality, it's not so much "porting" of the extension that would need to happen as much as complete ground-up reimplementation. The good news, if there is any, is that many PHP extensions are simply thin veneers over the raw C-level API exposed by whatever library is being turned into an extension. Depending on what the target is, the port may be very easy. On the other hand, not all extensions are wrappers around third party libraries, so YMMV.

How much of the standard PHP library does it support?

It looks like the list of supported extensions can be found in the runtime/ext directory.

https://github.com/facebook/hiphop-php/tree/master/src/runtime/ext

Looks pretty comprehensive, they even have PDO. No sign of Postgres support though.

like image 102
Charles Avatar answered Nov 09 '22 13:11

Charles


One year later - still not soaring like MySql but there seems to be a way according to this official HHVM blog comment reply (from 19th December, 2013)

Jeremy Wilson says: I’d like to see Redis and PostgreSQL support.

(Reply) Simon says: Redis support is already available and there’s a PostgreSQL extension you can use.

...referring to https://github.com/pocketRent/hhvm-pgsql

like image 21
Philzen Avatar answered Nov 09 '22 13:11

Philzen