PeachPie

Last updated
PeachPie
Original author(s) iolevel
Developer(s) .NET Foundation
Initial releaseJuly 18, 2016;6 years ago (2016-07-18).: [1]
Written in C# [2]
License Apache 2.0 [3]
Website www.peachpie.io

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. [4]

Contents

Origins

PeachPie's architecture is similar to the Phalanger project, [5] which had originally started as coursework at the Charles University in Prague, Czechia. [6] [7] It was implemented on Microsoft's .NET compiler platform called Roslyn, utilizing the Roslyn API. Since 2016, the Czech company iolevel has been leading the development of PeachPie.[ citation needed ]

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, which only ran on Windows, and cross-platform capabilities were achieved by targeting Mono, PeachPie also allows for a compilation to .NET, thus being cross-platform by default. [8] The benchmarks published to date point to performance improvements of PeachPie compared to its predecessor. [9] [10] [11] The project contains an advanced semantic analysis, which allows the compiler to generate C#-like symbols for enhanced interoperability features. There are similarities between PeachPie and Facebook's HHVM 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. [12] This leaves PeachPie as the only project of this kind with the aspiration to be compatible with past and future versions of PHP.[ citation needed ]

The project receives considerable support from Microsoft, [13] having been invited to present at the virtual conference .NET Conf [14] [15] and featured on Microsoft's "On .NET", [16] [17] as well as the .NET Rocks podcast. [18] Since July 2017, PeachPie has been a member of the .NET Foundation. In December 2018, iolevel received the European Innovation Council's Horizon2020 grant to pursue their work on PeachPie compiler. [19] [20] [21]

Objectives

The project lists several main goals: [22] [23]

Supported applications

As of 2019, officially tested and supported applications include WordPress, [38] [7] [39] MediaWiki, [40] the software that runs the Wikipedia page, and CodeIgniter. [41] 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, [42] WooCommerce [43] or Magento. [44]

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 toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993. The PHP reference implementation is now produced by The PHP Group. PHP originally stood for Personal Home Page, but it now stands for the recursive initialism PHP: Hypertext Preprocessor.

IronPython is an implementation of the Python programming language targeting the .NET Framework and Mono. Jim Hugunin created the project and actively contributed to it up until Version 1.0 which was released on September 5, 2006. IronPython 2.0 was released on December 10, 2008. After version 1.0 it was maintained by a small team at Microsoft until the 2.7 Beta 1 release. Microsoft abandoned IronPython in late 2010, after which Hugunin left to work at Google. 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">C Sharp (programming language)</span> Multi-paradigm (object-oriented) programming language

C# is a general-purpose, high-level multi-paradigm programming language. C# encompasses static typing, strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.

<span class="mw-page-title-main">.NET Micro Framework</span> Open source .NET platform

The .NET Micro Framework (NETMF) is a .NET Framework platform for resource-constrained devices with at least 512 kB of flash and 256 kB of random-access memory (RAM). It includes a small version of the .NET Common Language Runtime (CLR) and supports development in C#, Visual Basic .NET, and debugging using Microsoft Visual Studio. NETMF features a subset of the .NET base class libraries, an implementation of Windows Communication Foundation (WCF), a GUI framework loosely based on Windows Presentation Foundation (WPF), and a Web Services stack based on Simple Object Access Protocol (SOAP) and Web Services Description Language (WSDL). NETMF also features added libraries specific to embedded applications. It is free and open-source software released under Apache License 2.0.

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.

Comparison of the Java and .NET platforms.

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

MonoDevelop is an open-source integrated development environment for Linux, macOS, and Windows. Its primary focus is development of projects that use Mono and .NET Framework. MonoDevelop integrates features similar to those of NetBeans and Microsoft Visual Studio, such as automatic code completion, source control, a graphical user interface (GUI) and Web designer. MonoDevelop integrates a Gtk# GUI designer called Stetic. It supports Boo, C, C++, C#, CIL, D, F#, Java, Oxygene, Vala, JavaScript, TypeScript and Visual Basic.NET.

ASP.NET MVC is a web application framework developed by Microsoft that implements the model–view–controller (MVC) pattern. It is no longer in active development. It is open-source software, apart from the ASP.NET Web Forms component, which is proprietary.

