HipHop For PHP
   HOME

TheInfoList



OR:

HipHop for PHP (HPHPc) is a discontinued
PHP PHP is a general-purpose scripting language geared towards web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by the PHP Group. ...
transpiler created by
Facebook Facebook is a social media and social networking service owned by the American technology conglomerate Meta Platforms, Meta. Created in 2004 by Mark Zuckerberg with four other Harvard College students and roommates, Eduardo Saverin, Andre ...
. By using HPHPc as a
source-to-source compiler A source-to-source translator, source-to-source compiler (S2S compiler), transcompiler, or transpiler is a type of translator that takes the source code of a program written in a programming language as its input and produces an equivalent so ...
, PHP code is translated into C++, compiled into a
binary Binary may refer to: Science and technology Mathematics * Binary number, a representation of numbers using only two values (0 and 1) for each digit * Binary function, a function that takes two arguments * Binary operation, a mathematical op ...
and run as an
executable In computer science, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instruction (computer science), in ...
, as opposed to the PHP's usual execution path of PHP code being transformed into opcodes and interpreted. HPHPc consists mainly of C++, C and PHP source codes, and it is
free and open-source software Free and open-source software (FOSS) is software available under a license that grants users the right to use, modify, and distribute the software modified or not to everyone free of charge. FOSS is an inclusive umbrella term encompassing free ...
distributed under the
PHP License The ''PHP License'' is the open-source license under which the PHP scripting language is released. The PHP License is designed to encourage widespread adoption of the source code. Redistribution is permitted in source or binary form with or ...
. The original motivation behind HipHop was to save resources on Facebook servers, given the large PHP codebase of facebook.com. As the development of HipHop progressed, it was realised that HipHop could substantially increase the speed of PHP applications in general. Increases in web page generation throughput by factors of up to six have been observed over the
Zend Zend or Zand () is a Zoroastrian term for Middle Persian or Pahlavi versions and commentaries of Avestan texts. These translations were produced in the late Sasanian period. ''Zand'' glosses and commentaries exist in several languages, including ...
PHP. A stated goal of HPHPc was to provide a high level of compatibility for Zend PHP, where most Zend-based PHP programs run unmodified on HPHPc. HPHPc was originally
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
d in early 2010. As an addition to HPHPc, Facebook engineers also created a "developer mode" of HipHop (interpreted version of a PHP execution engine, known as HPHPi) and the HipHop
debugger A debugger is a computer program used to test and debug other programs (the "target" programs). Common features of debuggers include the ability to run or halt the target program using breakpoints, step through code line by line, and display ...
(known as HPHPd). These additions allow developers to run PHP code through the same logic provided by HPHPc while making it possible to interactively debug PHP code by defining
watches A watch is a Clock, timepiece carried or worn by a person. It is designed to maintain a consistent movement despite the motions caused by the person's activities. A wristwatch is worn around the wrist, attached by a watch strap or another typ ...
,
breakpoint In software development, a breakpoint is an intentional stopping or pausing place in a computer program, program, put in place for debugging purposes. It is also sometimes simply referred to as a pause. More generally, a breakpoint is a means o ...
s, etc. Running the code through HPHPi yields lower performance when compared to HPHPc, but the developer benefits were, at the time, worth having to maintain these two execution engines for production and development. HPHPi and HPHPd were also open sourced in 2010. By many accounts HPHPc fulfilled its goals, especially within Facebook as it allowed facebook.com to run much faster while using fewer resources. However, in early 2013 Facebook deprecated HPHPc in favor of the
HipHop Virtual Machine HipHop Virtual Machine (HHVM) is an open-source virtual machine based on just-in-time (JIT) compilation that serves as an execution engine for the Hack programming language. By using the principle of JIT compilation, Hack code is first transfo ...
(HHVM), which is a just-in-time (JIT) compilation-based execution engine for PHP, also developed by Facebook. There were many reasons for this; one of them was HPHPc's flattened curve for further performance improvements. Also, HPHPc did not fully support the PHP language, including the create_function() and eval() constructs, and it involved a specific time- and resource-consuming deployment process that required a bigger than 1 GB binary to be compiled and distributed to many servers in short order. In addition, maintaining HPHPc and HPHPi in parallel (as they needed to be, for the consistency of production and development environments) was becoming cumbersome. Finally, HPHPc was not a drop-in replacement for Zend, requiring external customers to change their whole development and deployment processes to use HPHPc.


See also

*
Parrot virtual machine Parrot is a discontinued register-based process virtual machine designed to run dynamic languages efficiently. It is possible to compile Parrot assembly language and Parrot intermediate representation (PIR, an intermediate language) to Parr ...
* Phalanger


References


External links

* , by Haiping Zhao
The HipHop Compiler for PHP
OOPSLA 2012, by Guilherme Ottoni et al. * , PHP UK Conference 2013, by Sara Goleman {{DEFAULTSORT:HipHop For PHP 2010 software C (programming language) software C++ software Facebook software Free and open source compilers PHP software Software using the PHP license Source-to-source compilers