# HHVM: Facebook's JIT Virtual Machine for the Hack Language

> HHVM is an open source virtual machine from Facebook that executes programs written in Hack using JIT compilation. It ships with a built-in web server called Proxygen and also supports FastCGI integration with nginx and Apache.

**facebook/hhvm** — A virtual machine for executing programs written in Hack.

- Repository: https://github.com/facebook/hhvm
- Website: https://hhvm.com
- Stars: 18,665 · Forks: 3,069
- Language: C++
- License: NOASSERTION
- Published: 2026-09-21 · Updated: 2026-09-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/facebook-hhvm

## What HHVM Is and Who It Is For

HHVM is an open-source virtual machine designed specifically for executing programs written in Hack, the statically typed language developed at Facebook. The README describes it as using "a just-in-time (JIT) compilation approach to achieve superior performance while maintaining amazing development flexibility."

The primary audience is engineering teams deploying Hack applications, whether on Facebook's infrastructure or in organizations that have adopted Hack for its type system and async programming model. HHVM is the reference runtime for the Hack language, meaning it is not an optional component for Hack developers but the execution environment Hack programs target.

For web serving, HHVM supports two deployment paths. The first is Proxygen, a web server built directly into HHVM that the README describes as "fast and easy to deploy." The second is a FastCGI integration that places HHVM behind a standard nginx or Apache installation. Both paths are documented at docs.hhvm.com. The Facebook community groups and Twitter handle listed in the README are additional support channels.

## JIT Compilation and the Proxygen Integration

HHVM's design centers on JIT compilation. Rather than interpreting Hack bytecode at runtime, HHVM compiles it to native machine code on first execution, then reuses that compiled code on subsequent calls. The README attributes HHVM's performance characteristics to this compilation approach.

Proxygen is the built-in HTTP server. Because it ships as part of HHVM rather than as a separate process, deploying a Hack web application requires only HHVM itself when using Proxygen. Alternatively, the FastCGI mode allows running HHVM alongside an existing nginx or Apache setup, using the web server for request routing and HHVM as the FastCGI backend.

The repository includes Rust source code, evidenced by `rustfmt.toml` and `clippy.toml` at the top level. The build system is CMake, with `CMakeLists.txt` and a `CMake/` directory. The project also ships Nix-based build files (`flake.nix`, `shell.nix`, `hhvm.nix`) for reproducible build environments, which suggests an active infrastructure build investment alongside the runtime development.

## Installing HHVM and Running Programs

The README directs new users to the getting started guide at docs.hhvm.com/hhvm/getting-started/getting-started. Two installation routes are documented: prebuilt packages for supported Linux distributions and building from source. The prebuilt package path is the recommended route for most users.

Running a standalone Hack script uses the hhvm command directly:

```bash
hhvm example.hack
```

For web hosting, the README outlines the sequence: install HHVM's package, start the web server, and start the HHVM service:

```bash
sudo /etc/init.d/hhvm start
```

After starting the service, Hack files are served at the configured domain. The Hack typechecker lives under `hphp/hack/` in the repository. The Hack Standard Library, also used at runtime, is under `hphp/hsl/`.

The GitHub releases page lists only entries from 2016 (HHVM-3.9.9, HHVM-3.14.5, HHVM-3.15.0), but the repository's last push was on 2026-09-28. Current HHVM packages are distributed through the official package installation mechanism documented at hhvm.com rather than through GitHub releases.

## Repository Structure and Licensing

The main source lives under `hphp/`, which contains the virtual machine implementation, the Hack typechecker (`hphp/hack/`), the Hack Standard Library (`hphp/hsl/`), and related tools. The `third-party/` directory holds vendored dependencies. The `build/` and `ci/` directories cover the build and continuous integration pipeline.