<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.

HipHop for PHP (HPHPc) is a discontinued PHP transpiler created by Facebook. By using HPHPc as a source-to-source compiler, PHP code is translated into C++, compiled into a binary and run as an executable, as opposed to the PHP's usual execution path of PHP code being transformed into opcodes and interpreted. HPHPc consists mainly of C++, C and PHP source codes, and it is free and open-source software distributed under the PHP License.

.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.

<span class="mw-page-title-main">Mono (software)</span> Computer software project

Mono is a free and open-source .NET Framework-compatible software framework. Originally by Ximian, it was later acquired by Novell, and is now being led by Xamarin, a subsidiary of Microsoft and the .NET Foundation. Mono can be run on many software systems.

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. 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.

Hack is a programming language for the HipHop Virtual Machine (HHVM), created by Meta as a dialect of PHP. The language implementation is open-source, licensed under the MIT License.

<span class="mw-page-title-main">.NET</span> Free and open-source software platform developed by Microsoft

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

X#, pronounced X sharp and often written XSharp, is an xBase-compatible programming language for the Microsoft .NET platform. X# has been built on top of Roslyn, the open source architecture behind the current Microsoft C# and Visual Basic .NET compilers.

Microsoft, a technology company historically known for its opposition to the open source software paradigm, turned to embrace the approach in the 2010s. From the 1970s through 2000s under CEOs Bill Gates and Steve Ballmer, Microsoft viewed the community creation and sharing of communal code, later to be known as free and open source software, as a threat to its business, and both executives spoke negatively against it. In the 2010s, as the industry turned towards cloud, embedded, and mobile computing—technologies powered by open source advances—CEO Satya Nadella led Microsoft towards open source adoption although Microsoft's traditional Windows business continued to grow throughout this period generating revenues of 26.8 billion in the third quarter of 2018, while Microsoft's Azure cloud revenues nearly doubled.

