Hi all,
This is informational only, not an RFC or a request for anything. Two
independent reimplementations of PHP in Rust now exist, both built with
AI assistance and taking quite different approaches. Some of you may find
them interesting, if only as a stress test of how far the .phpt suite
works as a specification.
https://github.com/davidbuzz/buzzs-rust-php-project
The target is php-src's own test suite, byte
for byte. In the right circumstances, it runs just about everything php
can.
99.9% of the in-scope .phpt tests pass (22,156 of the 22,176
that run; out of scope are things like FFI, pgsql and the Windows- and
32-bit-only tests). The goal is to run as fast as C PHP or faster:
Zend/bench.php, micro_bench.php and similar loop-heavy code already run
in about half of PHP 8.5's time, with a trace JIT on x86-64 and AArch64.
Ordinary per-request framework code is still several times slower.
Experimental, not for production. BSD-3-Clause. My work.
https://github.com/francescotinti/php-rust
A from-scratch PHP 8.5 runtime that targets observable behaviour rather
than the Zend Engine's architecture. It reports running WordPress core's
full test suite, Composer, PHPUnit and Symfony components at parity with
PHP. Not my work.
Feedback is welcome as GitHub issues on either project, to keep traffic
off the list.
David "Buzz".
Programmer: 30 years.
PHP Programmer: since version 3, i think.
Lines of php written in the last 20 years: undetermined-toward-infinite?
Lines of Rust now written with AI assistance: over 1 million.
C/C++/Python/Lua/Php/Perl/Rust whatever. :-)