Phalanger (compiler)

Last updated
Phalanger
Stable release
3.0.0.3851 / January 2013;11 years ago (2013-01)
Repository
Written in C#, C++/CIL
Operating system Cross-platform
Platform .NET Framework
License Apache License (Apache 2)
Website www.php-compiler.net

Phalanger is a compiler front end for compiling PHP source code into CIL byte-code, which can be further processed by the .NET Framework's just-in-time compiler. The project was started at Charles University and is supported by Microsoft. Phalanger was discontinued in favor of the more modern PeachPie compiler, which utilizes the Roslyn API.

Contents

Compatibility

Phalanger can run real-world PHP applications, many with minor to no modifications. Examples include WordPress, [1] phpMyAdmin and phpBB. [2]

Performance

One of the main goals of the project is to improve performance of PHP applications. The project web page claims considerable performance benefits over a 32-bit Windows version of PHP. [3]

There was a project [4] at Charles University to re-implement the Phalanger core using the Microsoft Dynamic Language Runtime (DLR), and to develop a Visual Studio integration tool to provide IntelliSense for the PHP language.

Though some features from DLR would slow down the performance of Phalanger[ citation needed ], they do claim performance gains by a factor of 6. [5] These features are being integrated into current Phalanger core.

Google Summer of Code

A project involving Phalanger was mentored by the Mono team during the Google Summer of Code 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. [6]

Jadu sponsorship

Early in 2008, UK Content Management vendor Jadu partnered with the Prague-based team to improve communication between .NET and the Phalanger compiler. It is based on duck typing 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. [7]

In December 2008, Jadu announced that it has made the compiler available to the developer community and in interviews with ITPRO [8] and VNUnet [9] 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. [10] 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. [11]

Since 2012, DEVSENSE provides support forum [12] for Phalanger (compiler) and related projects for the community.

Legacy

The last PHP version supported by Phalanger is 5.4. The GitHub project is marked "Deprecated" and (as of 2019) it hasn't been updated for years. The GitHub page also announces a new project, PeachPie compiler as its successor for PHP 7.1. [13] PeachPie can compile code using PHP 5.4 syntax or newer, and is officially supported by .NET Foundation. [14]

See also

Related Research Articles

<span class="mw-page-title-main">PHP</span> Scripting language created in 1994

PHP is a general-purpose scripting language geared towards web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by the PHP Group. PHP was originally an abbreviation of Personal Home Page, but it now stands for the recursive acronym PHP: Hypertext Preprocessor.

<span class="mw-page-title-main">KDevelop</span> Integrated development environment

KDevelop is a free and open-source integrated development environment (IDE) for Unix-like computer operating systems and Windows. It provides editing, navigation and debugging features for several programming languages, and integration with build automation and version-control systems, using a plugin-based architecture.

<span class="mw-page-title-main">Visual Basic (.NET)</span> Object-oriented computer programming language

Visual Basic (VB), originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language, implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visual Basic language, the last version of which was Visual Basic 6.0. Although the ".NET" portion of the name was dropped in 2005, this article uses "Visual Basic [.NET]" to refer to all Visual Basic languages released since 2002, in order to distinguish between them and the classic Visual Basic. Along with C# and F#, it is one of the three main languages targeting the .NET ecosystem. Microsoft updated its VB language strategy on 6 February 2023, stating that VB is a stable language now and Microsoft will keep maintaining it.

IronPython is an implementation of the Python programming language targeting the .NET and Mono frameworks. The project is currently maintained by a group of volunteers at GitHub. It is free and open-source software, and can be implemented with Python Tools for Visual Studio, which is a free and open-source extension for Microsoft's Visual Studio IDE.

<span class="mw-page-title-main">SharpDevelop</span>

SharpDevelop is a discontinued free and open source integrated development environment (IDE) for the .NET Framework, Mono, Gtk# and Glade# platforms. It supports development in C#, Visual Basic .NET, Boo, F#, IronPython and IronRuby programming languages.

Laminas Project is an open source, object-oriented web application framework implemented in PHP 7 and licensed under the New BSD License. The framework is basically a collection of professional PHP-based packages. The framework uses various packages by the use of Composer as part of its package dependency managers; some of them are PHPUnit for testing all packages, Travis CI for continuous Integration Services. Laminas provides to users a support of the model–view–controller (MVC) in combination with Front Controller solution. MVC implementation in Laminas has five main areas. The router and dispatcher functions to decide which controller to run based on data from URL, and controller functions in combination with the model and view to develop and create the final web page.

Jadu is a provider of low-code Web Experience Management software, specialising in Web CMS, Forms, Portal and Customer Case Management tools for the enterprise.

The Dynamic Language Runtime (DLR) from Microsoft runs on top of the Common Language Runtime (CLR) and provides computer language services for dynamic languages. These services include:

IronRuby is an implementation of the Ruby programming language targeting Microsoft .NET Framework. It is implemented on top of the Dynamic Language Runtime (DLR), a library running on top of the Common Language Infrastructure that provides dynamic typing and dynamic method dispatch, among other things, for dynamic languages.

