Live data from Hacker News

Facebook Porting PHP To JVM

nerds-central.blogspot.com

41–50 of 68 posts

Re: Facebook Porting PHP To JVM

#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.

Re: Facebook Porting PHP To JVM

#43

It should be noted that there is no direct evidence that this is happening , other than: "The presence of Facebook engineers at the Java Language Summit in San-Francisco" Is the author aware that Facebook is a multi-language shop? It's why they have Thrift, after all.

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

Re: Facebook Porting PHP To JVM

#44
post #17

Earlier quoted context omitted.

There aren't that many problems with the JVM compared with Java. Most of what makes java suck is the language and what makes the performance sluggish is the standard lib as well as the programming style the community encourages. As much as I love to rag on java the language the JVM is generally a solid piece of work that makes reasonable tradeoffs.

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.

Re: Facebook Porting PHP To JVM

#45

Why do these companies like the JVM so much? Twitter, and now Facebook. Does it have that great of performance?

Yes. http://shootout.alioth.debian.org/u64q/which-programming-lan... Note that Java compares very favorably with C. (Of course, the real thing to take away from that chart is: why don't all the JVM users switch to Haskell? It's more concise, safer, and has a better community.)

Now that benchmark you linked has a hidden bias towards Java. If you read the methodology listed in their FAQ, they mention they ran each benchmark for Java 66 times in the same JVM instance before discarding the first 65 results, which leaves out the initial iterations before JIT has kicked in. For servers, which perform many similar operations for each client and are rarely restarted, the benchmark you posted is probably valid. But for jobs that wouldn't benefit from JIT, Java would perform much more slowly.

Re: Facebook Porting PHP To JVM

#46

Why do these companies like the JVM so much? Twitter, and now Facebook. Does it have that great of performance?

It's one of the most scalable, robust, secure, proven mainstream web platforms available. And at almost any server-side scale it performs better than PHP, Ruby, and Python. As far as mainstream languages go, only C and C++ have a performance and scalability edge, but C++ at least comes with more complexity. JVM seems to hit the performance:complexity sweet spot.

[deleted]

Re: Facebook Porting PHP To JVM

#47

Earlier quoted context omitted.

I don't understand what's wrong with exploring your options. Why would you assume that the reasoning has something to do with politics rather than trying to find a better technical solution to their problem?

They're not exploring a research space, they're exploring a space where the options are incredibly well known, and they're jumping from solution to solution, even after they appear to find a success.

yeah, god forbid they feel that their initial success could be improved upon; They should put down their tools as soon as they get their first version that works

/sarcasm

Re: Facebook Porting PHP To JVM

#48

Earlier quoted context omitted.

I don't understand what's wrong with exploring your options. Why would you assume that the reasoning has something to do with politics rather than trying to find a better technical solution to their problem?

They're not exploring a research space, they're exploring a space where the options are incredibly well known, and they're jumping from solution to solution, even after they appear to find a success.

If they have enough resources, they can afford to try all options in parallel. Wasteful, but although it may seem strange, it isn't like programming language implementation engineering is expensive compared to data centers.

Re: Facebook Porting PHP To JVM

#49
post #43

It should be noted that there is no direct evidence that this is happening , other than: "The presence of Facebook engineers at the Java Language Summit in San-Francisco" Is the author aware that Facebook is a multi-language shop? It's why they have Thrift, after all.

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.

Re: Facebook Porting PHP To JVM

#50

Earlier quoted context omitted.

Yes. http://shootout.alioth.debian.org/u64q/which-programming-lan... Note that Java compares very favorably with C. (Of course, the real thing to take away from that chart is: why don't all the JVM users switch to Haskell? It's more concise, safer, and has a better community.)

Now that benchmark you linked has a hidden bias towards Java. If you read the methodology listed in their FAQ, they mention they ran each benchmark for Java 66 times in the same JVM instance before discarding the first 65 results, which leaves out the initial iterations before JIT has kicked in. For servers, which perform many similar operations for each client and are rarely restarted, the benchmark you posted is pr…

NOT TRUE.

If you read the methodology listed in their FAQ, they state in bold - "Time measurements include program startup time".

http://shootout.alioth.debian.org/help.php#time

If you read the section "What about Java?" they mention ADDITIONAL measurements, which are only shown on the Help page, and indicate how little difference JVM startup time makes once these programs have run for 5 seconds and 20 seconds.

http://shootout.alioth.debian.org/help.php#java

Post reply on HN