References

  1. iolevel (July 18, 2016). "PeachPie Compiler pre-release". GitHub . Retrieved February 10, 2017.
  2. "PeachPie repository". github.com. [iolevel]. February 10, 2017. Retrieved February 11, 2017.
  3. "iolevel/peachpie: License". github.com. [iolevel]. Retrieved February 11, 2017.
  4. Galloway, Jon (2017-07-25). "Welcome Peachpie Compiler Platform to the .NET Foundation". The .NET Foundation.
  5. Yegulalp, Serdar (2016-03-14). "Peachpie compiler aims to bring PHP to .Net". InfoWorld. Retrieved 2020-09-23.
  6. phpcompiler (2011-05-04), Phalanger: PHP .NET compiler revealed (1/2) , retrieved 2017-02-08
  7. 1 2 Hughes, Matthew (2017-02-28). "This company figured out how to run Wordpress on .Net". The Next Web. Retrieved 2018-06-16.
  8. ".NET Core Framework - Go Cross-Platform with the .NET Framework". msdn.microsoft.com. Retrieved 2017-02-11.
  9. de Icaza, Miguel (2012-03-12). "Phalanger's PHP on Mono/.NET Updates". tirania.org. Retrieved 2017-02-11.
  10. Adams, Ben (2017-03-11). "Peachpie Plaintext Benchmark". Github.
  11. "Round 16 Results - TechEmpower Framework Benchmarks". 2018-06-06.
  12. Krill, Paul (2017-09-20). "Forget PHP! Facebook's HHVM engine switches to Hack instead". InfoWorld. Retrieved 2019-04-28.
  13. Millar, Ethan (2016-05-11). "How Peachpie Compiler Leverages .Net Development Technology In PHP - Web Development Tutorial". Web Development Tutorial. Retrieved 2018-10-16.
  14. Microsoft Visual Studio (2017-09-20), Running PHP on .NET Core with Peachpie , retrieved 2018-10-16
  15. Code Mantisa (2018-09-18), S303 - Advanced C# PHP interoperability with PeachPie by Jakub Misek , retrieved 2018-10-16
  16. "Benjamin Fistein & Jakub Míšek - Peachpie PHP compiler for .NET". Channel 9. Retrieved 2018-10-16.
  17. "Peachpie". Channel 9. Retrieved 2018-10-16.
  18. ".NET Rocks! vNext". .NET Rocks!. Retrieved 2018-10-16.
  19. "European Innovation Council SME Instrument Phase 1" (PDF). ec.europa.eu. November 2018.
  20. "EIC SME Instrument data hub". sme.easme-web.eu. Retrieved 2019-02-02.
  21. Skoupá, Adéla (2019-01-18). "Inovativní nápady českých firem podpoří EU. Peníze dostane rehabilitační nástroj pro lidi po mrtvici či nástroj PeachPie, který ocenil i Microsoft". Hospodářské noviny (in Czech). Retrieved 2019-02-02.
  22. ".NET Foundation". dotnetfoundation.org. Retrieved 2018-10-16.
  23. Ben Yacoub, Hatem (2017-02-16). "Peachpie, The PHP Compiler and Runtime for .NET". PHP Magazine Network. Retrieved 2018-10-16.
  24. Yegulalp, Serdar. "Peachpie compiler aims to bring PHP to .Net". InfoWorld. Retrieved 2018-10-16.
  25. "Benchmarks – Peachpie". www.peachpie.io. Retrieved 2017-02-08.
  26. Klose, Ann-Kathrin (2017-09-04). "Peachpie: Wordpress per PHP-Compiler auf .NET nutzen". entwickler.de (in German). Retrieved 2018-10-16.
  27. Adams, Ben (27 May 2019). "Peachpie Benchmarks". GitHub.
  28. "Round 13 results - TechEmpower". TechEmpower.
  29. "TechEmpower Framework Benchmarks". www.techempower.com. Retrieved 2018-06-16.
  30. "Ben Adams on Twitter". Twitter. Retrieved 2018-06-16.
  31. "Benchmarks". v1.php-compiler.net. Archived from the original on 2017-01-20. Retrieved 2017-02-12.
  32. "Phalanger: Stuffing PHP With Mono, .NET - Phoronix". www.phoronix.com. Retrieved 2017-02-12.
  33. "Phalanger by DEVSENSE". v4.php-compiler.net. Retrieved 2017-02-13.
  34. Vaggalis, Nikos (24 October 2016). "Peachpie Open Source PHP to .NET Compiler". i-programmer.info. Retrieved 2017-04-08.
  35. Peipman, Gunnar. "Running PHP Applications on .NET Core - DZone Web Dev". dzone.com. Retrieved 2018-10-16.
  36. Hanselman, Scott. "The whole of WordPress compiled to .NET Core and a NuGet Package with PeachPie - Scott Hanselman". www.hanselman.com. Retrieved 2018-10-16.
  37. Richlander. ".NET Core Docs". docs.microsoft.com. Retrieved 2017-02-08.
  38. Hanselman, Scott. "Peachpie - Open Source PHP Compiler to .NET and WordPress under ASP.NET Core - Scott Hanselman". www.hanselman.com. Retrieved 2018-06-16.
  39. "Partnerschaft zwischen Mozilla und BrowserStack & Updates für Symfony". entwickler.de (in German). 2017-03-06. Retrieved 2019-04-28.
  40. "Setting up MediaWiki on .NET with Peachpie @ PeachPie | PHP compiler to .NET". www.peachpie.io. 26 February 2018. Retrieved 2018-06-16.
  41. "Performance Progress Report @ PeachPie | PHP compiler to .NET". www.peachpie.io. 4 June 2018. Retrieved 2018-06-16.
  42. Baart, Calvin (2019-04-18), GitHub - calvinbaart/laravel-peachpie-sample , retrieved 2019-04-28
  43. Llewellyn, Dani (2019-04-26), GitHub - diddledani/net.WordPress.plugin.woocommerce , retrieved 2019-04-28
  44. Tobi (2018-08-28), This Project mirrors Magento 1.9.3.8 and tries to make it compile via peachpie (https://www.peachpie.io/) to .net. In the Process of doing this some fixes called "core hacks" are neccessa.. , retrieved 2019-04-28{{citation}}: External link in |title= (help)