I highly recommend paying attention to https://docs.peachpie.io/compatibility-status/ -- there is still a lot of work to be done, and they are comparing to a really old version of PHP. There have been a lot of new features since 8.0.
IMHO, besides the fun to create such a project (and all the thibgs you learn while doing it), it's not for much. It tries to bring a technology somewhere (presuambly the desktop, as asp.net and PHP are already comparable) it's not designed for - which will bring you in trouble sooner or later. It's like JavaScript on the server, it's ok but there are languages better suited for this environment.
It's much faster to learn C# in the long term than to run PHP on top of .Net.
I'm not sure why anyone would use it, but it was probably a fun project to make. I do think the statement on their landing page which reads: "Compile and run PHP on top the modern, secure and highly performant .NET runtime" perhaps is a little disingenuous. This might just be me, but I read it as though they imply that PHP isn't those things, which would be a silly statement to make in 2024.
A major difference will be that PeachPie produces a compiled deploy artefact, while mainstream PHP is interpreted (albeit with heavy opcode caching and a JIT in production)
we have attempted to use it for that, but it was really hard and we ended up rewriting from scratch.
The activity graph on GitHub says it is mostly dead. There is some activity, but at best it is in maintenance mode. It used to be sponsored, but not anymore IIRC
So seems they're aiming to use the PHP language but on a different runtime, for the listed reasons. Sounds kind of out there, but seems at least the .Net Foundation supports it, I'm guessing for the same reasons.
May also be useful for creating automatic language support from a single codebase. For example, Amazon uses JSII to build a typescript library into Python, Go, dotnet, etc.
Maybe this tooling will help add PHP to that list.
For obfuscation reasons mainly. Hide your genius code from a php base so your IP is not poached/discovered by Amazon and the likes who love to get brilliant open source made project, move a line and call it their own.
23 comments
[ 3.4 ms ] story [ 74.2 ms ] threadIt's much faster to learn C# in the long term than to run PHP on top of .Net.
https://learn.microsoft.com/en-us/dotnet/csharp/language-ref...
And, it's getting better over time:
https://github.com/dotnet/csharplang/issues/4935
This is essentially how I respond to web requests in my codebases right now:
https://slack.engineering/taking-php-seriously/
I would consider poor man's PHP as something to reimplement that architecture, rather than any particular language feature.
Benefits of this are dubious at best. The php interpreter is already a low level C project so why replace that with .net? Makes no sense.
You are comparing apples with pies here. PHP is a interpreted language, while .NET is a compiled target.
However, this peachpie project seems to be far from stated goal and more of a research project currently.
The activity graph on GitHub says it is mostly dead. There is some activity, but at best it is in maintenance mode. It used to be sponsored, but not anymore IIRC
https://github.com/peachpiecompiler/peachpie/graphs/contribu...
> Project goals: Both-way interoperability, Full .NET compatibility, Security, Cross-platform development, Increased performance - https://github.com/peachpiecompiler/peachpie
So seems they're aiming to use the PHP language but on a different runtime, for the listed reasons. Sounds kind of out there, but seems at least the .Net Foundation supports it, I'm guessing for the same reasons.
Maybe this tooling will help add PHP to that list.
That way you are not maintaining 6 codebases.
https://github.com/aws/jsii