Licensing has three distinct parts. The main HHVM runtime is distributed under the PHP License and the Zend License, as stated in the README and reflected by the `LICENSE.PHP` and `LICENSE.ZEND` files at the repository root. The Hack typechecker in `hphp/hack/` is separately licensed under the MIT License. The Hack Standard Library in `hphp/hsl/` is also MIT-licensed. Teams distributing software that bundles HHVM need to account for all three license layers.

The top-level license field shows NOASSERTION in the repository, which reflects that the repository contains multiple licenses rather than a single top-level identifier. The actual license files are present and explicit for each component.

## Limitations of Using HHVM

HHVM is not a general-purpose language runtime. The repository description is explicit: it is "a virtual machine for executing programs written in Hack." Teams that want to run standard PHP should use a PHP 8-compatible runtime. HHVM does not target the standard PHP ecosystem.

The build-from-source path requires CMake, Rust tooling (given `clippy.toml` and `rustfmt.toml`), and familiarity with Nix or the equivalent dependencies for a direct CMake build. This is a substantial build complexity compared to languages where a package manager install suffices.

Crash reporting is documented separately in the project wiki, indicating that crashes happen with enough frequency to require a structured reporting process. The README links to reporting guidance, which is practical but signals that the runtime has edge cases that surface in production.

The GitHub releases section shows no entries after 2016, which may cause confusion for teams trying to identify the current version. Package version discovery goes through the documentation site rather than GitHub tags, which is an unusual workflow for an open source project of this scale.

## HHVM vs PHP 8: Different Runtimes for Different Languages

The most direct comparison is with PHP 8 and the Zend Engine, which is the standard runtime for the PHP language. PHP 8 introduced a JIT compiler in its 8.0 release, making JIT compilation a shared characteristic, but the target languages differ. HHVM executes Hack, while the Zend Engine executes PHP. The RELATED SEARCHES for this project include "HHVM vs PHP 8," reflecting that engineers frequently ask how the two relate.

Hack is a statically typed language with gradual typing that originated at Facebook and runs on HHVM. PHP is a dynamically typed language with optional type hints that runs on the Zend Engine and other compatible runtimes. The codebases share historical roots but are different languages with different type systems and different standard libraries.

For a team already writing PHP and using the extensive PHP package ecosystem via Composer, HHVM is not a drop-in replacement. For a team building on or maintaining a Hack codebase, HHVM is the reference runtime and the only production-proven execution environment for that language. The README does not describe HHVM as a PHP runtime, and making the choice based on PHP compatibility alone would be a mistake.

## Conclusion

HHVM is the runtime for teams working with the Hack language on Facebook's server-side stack or in organizations that have adopted Hack for its gradual typing and async features. Teams working with standard PHP and the broader PHP ecosystem should use a PHP 8-compatible runtime instead, since HHVM is designed for Hack. Before deploying, check the current prebuilt package availability for your Linux distribution at docs.hhvm.com, as the GitHub releases page lists only older entries while active development continues through official package channels.

## FAQ

### What is HHVM used for?

HHVM is used to execute programs written in Hack, Facebook's statically typed server-side language. It can run standalone Hack scripts or serve web applications using its built-in Proxygen web server or a FastCGI configuration with nginx or Apache.

### What is the Hack language in the context of HHVM?

Hack is the language HHVM is designed to execute. The README links to hacklang.org for the language documentation, and the Hack typechecker and Hack Standard Library are both included in the HHVM repository under separate MIT licenses.

### What licenses cover HHVM?

The main HHVM runtime is licensed under the PHP License and the Zend License. The Hack typechecker in `hphp/hack/` and the Hack Standard Library in `hphp/hsl/` are each MIT-licensed, as stated in the README.

## Sources

- [facebook/hhvm on GitHub](https://github.com/facebook/hhvm)
- [Issues](https://github.com/facebook/hhvm/issues)
- [Project website](https://hhvm.com)
- [README](https://github.com/facebook/hhvm/blob/master/README.md)
- [Releases](https://github.com/facebook/hhvm/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/facebook-hhvm
