Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Facebook Releases JIT PHP Compiler

Unknown Lamer posted more than 2 years ago | from the history-repeats-itself dept.

Facebook 244

angry tapir writes, quoting a Techworld article: "In its continuing endeavor to serve its 800 million users as quickly as possible, Facebook is once again revamping the way it handles its PHP-based Web pages. Facebook has posted ... its HipHop Virtual Machine (HHVM), which the company's engineers call a just-in-time PHP compiler. According to Facebook, this PHP execution engine is 60 percent faster than its current PHP interpreter and uses 90 percent less memory." Facebook has a weblog post with a more technical description.

Sorry! There are no comments related to the filter you selected.

First PHP post (5, Funny)

PCM2 (4486) | more than 2 years ago | (#38350378)

I'd like to launch this discussion by making a snide remark about PHP.

Re:First PHP post (2)

Roachie (2180772) | more than 2 years ago | (#38350388)

Yea, perhaps Facebook can now develop a tool for REAL programmers!

Re:First PHP post (5, Funny)

Anonymous Coward | more than 2 years ago | (#38350564)

Aren't Facebook programmers already tools?

Re:First PHP post (0)

rwa2 (4391) | more than 2 years ago | (#38350930)

Ha, yeah, every company I've ever worked for has been trying to bury PHP :-P This bodes not well.

Is it open sourced? (4, Insightful)

Taco Cowboy (5327) | more than 2 years ago | (#38350432)

Is FB's JIT PHP open sourced?

Re:Is it open sourced? (-1)

Anonymous Coward | more than 2 years ago | (#38350482)

Are you seriously this dumb?

Re:Is it open sourced? (5, Funny)

ksd1337 (1029386) | more than 2 years ago | (#38351032)

Hey, he's got a 4-digit UID! Respect your elders!

Re:Is it open sourced? (0, Funny)

Anonymous Coward | more than 2 years ago | (#38351078)

Yeah, I should be glad he doesn't have l33t sp34k in his name at least.

Re:Is it open sourced? (5, Informative)

PCM2 (4486) | more than 2 years ago | (#38350496)

Is FB's JIT PHP open sourced?

It appears to be licensed under a combination of the PHP license and the Zend license. Both are BSD-like, but the Zend license has a clause that requires you to advertise for Zend if you advertise for a product built with the Zend Engine, which I don't much care for.

Re:Is it open sourced? (0)

Anonymous Coward | more than 2 years ago | (#38351290)

Or you could buy a license(s) of Zend and not have the requirement.

Re:Is it open sourced? (4, Interesting)

PCM2 (4486) | more than 2 years ago | (#38351610)

The Zend Engine license [zend.com] seems contradictory to me. On the one hand, Clause 3 says you're forbidden from using the terms "Zend" or "Zend Engine" to endorse or promote your product. On the other hand, Clauses 5 and 6 say you're absolutely required to use the term "Zend Engine" to endorse and promote your product. Seems like someone took the classic BSD license and bolted a commercial land grab onto it, which seems to honor neither the letter nor the spirit of the original.

Re:Is it open sourced? (2)

interval1066 (668936) | more than 2 years ago | (#38351590)

Hey, say what you want about fb, this news is a net Good Thing(tm). Its not bad that they add to the community and add something useful. And a JIT for php is a good thing.

Re:Is it open sourced? (5, Informative)

Anonymous Coward | more than 2 years ago | (#38350498)

If it's not, back to Xcache or APC.

Their "10 times figure" is absolutely correct though, in both Xcache and APC, the compiled binaries to take up 10 times as much space on disk and/or in memory, but to put things in perspective, that's caching memory. It was already consuming that 10 times size when being run directly from php before.

Memory pigs like wordpress eat like 64MB of memory before you even get to plugins. Memory deduplication is required if you are running multiple blogs because the cache files generated by things like SuperCache and MaxCDN also eat up the opcode cache space.

Fun times.

#1 rule of php memory management: NEVER inline html. Many people use it as a easy way to do SSI, but this eats memory, opcode cache or not.

Re:Is it open sourced? (1)

ravenspear (756059) | more than 2 years ago | (#38350650)

or eaccelerator.

I had stability issues with both xcache and APC on my production servers where things would go unexpectedly missing from the cache and throw nasty errors.

No such issues with eaccelerator. very happy with that.

Re:Is it open sourced? (1)

Mad Merlin (837387) | more than 2 years ago | (#38351362)

I had the opposite experience. When testing on some newer quad core servers (several years ago), I found that eaccelerator would cause segfaults in Apache that I couldn't pin down to anything in particular. It wasn't hardware either, because it happened on several machines equally. I ditched eaccelerator for APC and things have been peachy since.

Re:Is it open sourced? (1)

Anonymous Coward | more than 2 years ago | (#38351416)

>>If it's not, back to Xcache or APC.
Any idea why they don't provide a PHP+APC benchmark?
*hint*Probably because then their little creation suddenly doesn't seem all the fantastic anymore.*hint*

Lately I'm seeing a lot of 'look-what-a-genius-I-am'-spam coming out of big companies in order to impress the management.

Re:Is it open sourced? (4, Informative)

nzac (1822298) | more than 2 years ago | (#38350504)

Its on github and depends on open-source libraries.

from the github page:

HipHop is licensed under the PHP and Zend licenses except as otherwise noted.

Its opens source but not copyleft/gpl and if you want to contribute to the project i think you have to sign over the copyright (need facebook login to see the agreement).

Re:Is it open sourced? (1)

MikeyO (99577) | more than 2 years ago | (#38350508)

A 4 digit ID and you can't make it to RTFA? :)

Re:Is it open sourced? (-1)

Anonymous Coward | more than 2 years ago | (#38350558)

In the years since acquiring the ID, he decided to live up to his name. I know that if I were a "taco cowboy" I'd probably be too distracted to follow links. People are just jealous because the only tacos they get are from Mexicans behind counters, and they ain't metaphorical.

Re:Is it open sourced? (-1)

Anonymous Coward | more than 2 years ago | (#38350524)

Are you too stupid to click the github link to the source code?

Re:Is it open sourced? (2)

Rennt (582550) | more than 2 years ago | (#38350536)

Yes. Code is up on github, a link to it cleverly hidden right there in the summary.

Re:Is it open sourced? (1)

cshark (673578) | more than 2 years ago | (#38351496)

Yes. I don't remember which license it's under though.

Re:First PHP post (5, Funny)

MattW (97290) | more than 2 years ago | (#38350736)

It's too bad PHP doesn't scale.

Re:First PHP post (1)

garyebickford (222422) | more than 2 years ago | (#38351084)

Haha. :D

Re:First PHP post (2)

ohnocitizen (1951674) | more than 2 years ago | (#38351182)

Great, along with all the other evils Facebook has perpetuated on the net, they've now made php more powerful and potentially more popular. They might as well give Darth Vader a perm.

Yo Dawgs! (3, Funny)

syousef (465911) | more than 2 years ago | (#38350398)

Da Hip Hop PHP compila is in Da House! Respect bitches!

Re:Yo Dawgs! (3, Funny)

binarylarry (1338699) | more than 2 years ago | (#38350740)

Yo dawg I heard you like PHP, so we put an optimizing JIT compiler in your PHP runtime, so you can execute PHP code while you execute PHP code!

Re:Yo Dawgs! (2, Funny)

syousef (465911) | more than 2 years ago | (#38350780)

Yo dawg I heard you like PHP, so we put an optimizing JIT compiler in your PHP runtime, so you can execute PHP code while you execute PHP code!

Yo mama executes unoptimized PHP!

Re:Yo Dawgs! (5, Funny)

iluvcapra (782887) | more than 2 years ago | (#38351276)

Yo mama's so fat, she thinks strstr(needle, haystack) and strstr(haystack, needle) both sound delicious, she just can't ever remember which one is the one to use.

Yo mama's so fat, she hides food in $a[1] and $a["1"].

Yo mama's so fat, she silently coerces strings into sandwich, and when the interpreter complains, she puts an @ sign in front of it.

Re:Yo Dawgs! (5, Funny)

MrEricSir (398214) | more than 2 years ago | (#38351004)

Yo dawg I heard you like interpreting PHP code, so we put an eval() function in PHP so you can interpret PHP while you interpret PHP!

Mixed feelings (1)

Etz Haim (856183) | more than 2 years ago | (#38350400)

That's a step forward for us who rely on crammed share hosting providers, but I strongly believe that PHP has to be phased out in favor of more recent techologies that enforce a clearer (eg DRY, separation of content and logic etc) way of thinking.

Re:Mixed feelings (5, Insightful)

yelvington (8169) | more than 2 years ago | (#38350422)

That's a step forward for us who rely on crammed share hosting providers, but I strongly believe that PHP has to be phased out in favor of more recent techologies that enforce a clearer (eg DRY, separation of content and logic etc) way of thinking.

Programming languages don't create programming messes. People do.

Re:Mixed feelings (3, Insightful)

Etz Haim (856183) | more than 2 years ago | (#38350456)

I was expecting this. You could argue that, and also add to it that there are PHP frameworks out there that do DRY, MVC etc. The problem is that PHP itself, by allowing "mixed mode" scripts containing both HTML and PHP, teaches a programming paradigm that is unacceptable by modern standards.

Re:Mixed feelings (4, Insightful)

InsightIn140Bytes (2522112) | more than 2 years ago | (#38350478)

No it doesn't. It's entirely up to you how you use an programming language. It's good that PHP supports "mixed mode" and everything between. Hell, I've made IRC server with PHP along with desktop apps and everything else.

Re:Mixed feelings (5, Funny)

CodeReign (2426810) | more than 2 years ago | (#38350556)

You are a disgusting filth and I will loath the existence of people who don't use the right tool for the right job for the rest of my life.

Re:Mixed feelings (5, Insightful)

InsightIn140Bytes (2522112) | more than 2 years ago | (#38350666)

You are a disgusting filth and I will loath the existence of people who don't use the right tool for the right job for the rest of my life.

You know, people who do fancy stuff with not exactly the right tools were called "hackers".

Re:Mixed feelings (3, Insightful)

shutdown -p now (807394) | more than 2 years ago | (#38351204)

You know, people who do fancy stuff with not exactly the right tools were called "hackers".

Only when it's either hard to do so, or when doing that is some kind of a pun. When the only hallmark of such a work is that the result is a bloated mess...no, hacking doesn't have much to do with it.

Re:Mixed feelings (0)

Anonymous Coward | more than 2 years ago | (#38351364)

Of course it does. Then it's called an ugly hack.

Re:Mixed feelings (5, Funny)

Zero__Kelvin (151819) | more than 2 years ago | (#38351566)

"You know, people who do fancy stuff with not exactly the right tools, when the right tools were not available, ARE called "hackers".

FTFY.

People who use the wrong tool when the right tool is available are called PHP programmers ;-)

Re:Mixed feelings (5, Interesting)

cshark (673578) | more than 2 years ago | (#38351678)

You know, you hear that kind of weird argument a lot from people who don't realize they've been framework programming on Microsoft platforms. They are always complaining about how primitive PHP is because it doesn't have any "built in" separation between the various heavily abstracted but highly arbitrary layers, and that they don't understand the way PHP abstracts logic, variable classes, magic methods, lambada syntax, etc. They're always pointing to perceived shortcomings in PHP, like the one data interchange layer they know about, or the fact that PHP doesn't pass complete classes as strings. The list goes on for fucking ever. The intentional ignorance of these people annoys the holy shit out of me. Or, well... it used to.

You know, by the same criteria these "evangelist" idiots are using to judge PHP, and failing to apply their idea of "modern", they would be sorely disappointed with any number of other languages. PHP is C++ script. Plane and simple. So if you hate PHP, or you simply can't bring yourself to understand it, it's fair to assume you wouldn't like like C++ either. And for that matter, you certainly wouldn't enjoy Perl, any version of C (other than the sharp kind), Python, Ruby, Java, or any other modern language not developed by our friends in Redmond. None of them would be "modern" enough for you. Or maybe, you're just not skilled enough at your chosen craft. Nobody will ever appreciate the artist who refused to paint because he didn't like the brushes.

PHP isn't the only language that people have written mountains of bad code on either. If you could even begin to understand the mountain of truly nightmarishly bad .net code I've had to wade through over the last decade, you would give me a fucking medal. In fact, I would wager to say that it's easier to write a large, poorly architected application in C# than it is to write one in PHP. Why? Easy. Because Visual Studio doesn't require you to actually think a whole hell of a lot about what you're coding.

When you write something in PHP, it's a direct reflection of your ability to code. That's all it is. Code. Start to finish. You think out a problem, and then you write the code to do it. If you want to seperate it into objects, classes, or layers, you're entitled to. If you have another way to do it, that's also fine.

PHP gives you absolute control and power over whatever it is you want to create. If you're not used to it, or ready for that kind of responsability, it can be frightening.

So I totally understand why lesser programmers hate it.
Personally, I like having options.

Re:Mixed feelings (4, Insightful)

John Courtland (585609) | more than 2 years ago | (#38350474)

Bullshit. PHP's standard library is a piece of shit that certainly promotes bad coding practices. Case in point: http://us3.php.net/manual/en/function.implode.php [php.net]

And I quote:

implode() can, for historical reasons, accept its parameters in either order. For consistency with explode(), however, it may be less confusing to use the documented order of arguments.

What's your problem? Very well documented! (5, Funny)

syousef (465911) | more than 2 years ago | (#38350506)

And I quote:

implode() can, for historical reasons, accept its parameters in either order. For consistency with explode(), however, it may be less confusing to use the documented order of arguments.

What is your problem with this exactly? The functions do exactly what their name suggests. They will either make your head implode or explode!

Re:Mixed feelings (0)

Anonymous Coward | more than 2 years ago | (#38350912)

How can a six-digit-ID /.'er be so ignorant? Both implode() and explode() are perfectly consistent with one another. What's the problem?

Re:Mixed feelings (1)

John Courtland (585609) | more than 2 years ago | (#38351178)

You're fucking kidding right?

Re:Mixed feelings (5, Interesting)

trawg (308495) | more than 2 years ago | (#38351440)

I disagree that it promotes bad coding practices. I read that as a bit of a tongue-in-cheek comment that actually encourages people to use it the right way, while at the same time drawing attention to the fact that you can swap parameters and you might get unexpected results (i.e., the function working even though it should throw some sort of type error).

Sometimes mistakes are made in libraries and terrible ugly hacks have to be made to work around them so as not to destroy many hours of work. Whether or not PHP has its share doesn't mean the blame for writing terrible code should be laid entirely at its doorstep.

Certainly a few crappy library functions hasn't soured Facebook on PHP; I for one am glad to see their continued investment in it and - more importantly - their continued practice of open sourcing new and innovative ways of dealing with PHP.

Re:Mixed feelings (1)

leperkuhn (634833) | more than 2 years ago | (#38351706)

I agree with you that PHP's standard library is a piece of shit, but I agree with the parent's post that people create the problem. If you choose to implement the standard library in a messy fashion, it'll be a mess. I wrote PHP for a while (8 years maybe?) and the last few projects I started people were able to easily jump on board and start working immediately.

Re:Mixed feelings (0)

Anonymous Coward | more than 2 years ago | (#38351730)

Looks fine to me, and I'm a C++ developer.

PHP is a damn fine language. There are worse, shittier languages out there.
PHP's popularity is the reason it gets so much hate - Just don't forget it gets a lot of love too.

And, who the hell are you to say something is shit? Grow up.

Re:Mixed feelings (1)

Nerdfest (867930) | more than 2 years ago | (#38350602)

Programming languages don't create programming messes. People do.

... and PHP is one of their tools of choice.

Re:Mixed feelings (2)

binarylarry (1338699) | more than 2 years ago | (#38350756)

Let me fix that for you:

...and PHP is the choice of tools!

Re:Mixed feelings (1)

cshark (673578) | more than 2 years ago | (#38351792)

No, it's possessive, and you shouldn't start a sentence that way. So it would have to be:

Let me fix that for you:

Thus, PHP is their preferred tool set.

Re:Mixed feelings (1)

LordLucless (582312) | more than 2 years ago | (#38351374)

more recent techologies that enforce a clearer (eg DRY, separation of content and logic etc) way of thinking.

Yes, please give me more programming languages that enforce a way of thinking on me.

Re:Mixed feelings (1)

Zero__Kelvin (151819) | more than 2 years ago | (#38351596)

If you don't like to think logically, then you clearly need exactly that.

Re:Mixed feelings (1)

LordLucless (582312) | more than 2 years ago | (#38351704)

As long as your logic is the exact same logic as intended by the author of the language.

Yeah, pass. Support, fine; enforce, see ya.

Re:Mixed feelings (1)

cshark (673578) | more than 2 years ago | (#38351802)

How about Brainf*ck?

Re:Mixed feelings (2)

Zero__Kelvin (151819) | more than 2 years ago | (#38351542)

"Programming languages don't create programming messes. People do."

True; people who don't know how to design software and think that you start creating a solution by programming create programming messes. Programming languages encourage design messes, though. PHP is a programming mess waiting to happen because it attracts people who think that step one is to start coding.

Re:Mixed feelings (1)

alonsoac (180192) | more than 2 years ago | (#38351862)

But what do I care what other people do in PHP or whatever other language? I care about what I can do and what my coleagues can do. We are very good and efficient after 11 years using PHP. I had used Microsoft languages before that and I am very happy to have made the switch to PHP.

Re:Mixed feelings (5, Insightful)

vinng86 (1978262) | more than 2 years ago | (#38350458)

You must be knew to programming. PHP is a language, not a framework. You can use a PHP framework to apply a MVC (model/view/controller) structure or you can choose not to. It's entirely up to the programmer, not the language.

Re:Mixed feelings (1)

Etz Haim (856183) | more than 2 years ago | (#38350580)

My suggestion was that "mixed mode" scripts are per se incompatible with the MVC or DRY. It's a bad programming practice and if you use it, you are doomed to repeat yourself. Of course you can ditch it and create MVC frameworks like these that are already available. At this latter point you and I may agree.

Re:Mixed feelings (2)

shutdown -p now (807394) | more than 2 years ago | (#38351210)

Mixed mode is the least of PHP troubles as a language. It's things like silently converting strings to numbers when used as keys of associative arrays that really makes it so irksome .

Re:Mixed feelings (4, Insightful)

garyebickford (222422) | more than 2 years ago | (#38351268)

Ya know, about 30 years ago, that statement could have been written thusly:

C programs are per se incompatible with the structured programming model. It's a bad programming practice and if you use it, you are doomed to repeat yourself.

Your statement is pretty much equivalent to "never end a sentence with a preposition".

Structured programming eventually failed to take over the world because it imposed too much artificial, restrictive structure. Back then I remarked that "structured programming" was merely a way to force all programs to fit on a flat two-dimensional surface with no crossing lines. Admittedly, such programs are easier to analyze, but are a tiny, tiny subset of the set of interesting and useful programs. For example, one can look at the entire internet as one rather large, complex, multithreaded program.

MVC is a good model, but it ain't the be-all and end-all. All models are an attempt to impose an rational order on what is essentially a linguistic medium (with a veneer of logic). The languages that survive are those that allow the maximum flexibility, with enough support for the tools of analysis and good practice to allow programmers to succeed. C, for example, continues to succeed because it does not have such artificial constraints, but can be adapted to the constraints that the programmer (and the organization) considers important at the time. As a counterexample, see Pascal, or Algol. And don't forget Gõdel.

So, use MVC and DRY. But one day you will find a situation where they get in the way of the most elegant solution. Or, more likely, they will get in the way of hacking a new feature into some legacy POS in time to meet the deadline that Marketing already promised to the client! :D

Re:Mixed feelings (1)

rabtech (223758) | more than 2 years ago | (#38351568)

So, use MVC and DRY. But one day you will find a situation where they get in the way of the most elegant solution. Or, more likely, they will get in the way of hacking a new feature into some legacy POS in time to meet the deadline that Marketing already promised to the client! :D

Wait, you mean marketing didn't tell the customer the feature was already supported in the shipping version?!?

Re:Mixed feelings (2)

haknick (2035324) | more than 2 years ago | (#38351616)

Great writeup. I really don't know if ppl writing here have ever programmed a real project in PHP. Check out Concrete5 and reply with a better, cleaner, faster to build modules/plugins for, more extendable open source CMS in any other language. Let's see what competition is out there. Only a month ago we finished a very similar proprietary system that is so much better than say Apache Roller (which I had prior experience), it's not even funny. Now, obviously there are certain things that PHP is just not good at because there simply wasn't any pushing in certain areas. Scala's continuations are one such thing that I really need recently and PHP is just the wrong tool for. Obviously I'm using Scala for it and the turnaround was pretty quick too (especially considering how much more complex thinking Scala requires).

Re:Mixed feelings (5, Insightful)

Anonymous Coward | more than 2 years ago | (#38350642)

Yeah cause PHP is so bad Facebook use it... no programming language is perfect, they all have their quirks. But your comment is baseless, PHP doesn't make bad programmers, it just doesn't break your legs if you are one.

Re:Mixed feelings (5, Informative)

MightyMartian (840721) | more than 2 years ago | (#38350922)

PHP is like BASIC. In the right hands it can certainly produce just as readable and maintainable code as any other language, but the short learning curve to get to first base invites people with little or no discipline, or often enough, without any underpinnings at all, to write absolute garbage. Worse, this code often ends up being the core of some important infrastructure, and then some poor yob (I was one for several months) has the unlucky job of trying to maintain this garbage. And because the php.ini file allows you turn on all the worst aspects of the language, you end up having to do just that just to keep the damned code running while you try to clean it up.

Oh yes, and apart from the issues I have with the language itself, it has just a plain awful library, with inconsistencies throughout that mean I spend as much time perusing the docs as I do actually coding anything.

Between these two factors, I have to say I hate PHP, but still find myself all too often being forced to deal with it.

Re:Mixed feelings (2)

Mad Merlin (837387) | more than 2 years ago | (#38351442)

PHP is like BASIC. In the right hands it can certainly produce just as readable and maintainable code as any other language, but the short learning curve to get to first base invites people with little or no discipline, or often enough, without any underpinnings at all, to write absolute garbage.

Would you you prefer that said people stumble their way through something more difficult like C, so that they can produce even worse code than they would have in PHP?

Re:Mixed feelings (0)

Anonymous Coward | more than 2 years ago | (#38351514)

Thing being, with c, they would give up, and spend their time doing something else, like eating shrapnel.

Re:Mixed feelings (2)

Lehk228 (705449) | more than 2 years ago | (#38351798)

no, they would release it and call it "Windows 95"

Re:Mixed feelings (4, Insightful)

MightyMartian (840721) | more than 2 years ago | (#38350954)

Which means it won't be. PHP has taken hold, and good, bad or ugly, we're stuck with it. There's no phasing it in anything like the short or even medium term. LAMP is everywhere, and countless sites are built on it. It's like COBOL, a bad dream that will keep terrifying us even as better languages flicker and die.

much more traditional solution (2)

Trepidity (597) | more than 2 years ago | (#38350412)

Interesting that they've settled on this approach, which in some ways is much more traditional: developing a high-performance JIT for a dynamic language instead of trying to statically compile a subset. Basically the approach taken by StrongTalk, V8, PyPy, Rubinius, etc.

Re:much more traditional solution (0)

Anonymous Coward | more than 2 years ago | (#38351282)

The initial version of Hiphop was a static compiler but that just didn't work for them for some reason.

But what they created is just another ZendEngine.
Note that the do not give a PHP+APC benchmark because it is probably just as fast as their HipHopJIT creation.
What a waste of time and resources.

*sigh*
Just getting tired of all these second rate programmers at these big companies spamming major news sites with their so-called innovative solutions that merely replace existing solutions without showing any major improvement or just solving very specific solutions for their own organisations.
*gets another cup of coffee*

So True. (1)

jmichaelg (148257) | more than 2 years ago | (#38350426)

From the article....

The first 90% of the hhvm project is done; now we're on to the second 90% as we make it really shine.

Re:So True. (1)

Local ID10T (790134) | more than 2 years ago | (#38350470)

From the article....

The first 90% of the hhvm project is done; now we're on to the second 90% as we make it really shine.

Good at math they are not...

Re:So True. (4, Insightful)

Jack9 (11421) | more than 2 years ago | (#38350512)

Re:So True. (2)

garyebickford (222422) | more than 2 years ago | (#38351346)

I generally extend to the third ninety - the last 1% of the code take the third ninety percent of the time. This is a pretty good model for the difference between a good, working program and one with a shiny user interface and most of the beta-bugs worked out.

Or, as someone I worked with who had been at BBN working on the original ARPAnet said, "Take whatever schedule the engineers give you, double it and convert to the next higher units." (two weeks => four months, etc.)

Re:So True. (4, Funny)

Rennt (582550) | more than 2 years ago | (#38350610)

It's a form of hacker koan. In your eagerness to be a smartass you failed to reach enlightenment.

Re:So True. (0)

Anonymous Coward | more than 2 years ago | (#38351092)

That would be a great video game end screen:

"You have failed to reach enlightenment."

And the joke would be that there is no way to reach enlightenment inside of the game.

Re:So True. (1)

fsckmnky (2505008) | more than 2 years ago | (#38350670)

From the article.... The first 90% of the hhvm project is done; now we're on to the second 90% as we make it really shine.

And when they are finally done optimizing it, squeezing every last bit of performance out of it, adding the ability to compile to a native binary, they will have achieved the remarkable accomplishment of having re-invented the C compiler.

Way to go Facebook. Keep up the good work. ;)

Re:So True. (1)

PCM2 (4486) | more than 2 years ago | (#38351254)

And when they are finally done optimizing it, squeezing every last bit of performance out of it, adding the ability to compile to a native binary, they will have achieved the remarkable accomplishment of having re-invented the C compiler.

They did that already. They're moving away from static compilation in favor of running it in a VM with a JIT.

Re:So True. (1)

fsckmnky (2505008) | more than 2 years ago | (#38351286)

They're moving away from static compilation in favor of running it in a VM with a JIT.

Which is a complete step backwards if their goal is performance.

Re:So True. (1)

PCM2 (4486) | more than 2 years ago | (#38351356)

Which is a complete step backwards if their goal is performance.

Not really. JIT technology is pretty advanced these days. (It's good enough for Java, anyway.) More importantly, though, my understanding is that static compilation forced them to heavily restrict their coding style. PHP being a dynamic language, there were a lot of features they had to leave on the table to make it work that way.

Re:So True. (1, Interesting)

fsckmnky (2505008) | more than 2 years ago | (#38351450)

(It's good enough for Java, anyway.)

Which is at least 50% slower on its best day, than C/C++ on it's worst day.

As for JIT, it's a non-issue. Anyone could make .c or .cpp files executable, by passing them through the linux kernels MISC binary capability. [see "Kernel support for MISC binaries" under "Executable file formats / Emulations"].

It's the VM part that kills performance. The Java VM, and presumably, the PHP VM, do not execute native machine instructions, but instead, use an intermediary format, as opposed to, native cpu instructions. This is what kills performance.

If one wanted both JIT and a "virtual environment" ( for security reasons ) ... one could use the misc binary feature of linux, combined with "linux resource containers" to achieve a virtualized environment ( machine ), isolated for security purposes, which executes native code, with almost 0 overhead.

Maybe they'll figure it out, but I doubt it, because they are already heavily invested in PHP. Bleh.

Combine that with the remarkable similarity between PHP syntax and C ( but without the speed ) and maybe you understand why I say ... congrats, they've re-invented C. They've just done it without the last 40-50 years of iterative performance enhancements that have been applied to C/C++ compilers already.

Re:So True. (4, Interesting)

PCM2 (4486) | more than 2 years ago | (#38351512)

Which is at least 50% slower on its best day, than C/C++ on it's worst day.

Got any numbers to back that up, or are you just pulling it out of thin air?

It's the VM part that kills performance. The Java VM, and presumably, the PHP VM, do not execute native machine instructions, but instead, use an intermediary format, as opposed to, native cpu instructions.

You don't seem to understand how a JIT works. Many portions of Java programs are indeed executed as native machine instructions.

Combine that with the remarkable similarity between PHP syntax and C ( but without the speed )

I wouldn't call the similarity "remarkable." "Superficial" might be a word I'd use, in the sense that Java syntax is also similar to C.

Re:So True. (1)

fsckmnky (2505008) | more than 2 years ago | (#38351522)

Now that I go and read the article, I see they have created a "PHP to C++" translator of sorts, not so much a JIT VM combination. It won't be nearly as bad performance wise, but, why even f' with PHP at that point.

old news (0)

Anonymous Coward | more than 2 years ago | (#38350592)

hip hop has been open source for quite a while. At least a year.

I hate all languages that start with P (2, Funny)

Maltheus (248271) | more than 2 years ago | (#38350594)

They're just not maintainable in my experience.

Re:I hate all languages that start with P (0)

Anonymous Coward | more than 2 years ago | (#38350646)

They're just not maintainable in my experience.

Not even *sniff* Pascal?

Re:I hate all languages that start with P (1)

zero0ne (1309517) | more than 2 years ago | (#38350658)

So:

Pascal, Pawn, Perl, PHP, PL/I, Plus, Prolog, PureBasic, and Python ?

Re:I hate all languages that start with P (1)

zero0ne (1309517) | more than 2 years ago | (#38350680)

Crap, looks like I missed a few. [wikipedia.org]

Re:I hate all languages that start with P (2)

gregfortune (313889) | more than 2 years ago | (#38350728)

It's ironic how close P and R happen to be. Ruby fan, I take it?

If not Ruby, what do you use for a scripting language? Please don't tell me you decided long ago that if it's possible to do everything in assembly, it must be done in assembly.

Hmm... (1)

thestudio_bob (894258) | more than 2 years ago | (#38350692)

Can I "Like" this?

NFL jersey (0)

jersey123456 (2485408) | more than 2 years ago | (#38350918)

Buy New York Yankees T-shirt shop from home, have a great choice of replica, reverse alternative, Custom Tees and authentic for Cardinals fans. They have all kinds of jerseys New york Cardinals, New Jersey Wholesale NFL jerseys [jerseymall.biz] York Yankees, Chicago Bears Jersey, Denver Broncos Jersey, as nfl jerseys, nfl NHL jerseys [jerseymall.biz] jerseys pink for men, ladies and children, all are embroidered T-shirt, only takes what they wishes. They happily refund your funds within thirty (30) days of purchase NBA jerseys [jerseymall.biz] orders of the States and sixty (60) days for international customers. You are necessary to comply with all tags attached to the goods when it MLB jerseys [jerseymall.biz] comes, or your return won't be accepted.

Real PHP Compiler (2)

kervin (64171) | more than 2 years ago | (#38350942)

You can find a real PHP compiler at http://phpcompiler.org/ [phpcompiler.org] . It would be nice if the official PHP engine had built in support for loading and running bytecode ( like JVMs ) instead of strictly text code.

Re:Real PHP Compiler (1)

Guspaz (556486) | more than 2 years ago | (#38351208)

Or Phalanger at http://www.php-compiler.net/ [php-compiler.net] which is a GPL project that compiles to CIL bytecode, which is then run through .NET or Mono in a JIT fashion. It's a proper .NET language, so you get access to the .NET framework as well as the core PHP functions and default extensions. Unfortunately, some of the non-default extensions that they've ported (like gd2 or memcached) are not available in the GPL version.

Re:Real PHP Compiler (2)

cshark (673578) | more than 2 years ago | (#38351826)

Yes, but it's non standard. With Phlanger, you're mixing old extensions with known threading and security bugs with a weird namespace format, and an incomplete implementation. Then there's Studio integration, which is spotty. Didn't even support Studio 10 last I checked. If by "real" you mean, "runs half ass on .net" you're right. In terms of maturity, and in most other respects, it can't touch hiphop. Seriously man, try hiphop. It's amazing.

Its not really JIT is it? (1)

viperidaenz (2515578) | more than 2 years ago | (#38351068)

the readme says its a source code transformer that converts php into c++ then compiles it with g++.
How is that a JIT VM in any sense of the word?

Re:Its not really JIT is it? (2)

PCM2 (4486) | more than 2 years ago | (#38351280)

I think the Readme on GitHub is a placeholder. They took the Readme from HipHop, aka hphpc, which was the earlier project. This is HipHop VM, which is something different. Read the "more technical description," linked at the top, to get the picture. Basically, HipHop goes PHP-->Abstract Syntax Tree-->C++-->x64. HipHop VM goes PHP-->AST-->Bytecode, then runs the bytecode through a JIT.

dev only (3, Insightful)

Fnord666 (889225) | more than 2 years ago | (#38351140)

Unless I misunderstood the post, this is only being used in their development environments. It sounds like they are still using statically compiled php for production. They did mention that they hoped to closed they gap in performance between the two in the near future though.

Re:dev only (1)

Zero__Kelvin (151819) | more than 2 years ago | (#38351614)

... hoped to closed they gap ...

The Hip Hop is wearing off on you my friend.

Facebook should revamp itself first. (0)

s-whs (959229) | more than 2 years ago | (#38351376)

"In its continuing endeavor to serve its 800 million users as quickly as possible, Facebook is once again revamping the way it handles its PHP-based Web pages.

I've had a page made for me by a relative for business purposes and since then I visited a few pages on facebook related to my interests/business and I have to say, that I hate Facebook. Facebook is one of the worst pieces of crap I've ever seen. It's so unbelievably unintuitive, obscure and inconvenient (in all aspects, trying to set things for my own page, or looking at other pages, pictures, tehn going back, whatever), that it drives me nuts ever time I visit it (which is not a lot and I intend to keep it that way!)

Re:Facebook should revamp itself first. (0)

Anonymous Coward | more than 2 years ago | (#38351594)

What would be ironic, is if you are an OSX user.

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?