Hasty Briefsbeta

Bilingual

My AI-built PHP engine in Rust passes 17% of PHP-src tests, renders WordPress

6 hours ago
  • #Rust Project
  • #AI Coding
  • #PHP Interpreter
  • The author developed a Rust-based PHP interpreter called Phargo without knowing Rust, relying on AI to write the code.
  • The project uses PHP's official 22,000-file test suite as an unbiased oracle to validate correctness and measure progress.
  • The author's role is minimal: directing the AI to fix failing tests, running the test suite, and committing improvements.
  • Initial issues included undetected failures due to CRLF line endings in tests, highlighting the importance of accurate measurement.
  • PHP's test suite contains dangerous tests that can crash systems, leading to implementing safety caps on memory, loops, and resource usage.
  • The AI uncovered subtle bugs where features parsed correctly but functioned incorrectly, such as clone returning NULL or unset being a no-op.
  • Phargo successfully bootstrapped and served a WordPress front page, though it is currently slower than PHP.
  • The project demonstrates that external test suites and transparent metrics can maintain integrity even when the developer cannot audit the code.