Live data from Hacker News

Facebook Porting PHP To JVM

nerds-central.blogspot.com

51–60 of 68 posts

Re: Facebook Porting PHP To JVM

#51
post #43

Earlier quoted context omitted.

Why do you quote selectively? The next part is: "along with their interest in implementing PHP using invokedynamic on the JVM". Also, JVM Language Summit, not Java Language Summit. (OP got it wrong too.) More on http://wiki.jvmlangsummit.com/Main_Page

I quoted selectively because the author gave no source for "their interest in implementing PHP". None. No links. No names. No quotes. No press releases. No blogs. No email archive. Nothing. Not a skerrick. Not a sausage. Not a sniff.

Most likely this was a hallway conversation at JVM Language Summit (which it seems that OP attended). I don't see any particular reason to doubt his claim.

Re: Facebook Porting PHP To JVM

#52
post #51

Earlier quoted context omitted.

I quoted selectively because the author gave no source for "their interest in implementing PHP". None. No links. No names. No quotes. No press releases. No blogs. No email archive. Nothing. Not a skerrick. Not a sausage. Not a sniff.

Most likely this was a hallway conversation at JVM Language Summit (which it seems that OP attended). I don't see any particular reason to doubt his claim.

I do, because he seems to have a bee in his bonnet about the evils of interpreters.

I'm also a bit wary of leaping from one-guy-musing-in-a-hallway to FACEBOOK PORTING PHP TO JAVA.

Re: Facebook Porting PHP To JVM

#53
post #8

This is all great but... why?

My reaction exactly. I have great respect for the JVM, but PHP could simply be replaced by JavaScript for example. It seems easier to me to port PHP to Rhino or node.js than to bring PHP to the JVM. Especially considering CoffeeScript, PHP just can't keep up.

was this post just written with a JavaScript-buzzword generator?

Re: Facebook Porting PHP To JVM

#54

This is all great but... why?

Because: 1. the JVM is an open, stable, mature, fast platform for server applications. 2. Facebook are not moving off PHP any time soon. 3. For stuff outside its written-in-C standard lib, PHP is quite slow. PHP's garbage collection, JITting etc is nowhere near as advanced as the JVM's. 4. Since porting dynamic languages to the JVM is a well-worn pathway, why not try porting PHP and see how it performs? If Facebook c…

What kind of computations were you doing on MRI which resulted in such performance boost by switching to JRuby? I have tried Rails under JRuby many times, the performance is the same as 1.9.3 and memory consumption usually higher.

Re: Facebook Porting PHP To JVM

#55
post #53
post #8

Earlier quoted context omitted.

My reaction exactly. I have great respect for the JVM, but PHP could simply be replaced by JavaScript for example. It seems easier to me to port PHP to Rhino or node.js than to bring PHP to the JVM. Especially considering CoffeeScript, PHP just can't keep up.

was this post just written with a JavaScript-buzzword generator?

Yes.js

Re: Facebook Porting PHP To JVM

#56
post #41
post #6

There are already at least 2 implementations of PHP on the JVM: http://quercus.caucho.com/ http://www.projectzero.org/php/

Has anyone around here actually used either of the above and care to comment? I would be curious to know how compatible they actually are with the average chunk of PHP code, and if not how hard it is to work out whats wrong and get it running.

Quercus is known to run WordPress, MediaWiki, and Drupal without patches.

Re: Facebook Porting PHP To JVM

#57

Earlier quoted context omitted.

Because: 1. the JVM is an open, stable, mature, fast platform for server applications. 2. Facebook are not moving off PHP any time soon. 3. For stuff outside its written-in-C standard lib, PHP is quite slow. PHP's garbage collection, JITting etc is nowhere near as advanced as the JVM's. 4. Since porting dynamic languages to the JVM is a well-worn pathway, why not try porting PHP and see how it performs? If Facebook c…

What kind of computations were you doing on MRI which resulted in such performance boost by switching to JRuby? I have tried Rails under JRuby many times, the performance is the same as 1.9.3 and memory consumption usually higher.

Redmine. Runs faster and smaller per instance of the application.

Re: Facebook Porting PHP To JVM

#58
I work at Facebook and have been involved in the Hiphop for PHP project for the past few years.

We have our own VM written and it isn't based on the JVM.

Bytecode: https://github.com/facebook/hiphop-php/blob/master/doc/bytec...

Code: https://github.com/facebook/hiphop-php/tree/master/src/runti...

Re: Facebook Porting PHP To JVM

#59

Earlier quoted context omitted.

What kind of computations were you doing on MRI which resulted in such performance boost by switching to JRuby? I have tried Rails under JRuby many times, the performance is the same as 1.9.3 and memory consumption usually higher.

Redmine. Runs faster and smaller per instance of the application.

Looking at my post again, I guess I didn't do a very good job.

I didn't mean 2.5Mb per copy of the JVM. I meant per runtime within the JVM. These are run as threads, rather than processes.

So we're really comparing

    n instances of MRI * 50Mb
vs

    1 JVM + (n * 2.5Mb)
Where the cost of the JVM itself is amortised over the application instances.

Sorry, what I said originally is easily misleading.

Re: Facebook Porting PHP To JVM

#60
post #44

Earlier quoted context omitted.

How does it compare with the CLR, or things like LLVM?

I'd say it's on par with the CLR, similar corner cases, similar annoyances. The biggest problem I've had with the CLR is threads bouncing between CPUs but I'd attribute that to Windows as I worked around it with some Win32 calls to pin threads to processors. Can't really compare to LLVM, I haven't personally encountered any of the known llvm bugs (clang to be fair) with Obj-C.

The JVM has a huge advantage over the CLR in that Mono is nothing like as well supported as Oracle supports the JVM and Microsoft's CLR is Windows only - which makes it far to expensive for cloud computing.
Post reply on HN