HPHPc
   HOME

TheInfoList



OR:

HipHop for PHP (HPHPc) is a discontinued
PHP PHP is a general-purpose scripting language geared toward 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 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 sou ...
created by
Facebook Facebook is an online social media and social networking service owned by American company Meta Platforms. Founded in 2004 by Mark Zuckerberg with fellow Harvard College students and roommates Eduardo Saverin, Andrew McCollum, Dustin Mosk ...
. 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 sou ...
, PHP code is translated into
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
, compiled into a
binary Binary may refer to: Science and technology Mathematics * Binary number, a representation of numbers using only two digits (0 and 1) * Binary function, a function that takes two arguments * Binary operation, a mathematical operation that ta ...
and run as an executable, as opposed to the PHP's usual execution path of PHP code being transformed into
opcodes In computing, an opcode (abbreviated from operation code, also known as instruction machine code, instruction code, instruction syllable, instruction parcel or opstring) is the portion of a machine language instruction that specifies the operat ...
and interpreted. HPHPc consists mainly of C++, C and PHP source codes, and it is free and open-source software distributed under the
PHP License The ''PHP License'' is the software 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 wit ...
. 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 ( pal, 𐭦𐭭𐭣) is a Zoroastrian technical term for exegetical glosses, paraphrases, commentaries and translations of the Avesta's texts. The term ''zand'' is a contraction of the Avestan language word ' (, meaning "interpreta ...
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 sourced 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 or debugging tool is a computer program used to test and debug other programs (the "target" program). The main use of a debugger is to run the target program under controlled conditions that permit the programmer to track its executi ...
(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 portable timepiece intended to be carried or worn by a person. It is designed to keep a consistent movement despite the motions caused by the person's activities. A wristwatch is designed to be worn around the wrist, attached b ...
,
breakpoint In software development, a breakpoint is an intentional stopping or pausing place in a program, put in place for debugging purposes. It is also sometimes simply referred to as a pause. More generally, a breakpoint is a means of acquiring know ...
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 (HHVM), which is a Just-in-time compilation, 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 * Phalanger (compiler), 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 compilers and interpreters PHP software Software using the PHP license Source-to-source compilers