HipHop for PHP

Last updated
HipHop for PHP
Developer(s) Facebook, Inc.
Initial releaseFebruary 2, 2010;11 years ago (2010-02-02) [1]
Final release
Replaced by HHVM [2] [3] / 2013;8 years ago (2013)
Repository
Written in C++, C, PHP
Successor HHVM
License PHP License
Website github.com/facebook/hiphop-php   OOjs UI icon edit-ltr-progressive.svg

HipHop for PHP (HPHPc) is a discontinued PHP transpiler created by Facebook. By using HPHPc as a source-to-source compiler, PHP code is translated into C++, compiled into a binary and run as an executable, 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 distributed under the PHP License.

Contents

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 PHP. [4] [5] [6] [7] [8] 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. [6] HPHPc was originally open sourced in early 2010. [1]

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 (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, breakpoints, 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. [1]

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 (JIT) compilation-based execution engine for PHP, also developed by Facebook. [2] [9] 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. [2]

See also

Related Research Articles

PHP Scripting language created in 1994

PHP is a general-purpose scripting language geared towards web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1994. The PHP reference implementation is now produced by The PHP Group. PHP originally stood for Personal Home Page, but it now stands for the recursive initialism PHP: Hypertext Preprocessor.

Bytecode, also termed portable code or p-code, is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references that encode the result of compiler parsing and performing semantic analysis of things like type, scope, and nesting depths of program objects.

A programming tool or software development tool is a computer program that software developers use to create, debug, maintain, or otherwise support other programs and applications. The term usually refers to relatively simple programs, that can be combined together to accomplish a task, much as one might use multiple hands to fix a physical object. The most basic tools are a source code editor and a compiler or interpreter, which are used ubiquitously and continuously. Other tools are used more or less depending on the language, development methodology, and individual engineer, often used for a discrete task, like a debugger or profiler. Tools may be discrete programs, executed separately – often from the command line – or may be parts of a single large program, called an integrated development environment (IDE). In many cases, particularly for simpler use, simple ad hoc techniques are used instead of a tool, such as print debugging instead of using a debugger, manual timing instead of a profiler, or tracking bugs in a text file or spreadsheet instead of a bug tracking system.

Zend (company)

Zend, formerly Zend Technologies, is a Minneapolis, Minnesota-based software company owned by software developer Perforce. The company's products, which include Zend Studio, assist software developers with developing, deploying and managing PHP-based web applications.

JRuby is an implementation of the Ruby programming language atop the Java Virtual Machine, written largely in Java. It is free software released under a three-way EPL/GPL/LGPL license. JRuby is tightly integrated with Java to allow the embedding of the interpreter into any Java application with full two-way access between the Java and the Ruby code.

Zend Studio is a commercial, proprietary integrated development environment (IDE) for PHP developed by Zend Technologies, based on the PHP Development Tools (PDT) plugin for the Eclipse platform.

Symfony

Symfony is a PHP web application framework and a set of reusable PHP components/libraries. It was published as free software on October 18, 2005 and released under the MIT license.

Laminas Project is an open source, object-oriented web application framework implemented in PHP 7 and licensed under the New BSD License. The framework is basically a collection of professional PHP-based packages. The framework uses various packages by the use of Composer as part of its package dependency managers; some of them are PHPUnit for testing all packages, Travis CI for continuous Integration Services. Laminas provides to users a support of the model–view–controller (MVC) in combination with Front Controller solution. MVC implementation in Laminas has five main areas. The router and dispatcher functions to decide which controller to run based on data from URL, and controller functions in combination with the model and view to develop and create the final web page.

Rogue Wave Software American software company

Rogue Wave Software was an American software development company based in Louisville, Colorado. It provided cross-platform software development tools and embedded components for parallel, data-intensive, and other high-performance computing (HPC) applications.

Intel C++ Compiler Classic and Intel oneAPI DPC++/C++ Compiler are Intel’s C, C++, SYCL, and Data Parallel C++ (DPC++) compilers for Intel processor-based systems, available for Microsoft Windows, Linux, and macOS operating systems.

PHP Development Tools

PHP Development Tools (PDT) is a language IDE plugin for the Eclipse platform and the open-source project that develops it.

PhpStorm integrated development environment for PHP

PhpStorm is a proprietary, cross-platform IDE for PHP, built by the Czech Republic-based company JetBrains.

Dart is a programming language designed for client development, such as for the web and mobile apps. It is developed by Google and can also be used to build server and desktop applications.

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 and used to support PHP execution before the release of HHVM version 4. By using the principle of JIT compilation, Hack code is first transformed into intermediate HipHop bytecode (HHBC), which is then dynamically translated into x86-64 machine code, optimized, and natively executed. This contrasts with PHP's usual interpreted execution, in which the Zend Engine transforms PHP source code into opcodes that serve as a form of bytecode, and executes the opcodes directly on the Zend Engine's virtual CPU.

Hack is a programming language for the HipHop Virtual Machine (HHVM), created by Facebook as a dialect of PHP. The language implementation is open-source, licensed under the MIT License.

Perforce, legally Perforce Software, Inc., is an American developer of software used for developing and running applications, including version control software, web-based repository management, developer collaboration, application lifecycle management, web application servers, debugging tools and Agile planning software.

PeachPie

PeachPie is an open-source PHP language compiler and runtime for the .NET Framework and .NET. It is built on top of the Microsoft Roslyn compiler platform and is based on the first-generation Phalanger project. PeachPie compiles source code written in PHP to CIL byte-code. PeachPie takes advantage of the JIT compiler component of the .NET Framework in order to handle the beginning of the compilation process. Its purpose is not to generate or optimize native code, but rather to compile PHP scripts into .NET assemblies containing CIL code and meta-data. In July 2017, the project became a member of the .NET Foundation.

References

  1. 1 2 3 Haiping Zhao (2010-02-02). "HipHop for PHP: Move Fast". Facebook . Retrieved 2014-08-02.
  2. 1 2 3 Drew Paroski (2012-11-29). "Speeding up PHP-based development with HHVM". Facebook . Retrieved 2014-08-02.
  3. Paul Tarjan (2013-05-13). "Joining, Retirement, Testing, and Bankruptcy". hhvm.com. Retrieved 2014-08-02.
  4. "OOPSLA '12 Paper" . Retrieved 2013-05-23.
  5. Guilherme Ottoni (2013-03-12). "The HipHop Compiler for PHP". OOPSLA 2012. Retrieved 2013-05-23.
  6. 1 2 "FOSDEM 2013 Interview" . Retrieved 2013-05-23.
  7. "HipHop for PHP: Benchmark". Archived from the original on 2011-05-16. Retrieved 2013-05-23.
  8. "Drupal 7: HipHop for PHP vs APC – benchmark". Archived from the original on 2011-05-19. Retrieved 2013-05-23.
  9. "Announcement on GitHub removing HPHPc support". github.com. Facebook. 2013-02-19. Retrieved 2013-05-24.