Opendata, web and dolomites

Report

Teaser, summary, work performed and final results

Periodic Reporting for period 1 - PCHP (Complete and optimize the PeachPie compiler technology to be fully compatible with the PHP language in order to increase the performance of up to 80% of the internet.)

Teaser

\"As companies grow, they tend to maintain various legacy applications that often cause security threats or performance bottlenecks, and frequently prevent a full utilization of modern technologies and practices. Many legacy applications are written in PHP, a popular...

Summary

\"As companies grow, they tend to maintain various legacy applications that often cause security threats or performance bottlenecks, and frequently prevent a full utilization of modern technologies and practices. Many legacy applications are written in PHP, a popular programming language that powers roughly 80% of all websites today. While the language is widespread, easy to learn, and surrounded by a vast ecosystem, its design poses security risks and slows down the applications’ performance. On the opposite end of the spectrum stands the .NET Framework – a robust, yet complex, language, offering enterprise-grade security and performance. Although a substantial percentage of companies have applications written both in PHP and .NET, integrating the two technologies is generally a complex task leading to significant processing overhead. Moreover, PHP cannot be processed on multiple processor threads in parallel, leading to a significantly higher energy consumption compared to, for example, C#, which is the most popular .NET language.

Our open source technology PeachPie translates PHP to the significantly faster and more secure .NET Framework, allowing for a native integration of the two technologies, substantial performance increases and a mitigation of many common security vulnerabilities preeminent in the PHP language. Using PeachPie, companies can modernize their legacy PHP applications without having to rewrite them, keeping all the business logic intact. Our technology enables developers to interoperate between the two languages, choosing whichever one best fits their use case, speed up their PHP applications and debug their code with powerful diagnostics. Additionally, PeachPie opens up future-proof technologies to PHP developers that are otherwise not accessible to them, such as blockchain, ML, AI or mobile application development. PeachPie allows PHP developers to program applications for a target market otherwise not accessible to them and to create robust enterprise-grade programs. Conversely, our technology enables a .NET developer to re-use the plethora of existing PHP libraries and applications instead of having to write the code from scratch, increasing their operational efficacy. We designed our core algorithms in such a way that they are extensible to other languages as well, and we plan on enhancing PeachPie with the support for the Java language in the future.

The impact on the broader society should at least a portion of the overwhelming market share of PHP websites transition to PeachPie and .NET could be significant. Given that PHP consumes roughly 10 times more energy compared to .NET, the electricity used to power a large portion of the internet could be reduced substantially by switching to our technology.\"

Work performed

From our original work package, following were the three main objectives of the Feasibility Study:
1. Develop the missing functions within PeachPie in order to compile a broader range of popular PHP applications
2. Implement performance optimizations to improve the speed and memory usage of the technology
3. Perform market research in order to verify our business model and development direction

Development:
To work around missing functions or implement them as needed in order to successfully compile the given framework or application.

Wordpress Compile and publish as NuGet Finished 02/19
Drupal Compile Finished 04/19
Laravel Compile Finished 05/19
Magento Compile Finished 04/19
WooCommerce Compile Finished 04/19
Prestashop Compile Finished 05/19
Symfony Compile Finished 05/19
Nette Not originally in scope Finished 05/19

Performance Optimizations:
Improve compile-time and runtime measurements, as well as memory usage

Array structures Optimize usage of array structures Finished 01/19 - 40% decrease in memory usage
Semantic transformations Optimize semantic transformation model Finished 01/19 - 10-50% increase in AST transformation efficiency**
Runtime Implement new APIs; clean up runtime Finished 05/19 for validation purposes, resulting in 40% performance improvements. To be continuously ongoing.

Market validation:
Conduct market research to validate the size of the opportunity and determine the product-market fit.

