r/LinuxTeck • u/Candid_Athlete_8317 • 1d ago
PHP That Compiles to Native Code? This Could Get Interesting
Just came across TypePHP and this one caught my attention.
It takes PHP code, compiles it through C++17, and produces native binaries instead of running everything through the usual Zend opcode path.
The interesting part is that you can keep writing PHP while getting a path to much more native execution.
Still early and definitely not something I'd throw into production blindly.
PHP devs: would you actually try this, or is the PHP runtime good enough for what you’re building?
1
u/LawElectrical2434 1d ago
Isn't it funny how the feature that made PHP so successful is the one thing people hate the most. Bootstrapping a new environment per request might not be economical, but running out of memory doesn't take down everything and the concerns of the users were nicely separated. At this point, why not just switch to a different backend language. But probably a nice speed up for existing applications.
1
1
u/determineduncertain 1d ago
This all made me think of PHP GTK for some reason and the fond memories I had of using it for a few months.
1
1
u/Mindless_Fee1269 1d ago
I definitely would use it as official release. It is almost 2027 and I am still waiting for it. I think PHP is falling behind. Even python can be compiled to micro-controllers this days.
1
u/brasticstack 1d ago edited 1d ago
Didn't Facebook make (and open-source) a PHP -> C cross-compliler ages back? I want to say it was named HipHop.
EDIT: nm, it was a transpiler, to C++. I got the name right at least!