TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Facebook Porting PHP To JVM

44 pointsby code-dogalmost 13 years ago

12 comments

kingkilralmost 13 years ago
At this point I have to just laugh. They literally already paid for the development of a prototype for a faster PHP, and decided not to pursue that route: <a href="http://morepypy.blogspot.com/2012/07/hello-everyone.html" rel="nofollow">http://morepypy.blogspot.com/2012/07/hello-everyone.html</a>. I have to assume they have some insane internal politics, because there's no sane technical reason to develop HipHop (static subset-of-php to C++ compiler), then start the HipHop VM, then fund the PHP on PyPy prototype, and now apparently move to a PHP on the JVM.
评论 #4374060 未加载
评论 #4374055 未加载
评论 #4374231 未加载
abolibibelotalmost 13 years ago
Phalanger ( <a href="http://phalanger.codeplex.com/" rel="nofollow">http://phalanger.codeplex.com/</a> ) is an implementation of PHP running on the CLR with a fairly good compatibility story and sometimes much better performance.<p>Phalanger worked well even without using the DLR (dynamic language runtime) so a JVM implementation shouldn't be a massive undertaking (except for the lexer and parser parts...)
nickmainalmost 13 years ago
There are already at least 2 implementations of PHP on the JVM:<p><a href="http://quercus.caucho.com/" rel="nofollow">http://quercus.caucho.com/</a> <a href="http://www.projectzero.org/php/" rel="nofollow">http://www.projectzero.org/php/</a>
评论 #4374240 未加载
scottmacalmost 13 years ago
I work at Facebook and have been involved in the Hiphop for PHP project for the past few years.<p>We have our own VM written and it isn't based on the JVM.<p>Bytecode: <a href="https://github.com/facebook/hiphop-php/blob/master/doc/bytecode.specification" rel="nofollow">https://github.com/facebook/hiphop-php/blob/master/doc/bytec...</a><p>Code: <a href="https://github.com/facebook/hiphop-php/tree/master/src/runtime/vm" rel="nofollow">https://github.com/facebook/hiphop-php/tree/master/src/runti...</a>
jacques_chesteralmost 13 years ago
It should be noted that there is <i>no direct evidence that this is happening</i>, other than:<p>"The presence of Facebook engineers at the Java Language Summit in San-Francisco"<p>Is the author aware that Facebook is a multi-language shop? It's why they have Thrift, after all.
评论 #4374253 未加载
stephen_mcdalmost 13 years ago
It's the summer of 2018. Facebook shares drop to 17 cents as their PHP to ASM compiler project nears completion.
评论 #4373707 未加载
lukevalmost 13 years ago
I guess someone must <i>really</i> love PHP, though I'm slightly confused as to why.<p>If you're going to make such a massive undertaking anyway (it's not just the new runtime, all existing code will have to be re-tested and re-debugged), why not sink the man-hours into putting it into a new language better suited to the task from the start?
评论 #4373972 未加载
评论 #4373911 未加载
评论 #4373935 未加载
prezjordanalmost 13 years ago
Why do these companies like the JVM so much? Twitter, and now Facebook. Does it have that great of performance?
评论 #4374050 未加载
评论 #4373978 未加载
评论 #4373952 未加载
hdoan741almost 13 years ago
Is there any official reference to backup the claim? I doubt Facebook would spend effort on doing this since they have already port PHP to C++ with Hiphop.
评论 #4374027 未加载
krobalmost 13 years ago
Lets ask this one question. Why rewrite python in python? Why rewrite Ruby with java? They may have realized that php is a good solution for their existing framework, the framework has an enormous unit test harness, which would take a very long time to translate, and they have nothing against the language at the company. If they are planning a jvm for php, it is probably because they have developers there who have experienced the speed increase of other jvm langauges like jruby, jthon, etc. I'd wager money that they will probably use one of the current open source translations and build on top of that, maybe gut it like crazy and use it as a foundation. A full rewrite if php in jvm would probably be extremely difficult timewise.
maratdalmost 13 years ago
&#62; Facebook are looking to move PHP on.<p>Did Google Translate write the article?
dreamdu5talmost 13 years ago
This is all great but... why?
评论 #4374207 未加载
评论 #4373899 未加载