Software:PeachPie

From HandWiki
PeachPie
Peachpie logo
Original author(s)iolevel
Developer(s).NET Foundation
Initial releaseJuly 18, 2016; 7 years ago (2016-07-18).:[1]
Written inC#[2]
LicenseApache 2.0[3]
Websitewww.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]

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]

  • Performance: since the PHP code is compiled to CIL and subsequently executed, rather than interpreted, theoretically this should lead to performance improvements.[24] The micro-benchmarks performed by the authors suggest an increased performance over standard PHP in isolated cases[25] and tests have shown that the project is able to run PHP code about twice as fast on Azure.[26] Using the TechEmpower plaintext benchmark, it was measured that WordPress running on PeachPie was able to serve 305,612 requests per second,[27] whereas standard PHP served 45,616 requests per second.[28] PeachPie is also part of the regularly published TechEmpower benchmarking rounds[29][failed verification], where, as of 2019, PeachPie is faster than any other PHP framework appearing in the benchmark.[30][non-primary source needed] Phalanger had also offered considerable performance benefits over a 32-bit Windows version of PHP 5.4.[31][32][33]
  • 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.[34] Therefore, users can utilize PHP libraries in their .NET projects and vice versa.[35]
  • 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 packages.[36]
  • Cross-platform capability: since PeachPie can target .NET, which is compatible with the regular .NET Framework, Xamarin and Mono, and runs on Windows, MacOS and Linux,[37] 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,[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

References

  1. iolevel (July 18, 2016). "PeachPie Compiler pre-release". https://github.com/peachpiecompiler/peachpie/releases. 
  2. "PeachPie repository". [iolevel]. February 10, 2017. https://github.com/peachpiecompiler/peachpie/releases. 
  3. "iolevel/peachpie: License". [iolevel]. https://github.com/peachpiecompiler/peachpie/blob/master/LICENSE.txt. 
  4. Galloway, Jon (2017-07-25). "Welcome Peachpie Compiler Platform to the .NET Foundation". https://dotnetfoundation.org/blog/2017/07/25/welcome-peachpie-compiler-platform-to-the-net-foundation. 
  5. Yegulalp, Serdar (2016-03-14). "Peachpie compiler aims to bring PHP to .Net" (in en). https://www.infoworld.com/article/3043974/peachpie-compiler-aims-to-bring-php-to-net.html. 
  6. phpcompiler (2011-05-04), Phalanger: PHP .NET compiler revealed (1/2), https://www.youtube.com/watch?v=fWbO7PoUyKs, retrieved 2017-02-08 
  7. 7.0 7.1 Hughes, Matthew (2017-02-28). "This company figured out how to run Wordpress on .Net" (in en-US). The Next Web. https://thenextweb.com/dd/2017/02/28/company-figured-run-wordpress-net/. 
  8. ".NET Core Framework - Go Cross-Platform with the .NET Framework" (in en). https://msdn.microsoft.com/en-us/magazine/dn913184.aspx. 
  9. de Icaza, Miguel (2012-03-12). "Phalanger's PHP on Mono/.NET Updates" (in en-US). http://tirania.org/blog/archive/2012/Mar-05.html. 
  10. Adams, Ben (2017-03-11). "Peachpie Plaintext Benchmark". https://github.com/benaadams/PeachpieBenchmarks. 
  11. "Round 16 Results - TechEmpower Framework Benchmarks". 2018-06-06. https://www.techempower.com/benchmarks/#section=data-r16&hw=ph&test=plaintext. 
  12. Krill, Paul (2017-09-20). "Forget PHP! Facebook's HHVM engine switches to Hack instead" (in en). https://www.infoworld.com/article/3226489/forget-php-facebooks-hhvm-engine-switches-to-hack-instead.html. 
  13. Millar, Ethan (2016-05-11). "How Peachpie Compiler Leverages .Net Development Technology In PHP - Web Development Tutorial" (in en-US). Web Development Tutorial. http://www.webdevelopmenthelp.net/2016/05/peachpie-compiler-leverages-net-development.html. 
  14. Microsoft Visual Studio (2017-09-20), Running PHP on .NET Core with Peachpie, https://www.youtube.com/watch?v=Ao-eppi0ndg, retrieved 2018-10-16 
  15. Code Mantisa (2018-09-18), S303 - Advanced C# PHP interoperability with PeachPie by Jakub Misek, https://www.youtube.com/watch?v=TI-oAnG7020, retrieved 2018-10-16 
  16. "Benjamin Fistein & Jakub Míšek - Peachpie PHP compiler for .NET" (in en). https://channel9.msdn.com/Shows/On-NET/Benjamin-Fistein--Jakub-Mek-Peachpie-PHP-compiler-for-NET. 
  17. "Peachpie" (in en). https://channel9.msdn.com/Shows/On-NET/Peachpie. 
  18. ".NET Rocks! vNext". .NET Rocks!. https://dotnetrocks.com/?show=1357. 
  19. "European Innovation Council SME Instrument Phase 1". November 2018. https://ec.europa.eu/research/participants/portal/doc/call/h2020/eic-smeinst-2018-2020/1840110-eic_ph1_11-2018_en.pdf. 
  20. "EIC SME Instrument data hub". https://sme.easme-web.eu/?b=904856838. 
  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" (in cs). https://ihned.cz/c1-66436030-inovativni-napady-ceskych-firem-podpori-evropska-unie-penize-dostane-rehabilitacni-nastroj-pro-lidi-po-mrtvici-ci-nastroj-peachpie-ktery-ocenil-i. 
  22. ".NET Foundation". https://dotnetfoundation.org/projects?type=project&ps=10&pn=5. 
  23. Ben Yacoub, Hatem (2017-02-16). "Peachpie, The PHP Compiler and Runtime for .NET" (in en-US). PHP Magazine Network. http://phpmagazine.net/2017/02/peachpie-the-php-compiler-and-runtime-for-net.html. 
  24. Yegulalp, Serdar. "Peachpie compiler aims to bring PHP to .Net" (in en). InfoWorld. https://www.infoworld.com/article/3043974/application-development/peachpie-compiler-aims-to-bring-php-to-net.html. 
  25. "Benchmarks – Peachpie" (in en-US). http://www.peachpie.io/benchmarks. 
  26. Klose, Ann-Kathrin (2017-09-04). "Peachpie: Wordpress per PHP-Compiler auf .NET nutzen" (in de-DE). entwickler.de. https://entwickler.de/online/php/peachpie-php-dotnet-compiler-579809107.html. 
  27. Adams, Ben (27 May 2019). "Peachpie Benchmarks". https://github.com/benaadams/PeachpieBenchmarks. 
  28. "Round 13 results - TechEmpower". https://www.techempower.com/benchmarks/#section=data-r13&hw=ph&test=plaintext. 
  29. "TechEmpower Framework Benchmarks". https://www.techempower.com/benchmarks/#section=data-r16&hw=ph&test=plaintext. 
  30. "Ben Adams on Twitter" (in en). Twitter. https://twitter.com/ben_a_adams/status/1003252929028132864. 
  31. "Benchmarks". http://v1.php-compiler.net/Benchmarks.htm. 
  32. "Phalanger: Stuffing PHP With Mono, .NET - Phoronix" (in en). http://www.phoronix.com/scan.php?page=news_item&px=MTA2NjM. 
  33. "Phalanger by DEVSENSE". http://v4.php-compiler.net/phalanger-benchmarks. 
  34. Vaggalis, Nikos (24 October 2016). "Peachpie Open Source PHP to .NET Compiler" (in en-US). http://www.i-programmer.info/programming/php/10193-peachpie-open-source-php-to-net-compiler.html?start=1. 
  35. Peipman, Gunnar. "Running PHP Applications on .NET Core - DZone Web Dev" (in en). dzone.com. https://dzone.com/articles/running-php-applications-on-net-core. 
  36. Hanselman, Scott. "The whole of WordPress compiled to .NET Core and a NuGet Package with PeachPie - Scott Hanselman" (in en). https://www.hanselman.com/blog/TheWholeOfWordPressCompiledToNETCoreAndANuGetPackageWithPeachPie.aspx. 
  37. Richlander. ".NET Core Docs" (in en-us). https://docs.microsoft.com/en-us/dotnet/articles/core/index. 
  38. Hanselman, Scott. "Peachpie - Open Source PHP Compiler to .NET and WordPress under ASP.NET Core - Scott Hanselman" (in en). https://www.hanselman.com/blog/PeachpieOpenSourcePHPCompilerToNETAndWordPressUnderASPNETCore.aspx. 
  39. "Partnerschaft zwischen Mozilla und BrowserStack & Updates für Symfony" (in de-DE). 2017-03-06. https://entwickler.de/online/development/partnerschaft-mozilla-browserstack-updates-symfony-579788143.html. 
  40. "Setting up MediaWiki on .NET with Peachpie @ PeachPie | PHP compiler to .NET" (in en-US). 26 February 2018. https://www.peachpie.io/2018/02/mediawiki.html. 
  41. "Performance Progress Report @ PeachPie | PHP compiler to .NET" (in en-US). 4 June 2018. https://www.peachpie.io/2018/06/performance-progress-report.html. 
  42. Baart, Calvin (2019-04-18), GitHub - calvinbaart/laravel-peachpie-sample, https://github.com/calvinbaart/laravel-peachpie-sample, retrieved 2019-04-28 
  43. Llewellyn, Dani (2019-04-26), GitHub - diddledani/net.WordPress.plugin.woocommerce, https://github.com/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.., https://github.com/tobihille/magento-peachpie, retrieved 2019-04-28