A language and toolchain for native software

Familiar code.
Native software.

HolyPHP brings the directness of PHP-style syntax to a compiled language. Check your code, build a native program, and use one toolchain from your first script to a larger application.

No PHP tags. No interpreter or virtual machine in the output.
hello.hphpHolyPHP
// Write a small program
function greet(string $name): string {
    return "Hello, {$name}!";
}

echo greet("Ada");
hphp run hello.hphpRun from your terminal
01
Own compilerPHP-inspired language
02
Compile-time checksTypes and borrowing
03
Native buildsRuntime bundled in output
04
One command lineCheck, run, build, package
The workflow

From first line to finished program

Keep the fast feedback loop of a scripting language, with a compiler that can produce a standalone native executable.

Write naturally

Start with variables, arrays, functions and classes. Add explicit types where they communicate intent.

Check as you go

Use hphp check to surface type and borrow errors without having to run the program.

Build for your machine

Run a source file during development or build it into a native executable for distribution.

Language, runtime, libraries

One toolchain. Several ways to build.

HolyPHP is not PHP running through FPM. Its compiler and runtime power programs written in the language itself.

Types & memory

Safety checks in the compiler

HolyPHP offers inferred types for quick scripts and explicit signatures when you need them. Its borrow checker diagnoses supported conflicting uses before code generation.

How memory safety works →
// Types can be inferred
$count = 3;

// Or stated in a signature
function total(int $a, int $b): int {
    return $a + $b;
}

echo total($count, 4);
Get started locally

Install the compiler

Installers build the compiler for your platform. A C compiler is used when hphp run or hphp build compiles a program.

Start where you are

Read, run, or explore the source.

Follow a guided path, experiment in your browser, or see how the project is built.

Open documentation ↗