Skip to content

Milestone: Self-host — compile php-compiler with php-compiler (bootstrap) #212

@PurHur

Description

@PurHur

Problem

The compiler runs on PHP today; compile times dominate JIT benchmarks. Long-term, the compiler should compile a subset of itself to native code.

Goal (stretch)

bin/compile.php successfully builds a native binary from a defined subset of lib/Compiler.php + dependencies.

Phased approach

Phase A — Inventory

  • Script listing files/functions needed for bin/vm.php minimal path
  • Mark unsupported constructs per file

Phase B — Subset compiler

  • "bootstrap profile" disabling unsupported opcodes
  • CI job: compile.php -l on bootstrap file list

Phase C — Run native VM

  • Native binary runs 000-HelloWorld example
  • Document gap list

Non-goals (initially)

  • Full FFI/LLVM pipeline self-hosted
  • Compiling all of vendor/

Dependencies

Most Phase 2 language issues, #174 LLVM stability

Tracking

Link progress in #78 roadmap; do not block #67 on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    MOST IMPORTANTThis are the most important targetsarea:compilerCompiler / CFG / JITarea:toolingTooling / CI / docsenhancementNew feature or requestphase-3:aotPhase 3 – AOT deployment

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions