Phalanger (compiler)
Encyclopedia
Phalanger is a project which was started at Charles University in Prague and was supported by Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

. It compiles
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

 source code written in the PHP
PHP
PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...

 scripting language into CIL
Common Intermediate Language
Common Intermediate Language is the lowest-level human-readable programming language defined by the Common Language Infrastructure specification and is used by the .NET Framework and Mono...

 byte-code. It handles the beginning of a compiling process which is completed by the JIT
Just-in-time compilation
In computing, just-in-time compilation , also known as dynamic translation, is a method to improve the runtime performance of computer programs. Historically, computer programs had two modes of runtime operation, either interpreted or static compilation...

 compiler component of the .NET Framework
.NET Framework
The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

. It does not address native code generation nor optimization. Its purpose is to compile PHP scripts into .NET assemblies, logical units containing CIL
Common Intermediate Language
Common Intermediate Language is the lowest-level human-readable programming language defined by the Common Language Infrastructure specification and is used by the .NET Framework and Mono...

 code and meta-data.

Compatibility

Phalanger can run real-world PHP applications, many with minor to no modifications. Examples include WordPress
WordPress
WordPress is a free and open source blogging tool and publishing platform powered by PHP and MySQL. It is often customized into a content management system . It has many features including a plug-in architecture and a template system. WordPress is used by over 14.7% of Alexa Internet's "top 1...

, MediaWiki
MediaWiki
MediaWiki is a popular free web-based wiki software application. Developed by the Wikimedia Foundation, it is used to run all of its projects, including Wikipedia, Wiktionary and Wikinews. Numerous other wikis around the world also use it to power their websites...

, phpMyAdmin
PhpMyAdmin
phpMyAdmin is an open source tool written in PHP intended to handle the administration of MySQL with the use of a Web browser. It can perform various tasks such as creating, modifying or deleting databases, tables, fields or rows; executing SQL statements; or managing users and...

 and phpBB
PhpBB
phpBB is a popular Internet forum package written in the PHP scripting language. The name "phpBB" is an abbreviation of PHP Bulletin Board...

.

Performance

There is an ongoing software project at Charles University to re-implement the Phalanger core using the Microsoft Dynamic Language Runtime
Dynamic Language Runtime
The Dynamic Language Runtime from Microsoft is an ongoing effort to bring a set of services that run on top of the Common Language Runtime and provides language services for several different dynamic languages...

, and to develop a Visual Studio integration tool to provide IntelliSense
IntelliSense
IntelliSense is Microsoft's implementation of autocompletion, best known for its use in the Microsoft Visual Studio integrated development environment...

 for the PHP
PHP
PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...

 language.

As the result, it showed several features from DLR even slow down the performance of Phalanger which is actually getting great results . The rest of DLR features are being integrated into current Phalanger core .

Google Summer of Code
Google Summer of Code
The Google Summer of Code is an annual program, first held from May to August 2005, in which Google awards stipends to hundreds of students who successfully complete a requested free or open-source software coding project during the summer...

 

A project involving Phalanger was mentored by the Mono
Mono (software)
Mono, pronounced , is a free and open source project led by Xamarin to create an Ecma standard compliant .NET-compatible set of tools including, among others, a C# compiler and a Common Language Runtime....

 team during the Google Summer of Code
Google Summer of Code
The Google Summer of Code is an annual program, first held from May to August 2005, in which Google awards stipends to hundreds of students who successfully complete a requested free or open-source software coding project during the summer...

 program in 2008. During this period Phalanger was ported to the Silverlight 2.0 framework with the goal of making it work on Moonlight as well.

Jadu sponsorship

Early in 2008, UK Content Management vendor Jadu
Jadu
Jadu is a software company based in the United Kingdom and United States and a proprietary web content management system of the same name, used for non-technical management of web based content, data and electronic documents....

 partnered with the Prague-based team to improve communication between .NET and the Phalanger compiler. It’s based on duck typing
Duck typing
In computer programming with object-oriented programming languages, duck typing is a style of dynamic typing in which an object's current set of methods and properties determines the valid semantics, rather than its inheritance from a particular class or implementation of a specific interface...

 and provides a way for accessing objects from the dynamic PHP world that lack compile-time type information from a statically typed language in a .NET environment in a type-safe way.

In December 2008, Jadu announced that it has made the compiler available to the developer community and in interviews with ITPRO and VNUnet said that the development would help close the skills gap between PHP and .NET.

Devsense support & development

Since 2009, Devsense company leads the development of the project and offers commercial support. Devsense consists of core Phalanger developers and keeps this open-source project alive.

In addition to maintenance and growth of the project, Devsense is providing Visual Studio integration of Phalanger for the community.

Microsoft & Dynamic languages

According to Microsoft, the primary goal of the project, released under Microsoft Shared Source Permissive License on the Microsoft Codeplex, is to enable full functionality of existing PHP scripts on the .NET framework without any modifications.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK