Skip to content

gakowalski/alternative-interpreters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 

Repository files navigation

Alternative Interpreters

JavaScript

See javascript.md - work in progress.

SQL

See sql.md - work in progress.

PHP

Alternative interpreters and compilers

  • php-wasm - Run PHP right in the browser. Live demo included.
  • ePHP - PHP Interpreter in pure 100% Erlang (requires Erlang/OTP 19+), see compatibility table
  • graalphp - an experimental just-in-time (JIT) compiler and runtime for PHP 7.4+ built on GraalVM (see some benchmarks)
  • Goro - incomplete implementation of PHP 7.2 written in pure Go with support for goroutines, better caching of compiled code by allowing sharing of compiled or live objects (classes, objects, etc) between running PHP scripts
  • HippyVM - an implementation of the PHP language using RPython/PyPy technology
  • JPHP - compiles PHP 7.1+ sources to JVM bytecode which can be executed on Java VM; adds possibility to use Java libraries in PHP, Java-like multithreading, sockets, creating GUI Android and Desktop apps (JavaFX or SWT), hot reloading for classes and functions; offers dedicated IDE called DevelNext IDE
  • KPHP - compiles a limited subset of PHP to a native binary running faster than PHP
  • PeachPie - a modern PHP compiler based on the Microsoft Roslyn compiler platform and drawing from Phalanger project (PHP 5.4 compiler for .NET/Mono); it allows PHP to be executed within the .NET framework, thereby opening the door for PHP developers into the world of .NET and vice versa. [7]
  • php-interpreter - a PHP interpreter written in TypeScript, supports PHP 7
  • php.js - reads PHP code and transforms it into JavaScript code and then runs
  • PHP Emulator - emulates PHP 5.4; made for advanced debugging
  • PH7 - An Embedded Implementation of PHP 5 with a lot of PHP 7+ and C++-like improvements, see its distinctive features
  • pipp - an implementation of the language PHP that runs on Parrot Virtual Machine, predeccessor of MoarVM
  • PolarPHP - PHP 7 compiler with support for asynchronous programming, multi-threading and coroutines
  • pyhp - incomplete implementation of the PHP language using the RPython technology (for complete implementation see: HippyVM)
  • pyhp.js - PyHP interpreter translated into JavaScript using emscripten, resulting javascript file is asm.js which can be loaded in any browser or ran with Node.js
  • Quercus - Java implementation of the PHP language
  • PHPPHP - PHP interpreter written in PHP, low performance, predecessor of much faster Recki Compiler Toolkit for PHP
  • Recki Compiler Toolkit for PHP - quote from [1]: "a compiler written entirely in PHP and only targets a subset of the PHP specification. It intentionally limits itself to a more static subset so that it is faster. This means that it does not support things like references, variable-variables and global variables. Recki-CT compiles PHP down to machine code but unlike HHVM and HippyVM, which use Just in Time compilation to compile PHP, it uses Ahead of Time compilation which caches an intermediary representation that can be compiled at run-time. Therefore, more aggressive optimisations can be applied and more efficient code can be generated. Based on trivial benchmarks, Recki-CT proves to be extremely fast."
  • php-compiler - PHP compiler, succesor of PHPPHP and Recki Compiler Toolkit for PHP
  • Uniter - PHP client-side in the browser or in Node.js.

Referenced in academic papers but not located online:

  • P8 - a Java implementation of PHP 5 with Java bytecode generation, running on IBM J9 VM 1.5.0, referenced in [4]
  • P9 - a JIT-compiler-based PHP engine, based on IBM J9 VM 1.5.0, referenced in [4]

Some old stuff: https://stackoverflow.com/a/1408499/925196

