2
submitted 2 months ago* (last edited 2 months ago) by sanitation@lemmy.today to c/php@programming.dev

Not op. Just reposting

In recent months, I have noticed that more and more people are making attempts to create PHP AOT compilers. In particular, recent ones are Elephc (https://elephc.dev/) and TypePHP from the Swoole team (mentioned here several times). Years earlier, I recall attempts such as jPHP and Peachpie, and the most inspiring to me was https://github.com/ircmaxell/php-compiler. Probably there were a lot more.

However, almost all of them rely on other programming languages (e.g., Rust, C++). So, one day I asked myself, 'What actually prevents someone from writing the PHP compiler in PHP?'

At this point, I've decided I should try even though no one asked. My experience with real compilers is pretty limited, and I didn't have much time to learn everything from scratch, but in the present times, we have great LLM tools that allows to make some stuff faster.

Then I spent a few weekends making this concept - took the LLVM backend and tried to make a PHP frontend around it. To be honest the most of the "compiler" is AI-coded/slopped and requires heavy refactorings, but I do not pretend to say it is production-ready. It is no more than a working concept with some limited PHP-subset supported.

no comments (yet)
sorted by: hot top new old
there doesn't seem to be anything here
this post was submitted on 30 Jun 2026
2 points (100.0% liked)

PHP

816 readers
1 users here now

Welcome to /c/php! This is a community for PHP developers and enthusiasts to share and discuss anything related to PHP. From the latest updates and tutorials, to your burning questions and amazing personal projects, we welcome all contributions.

Let's foster an environment of respect, learning, and mutual growth. Whether you're an experienced PHP developer, a beginner, or just interested in learning more about PHP, we're glad to have you here!

Let's code, learn, and grow together!

founded 3 years ago
MODERATORS