Php and HipHop

MultiformeIngegno

  • Posts: 1,337

Nao

  • Dadman with a boy
  • Posts: 16,061
Re: Php and Hip Pop
« Reply #1, on April 7th, 2011, 01:27 PM »
Pete actually mentioned the word yesterday ;)
And we discussed it somewhere before... Probably on these boards, not sure.

Technically, I don't think it's feasible for a widespread platform (likely to be installed on shared hosting etc.)
Might be wrong though.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Php and Hip Pop
« Reply #2, on April 7th, 2011, 01:39 PM »
In a word: no.

Hiphop is a compiler, it turns PHP code into C code, which you then compile.

On a single platform, a single specific VPS where you can run your own code, it becomes feasible, but it requires a number of things - firstly, eval gets thrown out the door. The concept of dynamically loading files sort of does too, any hope of customisation along with it.

The other thing is, there is an awful lot of type juggling buried inside SMF/Wedge, most of it we never notice, but anything coming out of MySQL is going to be type juggled if it's actually numeric. This can't happen in Hiphop, because C is statically typed, which means we have to explicitly handle it straight after grabbing it from MySQL. I also have a funny feeling that buffering would be handled differently which has major effects on us.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

MultiformeIngegno

  • Posts: 1,337
Re: Php and Hip Pop
« Reply #3, on April 7th, 2011, 01:43 PM »
I didn't want to suggest it for Wedge, just wanted to share! :)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Php and HipHop
« Reply #4, on April 7th, 2011, 01:47 PM »
Yeah, it's a very cool technology in general and for some uses, it's fantastic. Just, unfortunately, not here.

DoctorMalboro

  • I like rounded borders.
  • Posts: 316
Re: Php and HipHop
« Reply #5, on April 7th, 2011, 02:19 PM »
It's only awesome for making simple programs.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Php and HipHop
« Reply #6, on April 7th, 2011, 02:21 PM »
Oh, you can do some incredible stuff with it, but it does limit how you can do it.

CJ Jackson

  • I got myself a new iPad, a different world to the iPhone!
  • Posts: 241
Re: Php and HipHop
« Reply #7, on April 7th, 2011, 03:55 PM »
I think PHP recompiles such as Wincache(by Microsoft, no kidding, but Windows only), APC or eAccelerators (Best for Unix systems.) are the way forward, as it runs almost every PHP script with ease and at good speed as well. ;-)

Then again you probably won't need it as most modern day CPU are pretty fast, therefore interpreting times won't be problem.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Php and HipHop
« Reply #8, on April 7th, 2011, 03:58 PM »
eAccelerator isn't really practical because it doesn't include key-value storage caches any more while APC does.

Note that opcode caches (which is what these are) help but they won't provide the purebred performance that Hiphop will, though they're vastly more approachable than Hiphop is.