Text Template Transformation Toolkit is a free and open-source template-based text generation framework. T4 source files are usually denoted by the file extension ".tt".

IronScheme is an implementation of the Scheme programming language targeting the Microsoft .NET Framework. IronScheme is a complete rewrite of IronLisp, incorporating lessons learnt while developing IronLisp.

<span class="mw-page-title-main">.NET Framework</span> Software platform developed by Microsoft

The .NET Framework is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until being superseded by the cross-platform .NET project. It includes a large class library called Framework Class Library (FCL) and provides language interoperability across several programming languages. Programs written for .NET Framework execute in a software environment named the Common Language Runtime (CLR). The CLR is an application virtual machine that provides services such as security, memory management, and exception handling. As such, computer code written using .NET Framework is called "managed code". FCL and CLR together constitute the .NET Framework.

<span class="mw-page-title-main">Node.js</span> JavaScript runtime environment

Node.js is a cross-platform, open-source JavaScript runtime environment that can run on Windows, Linux, Unix, macOS, and more. Node.js runs on the V8 JavaScript engine, and executes JavaScript code outside a web browser.

<span class="mw-page-title-main">Roslyn (compiler)</span> Set of open-source compilers

.NET Compiler Platform, also known by its codename Roslyn, is a set of open-source compilers and code analysis APIs for C# and Visual Basic (VB.NET) languages from Microsoft.

HipHop Virtual Machine (HHVM) is an open-source virtual machine based on just-in-time (JIT) compilation that serves as an execution engine for the Hack programming language. By using the principle of JIT compilation, Hack code is first transformed into intermediate HipHop bytecode (HHBC), which is then dynamically translated into x86-64 machine code, optimized, and natively executed. This contrasts with PHP's usual interpreted execution, in which the Zend Engine transforms PHP source code into opcodes that serve as a form of bytecode, and executes the opcodes directly on the Zend Engine's virtual CPU.

<span class="mw-page-title-main">.NET</span> Software platform developed by Microsoft

The .NET platform is a free and open-source, managed computer software framework for Windows, Linux, and macOS operating systems. The project is mainly developed by Microsoft employees by way of the .NET Foundation and is released under an MIT License.

<span class="mw-page-title-main">PeachPie</span>

PeachPie is an open-source PHP language compiler and runtime for the .NET Framework and .NET. It is built on top of the Microsoft Roslyn compiler platform and is based on the first-generation Phalanger project. PeachPie compiles source code written in PHP to CIL byte-code. PeachPie takes advantage of the JIT compiler component of the .NET Framework in order to handle the beginning of the compilation process. Its purpose is not to generate or optimize native code, but rather to compile PHP scripts into .NET assemblies containing CIL code and meta-data. In July 2017, the project became a member of the .NET Foundation.

References

  1. Phalanger + Wordpress Archived 2011-08-17 at the Wayback Machine
  2. "phpBB: Creating communities twice as fast". Archived from the original on 2013-05-17. Retrieved 2013-02-19.
  3. "Benchmarks". www.php-compiler.net. Archived from the original on 2012-04-27.
  4. "Improvements in the Phalanger Project". www.php-compiler.net. 2008-07-01. Archived from the original on 2023-08-15. Retrieved 2011-07-09.
  5. "Phalanger takes advantage of DLR". 2011-08-01. Archived from the original on 2016-03-25. Retrieved 2011-08-03.
  6. "Google Summer of Code Application Information". 2007-04-21.[ permanent dead link ]
  7. Petricek, Tomas (2007-04-30). "Using PHP objects from C# in a type-safe way". Archived from the original on 2008-10-12. Retrieved 2008-11-30.
  8. Har-Even, Benny (2006-12-02). "Jadu gets PHP and .NET talking". ITPRO. Archived from the original on 2008-12-06. Retrieved 2008-12-03.
  9. Muncaster, Phil (2006-11-28). "Jadu brings PHP and .NET closer together". VNUnet. Archived from the original on 2008-12-04.
  10. "Devsense offers Phalanger and commercial support". DEVSENSE. Archived from the original on 2011-06-24.
  11. "Devsense provides Phalanger Tools". DEVSENSE. Archived from the original on 2011-10-17.
  12. "DEVSENSE support". DEVSENSE. Archived from the original on 2012-01-22. Retrieved 2012-01-24.
  13. "GitHub - DEVSENSE/Phalanger: PHP 5.4 compiler for .NET/Mono frameworks. Phalanger compiles legacy PHP code to MSIL while being fully compatible with PHP behavior". GitHub . Archived from the original on 2019-05-01. Retrieved 2019-04-19.
  14. "GitHub - peachpiecompiler/peachpie: PeachPie - the PHP compiler and runtime for .NET and .NET Core". GitHub . Archived from the original on 2019-07-20. Retrieved 2019-04-19.