Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hack and PHP

Status
Not open for further replies.

jpadie

Technical User
Nov 24, 2003
10,094
FR
After the recent announcement of hack (new php language variant from fb) does anyone have any thoughts on the usefulness of this new player? Anyone intending to migrate?

I can see some advantages in migration for large scale apps in the same way that hip hop offered benefits over plain php. I'm not sure that I am ready to start moving away from loose typing (although of course hack supports loose typing in non strict mode it's clear that they want you to start adopting a more C like approach).

One of the things I was impressed by in reading the various release announcements around hack is that all of fb has now migrated organically and via refactoring tools and the engineers there do two live code drops per 24 hours. That's serious pressure!
 
Any new software will have its fans and critics but long term, it will only succeed if it offers an improvement to the working environment. Unfortunately, many of the modern software solutions don't satisfy the needs of developers but pander to the whims of people who want the job done for them, automatically.

Keith
 
I'd have to agree with audiopro. (That's a first... hahaha)...

Hack is going to have to deliver something quite impressive to get real developers to migrate. Most developers have a library of methods and classes that they have created, maintained and used for years, and having to redevelop using Hack may be too much work, specially if their own libraries offer them more flexibility and manageability.

If Hack has a lot of pre-built methods its no different than a programmers library of methods. What does hack offer me, over my classes I already know work and get the job done, and more importantly developed myself so know exactly what they do.

Also, what was the requirement in Facebook behind developing a new Programming language? What did they really need from it, that PHP was not offering? A few pre-built methods and functional interfaces?

In the end, how useful is it over standard PHP?

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
the biggest 'extra' deliverable is surely that it

(i) supports php natively (i.e. everything [bar a couple of 'dangerous' things] in php 5.5 is natively supported in hack. it's build on php). Conversely if you do adopt hack, and use its native functionality that extends php, of course you cannot go back to php without refactoring. Also not all php extensions are hack-supported yet.
(ii) enforces (loosely) strict typing
(iii) is compiled.

item (iii) is the rationale behind fb using its fork of php. they needed the extra speed. they've been using their own version for a number of years. previously called hip hop, hack is an evolution of that. A compiled php script has a _much_ lower memory footprint and takes fewer cycles. I could see it becoming viable as an embedded language in this incarnation.

the reason for posting is that there is serious discussion going on in the php core community of ditching zend and migrating php to follow hack. the basis for this thinking is that to date php has been considered (professionally) as a poorly managed development language. it has no defined 'specification'. no real managed development path and things get left in/out because of in-fighting within the core team. adopting hack would create some definitive structure to the future of the language.

the flip side is that collegiate development, whilst slow and annoyingly illogical, may be considered less prone to dire consequences than following a language developed on one company's whims and needs. Sure, it's open source but ((i) so is php and (ii)) who wants to maintain your own development language ...

Manuel Lemos waxes lyrically about hack. He regards it as what php ought to have become. Rasmus Lerdorf has so far been quiet on this. But he is a well known evangelist of dynamic/loose typing so I suspect that anything that moves towards static typing won't be a big plus with him. Whereas some form of static typing is inevitable if you want a small footprint to your compiled apps.


 
actually I may have misrepresented Manuel Lemos. Or taken something he wrote slightly out of context. On researching his position a little further I think he's still on the fence.

But I'm very excited about where this might take php. If for nothing else I find that hack can handle asynchronous tasks in its own code. no callbacks or anything. that's very cool!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top