PeachPie
   HOME

TheInfoList



OR:

PeachPie is an open-source PHP language compiler and runtime for the
.NET Framework The .NET Framework (pronounced as "''dot net"'') 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 bein ...
and .NET. It is built on top of the
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washing ...
Roslyn compiler platform and is based on the first-generation
Phalanger ''Phalanger'' (from the Greek ''phalangion'', meaning spider's web, from their webbed (fused) toesChambers English Dictionary) is a genus of possums. Its members are found on New Guinea, the Maluku Islands, other nearby small islands, and Aust ...
project. PeachPie compiles source code written in
PHP PHP is a general-purpose scripting language geared toward 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 ...
to CIL byte-code. PeachPie takes advantage of the
JIT Jit (also known as jiti, jit-jive and the Harare beat) is a style of popular Zimbabwean dance music. It features a swift rhythm played on drums and accompanied by a guitar. Jit evolved out many diverse influences, including domestic chimurenga, ...
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 In computer programming, machine code is any low-level programming language, consisting of machine language instructions, which are used to control a computer's central processing unit (CPU). Each instruction causes the CPU to perform a ver ...
, 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 The .NET Foundation is an organization incorporated on March 31, 2014, by Microsoft to improve open-source software development and collaboration around the .NET Framework. It was launched at the annual Build 2014 conference held by Microsoft. T ...
.


Origins

PeachPie's architecture is similar to the
Phalanger ''Phalanger'' (from the Greek ''phalangion'', meaning spider's web, from their webbed (fused) toesChambers English Dictionary) is a genus of possums. Its members are found on New Guinea, the Maluku Islands, other nearby small islands, and Aust ...
project, which had originally started as coursework at the
Charles University ) , image_name = Carolinum_Logo.svg , image_size = 200px , established = , type = Public, Ancient , budget = 8.9 billion CZK , rector = Milena Králíčková , faculty = 4,057 , administrative_staff = 4,026 , students = 51,438 , undergr ...
in
Prague Prague ( ; cs, Praha ; german: Prag, ; la, Praga) is the capital and largest city in the Czech Republic, and the historical capital of Bohemia. On the Vltava river, Prague is home to about 1.3 million people. The city has a temperate ...
,
Czechia The Czech Republic, or simply Czechia, is a landlocked country in Central Europe. Historically known as Bohemia, it is bordered by Austria to the south, Germany to the west, Poland to the northeast, and Slovakia to the southeast. The Cz ...
. It was implemented on Microsoft's .NET compiler platform called Roslyn, utilizing the Roslyn
API An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
. Since 2016, the Czech company iolevel has been leading the development of PeachPie. PeachPie has several advantages over Phalanger, both as a result of the Roslyn API and the reworked architecture of the compiler. While Phalanger was only able to target the full
.NET Framework The .NET Framework (pronounced as "''dot net"'') 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 bein ...
, which only ran on
Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
, and cross-platform capabilities were achieved by targeting
Mono Mono may refer to: Common meanings * Infectious mononucleosis, "the kissing disease" * Monaural, monophonic sound reproduction, often shortened to mono * Mono-, a numerical prefix representing anything single Music Performers * Mono (Japanese b ...
, PeachPie also allows for a compilation to .NET, thus being
cross-platform In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several computing platforms. Some cross-platform software r ...
by default. The benchmarks published to date point to performance improvements of PeachPie compared to its predecessor. The project contains an advanced semantic analysis, which allows the compiler to generate C#-like symbols for enhanced
interoperability Interoperability is a characteristic of a product or system to work with other products or systems. While the term was initially defined for information technology or systems engineering services to allow for information exchange, a broader defi ...
features. There are similarities between PeachPie and
Facebook Facebook is an online social media and social networking service owned by American company Meta Platforms. Founded in 2004 by Mark Zuckerberg with fellow Harvard College students and roommates Eduardo Saverin, Andrew McCollum, Dustin M ...
's
HHVM 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 and used to support PHP execution before the release of HHVM version 4 ...
compiler, which executes PHP on a specially designed virtual machine. However, as Facebook announced in late 2017, version 3.24 of HHVM would be the last release compatible with PHP, as the project would focus exclusively on supporting Facebook's proprietary extension of PHP called Hack. This leaves PeachPie as the only project of this kind with the aspiration to be compatible with past and future versions of PHP. The project receives considerable support from
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washing ...
, having been invited to present at the virtual conference .NET Conf and featured on Microsoft's "On .NET", as well as the .NET Rocks podcast. Since July 2017, PeachPie has been a member of the .NET Foundation. In December 2018, iolevel received the
European Innovation Council The European Innovation Council (EIC) was introduced by the European Commission to support the commercialization of high-risk, high-impact technologies in the European Union. The fully-fledged EIC was launched March 2021 under Horizon Europe and ...
's Horizon2020 grant to pursue their work on PeachPie compiler.


Objectives

The project lists several main goals: * Performance: since the PHP code is compiled to CIL and subsequently executed, rather than interpreted, theoretically this should lead to performance improvements. The micro-benchmarks performed by the authors suggest an increased performance over standard PHP in isolated cases and tests have shown that the project is able to run PHP code about twice as fast on Azure. Using the TechEmpower plaintext benchmark, it was measured that WordPress running on PeachPie was able to serve 305,612 requests per second, whereas standard PHP served 45,616 requests per second. PeachPie is also part of the regularly published TechEmpower benchmarking rounds, where, as of 2019, PeachPie is faster than any other PHP framework appearing in the benchmark.
Phalanger ''Phalanger'' (from the Greek ''phalangion'', meaning spider's web, from their webbed (fused) toesChambers English Dictionary) is a genus of possums. Its members are found on New Guinea, the Maluku Islands, other nearby small islands, and Aust ...
had also offered considerable performance benefits over a 32-bit Windows version of PHP 5.4. * Interoperability: the project allows users to interoperate between the PHP and .NET languages. As a result, unusual operations, such as injecting C# lambdas into a PHP Context or inheriting PHP classes in C#, are possible. Therefore, users can utilize PHP
libraries A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vir ...
in their .NET projects and vice versa. * Additional security: given that PeachPie compiles all the source code into one DLL file, the applications can be distributed without the original source code. The PeachPie project enables entire PHP applications and frameworks to be compiled to the standard .NET DLL format and distributed, for example, as
NuGet NuGet (pronounced "New Get")And The Winner Is, NuGet
haacke ...
packages. * Cross-platform capability: since PeachPie can target .NET, which is compatible with the regular .NET Framework,
Xamarin Xamarin is a Microsoft-owned San Francisco-based software company founded in May 2011 by the engineers that created Mono, Xamarin.Android (formerly Mono for Android) and Xamarin.iOS (formerly MonoTouch), which are cross-platform implementation ...
and
Mono Mono may refer to: Common meanings * Infectious mononucleosis, "the kissing disease" * Monaural, monophonic sound reproduction, often shortened to mono * Mono-, a numerical prefix representing anything single Music Performers * Mono (Japanese b ...
, and runs on
Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
,
MacOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
and
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
, it allows for PHP applications to be developed for all devices and operating systems capable of running .NET.


Supported applications

As of 2019, officially tested and supported applications include
WordPress WordPress (WP or WordPress.org) is a free and open-source content management system (CMS) written in hypertext preprocessor language and paired with a MySQL or MariaDB database with supported HTTPS. Features include a plugin architecture ...
,
MediaWiki MediaWiki is a free and open-source wiki software. It is used on Wikipedia and almost all other Wikimedia websites, including Wiktionary, Wikimedia Commons and Wikidata; these sites define a large part of the requirement set for MediaWiki ...
, the software that runs the
Wikipedia Wikipedia is a multilingual free online encyclopedia written and maintained by a community of volunteers, known as Wikipedians, through open collaboration and using a wiki-based editing system. Wikipedia is the largest and most-read refer ...
page, and
CodeIgniter CodeIgniter is an open-source software rapid development web framework, for use in building dynamic web sites with PHP. Popularity CodeIgniter is loosely based on the popular model–view–controller (MVC) development pattern. While controller c ...
. In addition, a number of other PHP frameworks and programs have been confirmed to work with workarounds by members of the open source community, e.g.
Laravel Laravel is a free and open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern and based on Symfony. Some of the features ...
,
WooCommerce WooCommerce is an open-source e-commerce plugin for WordPress. It is designed for small to large-sized online merchants using WordPress. Launched on September 27, 2011, the plugin quickly became popular for its simplicity to install and customiz ...
or
Magento Magento is an open-source e-commerce platform written in PHP. It uses multiple other PHP frameworks such as Laminas (formerly known as Zend Framework) and Symfony. Magento source code is distributed under Open Software License (OSL) v3.0. Ma ...
.


See also

*
Phalanger ''Phalanger'' (from the Greek ''phalangion'', meaning spider's web, from their webbed (fused) toesChambers English Dictionary) is a genus of possums. Its members are found on New Guinea, the Maluku Islands, other nearby small islands, and Aust ...
*
HHVM 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 and used to support PHP execution before the release of HHVM version 4 ...
*
Project Zero Project Zero is a team of security analysts employed by Google tasked with finding zero-day vulnerabilities. It was announced on 15 July 2014. History After finding a number of flaws in software used by many end-users while researching other p ...
*
GraalVM GraalVM is a Java VM and JDK based on HotSpot/OpenJDK, implemented in Java. It supports additional programming languages and execution modes, like ahead-of-time compilation of Java applications for fast startup and low memory footprint. The fi ...


References

{{.NET Framework Free compilers and interpreters .NET programming languages PHP WordPress