1. Technology
Validate usefulness online and on conferences
Overwhelmingly positive feedback during our presentations at IT conferences and a 25% increase in our user base since the start of our market validation, reaching 20,000 users and 51,000 pageviews over the feasibility study timespan.
2. Market opportunity
Understand which applications to pursue commercially
We researched & validated total addressable global market size to be 30B Euro derived from approx. 1.2B sites written in PHP, of which 5% relate to our target segment, at an average annual value per site of 500 Euro. In the e-commerce sector alone, there are roughly 800,000 e-shops in Europe, of which roughly 50% are written in PHP. At an average annual value per client of 500 Euro, the serviceable addressable market thus amounts to 200 million Euro. Our focus will be on applications such as Drupal, Magento and WooCommerce (sites with higher propensity to pay).
3. Execution
Evaluate GTM strategy with EU coach and advisors
Leverage enterprise sales early to generate positive cash flow, while designing a scalable SaaS product, and combine Cloud Hub and bundled products into a unified offering. Reach potential clients through community, digital agencies, fairs and direct sales. We validated our target segment to be mainly e-commerce companies, digital agencies, media houses, as well as freelance developers and the open-source community, for which we will provide a set of tools to spread the technology.

Final results

\"From a technological standpoint, there is currently only one project that can, to a certain extent, also compile PHP - HipHop Virtual Machine, or HHVM. This technology was developed by Facebook, a website written in PHP, to bypass the site’sperformance struggles due to its increasing user base. What was then called HPHPc transpiled PHP to C++ code, which also offered a just-in-time (JIT) compilation mechanism and faster runtime possibilities, similar to .NET. Over the years, Facebook created its own extension to the PHP language - Hack - and changed the architecture of its compiler to create a JIT-based PHP virtual machine, akin to the virtual machine that runs the Java language. Facebook switched from HPHPc to HHVM in 2013 and has been running on the new compiler ever since. However, in September 2017, the company officially announced that it would no longer support PHP and will instead focus only on Hack. As a result, future improvements and changes to the PHP language will no longer be compatible with HHVM, and it would be a very problematic endeavor for Facebook to restart its support for PHP in the future. It is important to mention that the objective of HHVM is strictly to provide a performance increase over regular PHP, and no other benefits are offered, e.g. interoperability or added security. Another project that has attempted to approach this issue in the past was J-PHP, which can run PHP code on the Java virtual machine; however, it doesn’t aim to replace the Zend runtime, and therefore cannot be compatible with existing PHP applications. The project is no longer in active development as of May 2019.
Aside from the fact that PeachPie will continue to support future versions of PHP, and can also parse its past versions, there are a number of technological advantages to our approach compared to that of HHVM by Facebook. Firstly, PeachPie compiles PHP code to common intermediate language (CIL) bytecode, which is a standardized bytecode used by all .NET languages, rather than creating a proprietary high-level bytecode, as Facebook has. As a result, PeachPie provides a full bi-directional interoperability of PHP and any .NET language (C#, F# or VB.NET). Furthermore, PeachPie allows for PHP code to be executed on the Common Language Runtime (CLR), targeting Microsoft’s .NET Standard. This crucial feature allows PeachPie to target the full .NET Framework, Xamarin applications, ASP.NET, .NET Core, ASP.NET Core and Mono. Hence, PeachPie enables PHP code to be executed across any platform, device or operating system. Finally, the .NET Core and ASP.NET Core platforms’ lightweight architecture combined with the open-source Kestrel web server provide one of the fastest runtime environments of any current setup, with most benchmarks ranking these platforms among the highest in performance in throughput. Consequently, targeting these new frameworks, whose performance is being improved consistently by Microsoft, imply that PeachPie will outperform HHVM by a large margin in terms of execution speed, particularly in high user concurrency settings.

While the technology itself stands practically without competition, our intended products and certain use cases of the technology, each have distinct viable alternatives. For example, our code analysis, which reveals bugs and security vulnerabilities ahead of launching the product, will compete with some of the well-established projects on the market: PHPStan, a command-line tool that checks for a pre-defined set of errors, exakat.io, a SaaS-like platform and RIPS, an online automated security testing platform. When it comes to static analysis, which reveals errors security threats in the code, we have a much greater level of detail in our code analysis algorithm than would ever be possible with any external tool, which can only skim the surface. PeachPie’s code analysis, on the other hand, scans the very core of an application to its most atomic level, providing the most compre\"

Website & more info

More info: https://www.peachpie.io.