PHP on .NET
-
So, apparently there's a compiler named PeachPie that compiles PHP into .NET Core MSIL that can run under ASP.NET.
Scott Hanselman wrote an article about it:
-
It's not the first time PHP has been used for .NET:
-
Reading the comments:
This is a huge development, PHP on .net would open up to hosting wordpress sites on windows based servers.
Um… PHP already runs on Windows, which means WordPress already runs on Windows. And MS Azure supports not just .NET hosting, but also Node and, you guessed it, PHP.
But why not just write your code in c#?
Excellent question. Even with the improvements in PHP7, it's still a language packed with s, especially compared to C#. Also, when it comes to .NET, C# is the de facto language of choice.
-
@raceprouk said in PHP on .NET:
Reading the comments:
This is a huge development, PHP on .net would open up to hosting wordpress sites on windows based servers.
Um… PHP already runs on Windows, which means WordPress already runs on Windows. And MS Azure supports not just .NET hosting, but also Node and, you guessed it, PHP.
But why not just write your code in c#?
Excellent question. Even with the improvements in PHP7, it's still a language packed with s, especially compared to C#. Also, when it comes to .NET, C# is the de facto language of choice.
Apparently though, there's a significant performance increase with the .net version vs regular PHP
-
@sloosecannon said in PHP on .NET:
Apparently though, there's a significant performance increase with the .net version vs regular PHP
Compiled code is faster than interpreted code? Whodathunkit!
-
@raceprouk said in PHP on .NET:
It's not the first time PHP has been used for .NET:
These are the same guys. BTW, they're from Czechia, the same country as @blek, and they had an appearance in .NET Rocks:
-
-
@blek said in PHP on .NET:
https://www.knivesandtools.co.uk/productimages/photogallery/photos/kershaw-cryo-ii-KE1556TI-d6.jpg
I believe this is an image of a quality product of Czechia.
GOOD product, as they call them.
-
Embrace, extend and extinguish
-
@raceprouk said in PHP on .NET:
But why not just write your code in c#?
Why does Windows 95 exist when Windows 98 does the same and more?
Why have ramps when stairs are better? And why have stairs when an elevator is better?
If humans came from apes, how come there are still apes?
Checkmate, atheists.
-
@anonymous234 said in PHP on .NET:
Why have ramps when stairs are better?
Wheelchair users may disagree with you.
-
@pleegwat said in PHP on .NET:
@anonymous234 said in PHP on .NET:
Why have ramps when stairs are better?
Wheelchair users may disagree with you.
Users of bipedal robotic walking suits may disagree with you
-
@pleegwat said in PHP on .NET:
@anonymous234 said in PHP on .NET:
Why have ramps when stairs are better?
Wheelchair users may disagree with you.
Why use a wheelchair when legs are better?
-
I am struggling to find a use case for this.
Even if you get some performance gains, there is NO way this will work seamless for any significant project (where you'd actually need the speed gain).
And if you have to invest time into refactoring or massaging that PHP code, why not move it to some easier target, like hack? Or just rewrite it in a speedier platform?
-
@cartman82 Interoperability?
Let's say you have a big PHP project (like WordPress). You port it to .NET. You can now progressively rewrite parts of it in C#.
-
@cartman82 said in PHP on .NET:
I am struggling to find a use case for this.
Even if you get some performance gains, there is NO way this will work seamless for any significant project (where you'd actually need the speed gain).
And if you have to invest time into refactoring or massaging that PHP code, why not move it to some easier target, like hack? Or just rewrite it in a speedier platform?
If they keep spreading the CLI, maybe we'll get it into browsers?
(Silverlight doesn't count)
-
@anonymous234 said in PHP on .NET:
@cartman82 Interoperability?
Let's say you have a big PHP project (like WordPress). You port it to .NET. You can now progressively rewrite parts of it in C#.
Except the value of WordPress is its plugin ecosystem, and its theme system, both of which also now have to be rewritten as well.
The interop you're thinking of does not exist.
-
@arantor said in PHP on .NET:
@anonymous234 said in PHP on .NET:
@cartman82 Interoperability?
Let's say you have a big PHP project (like WordPress). You port it to .NET. You can now progressively rewrite parts of it in C#.
Except the value of WordPress is its plugin ecosystem, and its theme system, both of which also now have to be rewritten as well.
The interop you're thinking of does not exist.
Actually, it'd let your .net Wordpress run php plugins...
-
@yamikuronue not entirely sure of that, having seen some plugins and the frightening abuses of code out there.
There's plenty of "how does that even work" dragons in that ecosystem, not to mention themes are literally in the PHP-as-template-engine camp...
-
@arantor said in PHP on .NET:
themes are literally in the PHP-as-template-engine camp...
Why does that make them incompatible? Templates are probably the simplest language feature of all for a cross-compiler to implement; all it is is a preprocessor step. Turn everything not inside a
php
tag into aprint
statement (or the PHP equivalent) and you're done. It's literally that simple.
-
@raceprouk said in PHP on .NET:
It's not the first time PHP has been used for .NET:
And then the murders began.