PHP compiler for JVM
github.com
github.com
Caucho Resin offers 100% php compatibility on the JVM, so that you can host your entire app in a servlet container, and port features one by one. http://www.caucho.com/resin-3.1/doc/quercus.xtp
The PHP-to-Scala migration helper uses Resin/Quercus to provide the standard library to translate PHP to Scala. The output is a Scala codebase, so that you never have to touch the legacy PHP again. https://code.google.com/p/php-to-scala-migration-helper/
It's not clear though which PHP version it does support.
[0] http://www.slideshare.net/billdigman/resin-outperforms-nginx [1] https://www.ruby-forum.com/topic/4404987
Ran it using resin, tomcat, glass fish, and jboss. No real difference by app server.
That said, the biggest issue is always site design. Page too big, too many queries, too many assets loaded, etc. will not benefit much from Quercus or any similar technology.
1. Normally, PHP becomes opcodes for the PHP interpreter to run.
2. Quercus takes PHP code and generates .java source files from it, which then run in the JVM like other Java code.
3. The earlier HipHop (HPHPc) compiles PHP to C++ source
4. The more-recently-released HipHop Virtual Machine (HHVM) is an alternative to PHP's typical interpreter.
> Phalanger – full-featured PHP runtime & compiler for .NET/Mono
> frameworks. Phalanger is modern open-source implementation of PHP,
> compatible with the vast array of existing PHP codeI think the PHP guys themselves should push a bit more for a new runtime though. Otherwise they'd have to write an actual spec and declase theirs as "just" the reference implementation or something.
http://llvm.org/devmtg/2008-08/Lopes_PHP-JIT-InTwoDays.pdf
I think the cost of the garbage collection involved in a JVM implementation vs LLVM significantly outweigh any immediate perceived benefits, especially when you factor in double reference counting anomalies.
I don't know anything about language design or compiling something for JVM.
If you want to follow the progress of the project, you can see this page:
https://github.com/altenwald/ephp/blob/master/doc/COMPATIBIL...
A very simple example is available in this gist:
https://gist.github.com/manuel-rubio/7949523
If you have suggestions, recommendations or questions, don't hesitate to do them to me :-)
Only a bajillion bespoke enterprise apps full of Java-implemented business logic.