Trans-compilers

  • Blueberry - a script language with clean syntax, inspired from Ruby, CoffeeScript, and Python which compiles to PHP
  • Fructose - a Ruby-like language that compiles to PHP
  • Haxe - high-level strictly-typed programming language with a fast optimizing cross-compiler which also compiles to PHP
  • lua2php - Lua to PHP transpiler
  • mammouth - a small language that compiles into PHP, inspired by CoffeeScript (eg. "Everything is an expression"); compiler itself is written in Dart
  • Phabel - allows native usage of PHP 8+ features and especially syntax in projects and libraries, while allowing maintainers to publish a version targeting lower versions of php
  • Pharen - compiles a Lisp-inspired language to PHP
  • Phel - dialect of Lisp that compiles to PHP
  • Pratphall - an optionally-typed language that compiles to readable PHP
  • Salty - a language that compiles to PHP, JavaScript, and JSX; Haskell-inspired
  • Snowscript - a language that compiles to PHP; its syntax is inspired by Python, Lua, Coffescript, Go and Scala and strives to be DRY, clean and easy to read as well as write
  • THT - a clean re-design of PHP, making it more secure and easier to use; see how THT compares to PHP
  • tré - transpiles Lisp to JavaScript and PHP7+; runs on top of Steel Bank Common Lisp (sbcl).
  • XP Compiler - translates between Hack language, PHP 8.2, 8.1, 8.0, PHP 7.4, PHP 7.3, PHP 7.2, PHP 7.1 and PHP 7.0.

Also transcompilers not for full programming languages:

  • Swagger Editor - can generate PHP client code from OpenAPI JSON description
  • Twig - a templating engine and language that compiles to PHP;

Preprocessors

  • Pre - compiles new syntax to work in new and old versions of PHP; original website of this project is down, but it's code is avalable in this GitHub repo. Still, its might be better to check all the different repos available for the user "Pre." as they seem to be different preprocessors built on top of some shared library or framework (see this list of packages dependent on pre/plugin)

Process managers

  • PHP-FPM - a primary PHP FastCGI implementation containing features useful for heavy-loaded sites.
  • PHP-PM - a process manager, supercharger and load balancer for PHP applications that use request-response frameworks like Symfony's HTTPKernel; performance boost up to 15x compared to PHP-FPM, Symfony applications.

Alternative PHP Virtual Machines

  • HHVM - an open-source virtual machine designed for executing programs written in Hack (originally superset of PHP)
  • Tagua VM - an experimental PHP Virtual Machine that guarantees safety and quality by removing large classes of vulnerabilities thanks to the Rust language and the LLVM Compiler Infrastructure

Other

  • AerScript - general-purpose, object-oriented scripting programming language based on PH7 (alternative PHP interpreter)

Languages derived from PHP

  • Hack - PHP-like new language with gradual typing, generics and new container types (vector, map, set, pair) executed on HipHop Virtual Machine (HHVM) [2][6]
  • PXP - superset of the PHP programming language, heavily inspired by the goals of the TypeScript project, aiming to improve and enhance PHP with transpilation; features its own language server to be used in programming editors and IDEs.
  • Plus-1 - described as "a superset of PHP" and "runtime compiler that adds features to PHP", created by one of the most prominent Laravel community members, unfortunately docmentation seems to be lost (was at https://php-plus.com/ but Internet Archive responds with error when trying to retrieve it).

Research papers

References

  • [1] KHAN, Sher Ali; MAFFEIS, Sergio. A Comparative Study of PHP Dialects. 2015.
  • [2] ADAMS, Keith, et al. The hiphop virtual machine. In: Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications. 2014. p. 777-790.
  • [3] OTTONI, Guilherme. HHVM JIT: A Profile-guided, Region-based Compiler for PHP and Hack. In: Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation. 2018. p. 151-165.
  • [4] TATSUBORI, Michiaki, et al. Evaluation of a just-in-time compiler retrofitted for PHP. ACM Sigplan Notices, 2010, 45.7: 121-132.
  • [5] BENDA, Jan; MATOUSEK, Tomas; PROSEK, Ladislav. Phalanger: Compiling and running PHP applications on the Microsoft .NET platform. .NET Technologies 2006, 2006.
  • [6] ZHAO, Haiping, et al. The HipHop compiler for PHP. ACM SIGPLAN Notices, 2012, 47.10: 575-586.
  • [7] Robert Husák, Jakub Míšek, Filip Zavoral, Jan Kofroň. PeachPie: Mature PHP to CLI compiler, Journal of Computer Languages, Volume 73, 2022, 101152, ISSN 2590-1184, https://doi.org/10.1016/j.cola.2022.101152.

About

List of alternative PHP nad JS interpreters and compilers

Topics

Resources

Stars

Watchers

Forks