REDMOND, Wash.-First it was Python, then Ruby, and now PHP is being groomed to run on Microsoft’s .Net platform.
At the Lang.Net conference Microsoft is hosting at its campus here to discuss the future of programming languages, experts in the PHP language talked of their hope to see the popular Web development technology work better with Microsoft’s offerings.
Microsoft already has IronPython and IronRuby, implementations of both the Python and Ruby dynamic languages running on .Net.
In a session Jan. 29, Wez Furlong, director of engineering at Message Systems, in Columbia, Md., and a core developer of PHP, said PHP is a widely used Web server glue language. “Wouldn’t it be great if Web developers could transfer their language knowledge to the client side-like Silverlight,” Furlong said. He was referring to Microsoft’s cross-browser, cross-platform plug-in for creating rich interactive applications, which supports both IronPython and IronRuby through the company’s DLR (Dynamic Language Runtime).
Furlong said that although he contributes code to the PHP project, he has no experience developing on the Microsoft CLR (Common Language Runtime) or the DLR. “But I’m looking at how I’d do PHP on the DLR,” he said.
However, Furlong pointed to Phalanger, an implementation of PHP that targets the Microsoft CLR, as evidence that it can be done. Phalanger is a PHP implementation that introduces the PHP language into the family of compiled .Net languages.
Phalanger was developed independently of the core PHP community, Furlong said, and he noted that he has worked mostly on the streaming and database layers of the PHP language. “But we’re finally cooperating and looking at taking advantage of the DLR,” Furlong said of the core PHP community and the Phalanger project. Phalanger is hosted on Microsoft’s CodePlex community development site.
“Despite PHP and Phalanger being on two different paths, we’re talking to each other and we’re interested in getting PHP to run in Silverlight,” Furlong said.
PHP Fun and Games
Meanwhile, also at the Lang.Net event, Tomas Petricek, a Phalanger contributor and Microsoft MVP (Most Valuable Professional) for C#, demonstrated a Phalanger Helicopter Game, a game written purely in PHP that runs in a browser as a Silverlight control.
Petricek said Phalanger is an abbreviation of “PHP Language Compiler.” It was originally targeted at the .Net Framework 1.1, but now supports .Net 2.0, the open-source Mono platform and Silverlight, he said.
“We’re planning to use parts of the DLR in the future,” Petricek said.
Phalanger has progressed over the year, he said. Developers can now compile various open-source PHP applications for .Net, use .Net classes from PHP programs or write PHP applications in Silverlight, Petricek said.
“The goal was to make it as similar [on .Net] to other dynamic languages as possible-like Iron Python and IronRuby,” he said.
Meanwhile, Petricek said PHP is a good language for Silverlight because it provides dynamic access to XAML (Extensible Application Markup Language) elements, it is good for working with attached properties, and developers can use functions from the PHP library, among other reasons.
Moreover, with Phalanger, PHP becomes a first-class language for developing ASP.Net component-based Web applications and Web services, as well as console and WinForms applications, Microsoft officials said.
Phalanger is distributed via the Microsoft Shared Source Permissive License.