Login   Register  
PHP Classes
elePHPant
Icontem

Opinion

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      PHP Classes blog  >  Hack Language is All ...  >  All threads  >  Opinion  >  (Un) Subscribe thread alerts  
Subject:Opinion
Summary:What about pthreads?
Messages:2
Author:Rubens Takiguti Ribeiro
Date:2014-03-24 13:29:38
Update:2014-03-25 00:57:47
 

  1. Opinion   Reply  
Picture of Rubens Takiguti Ribeiro
Rubens Takiguti Ribeiro
2014-03-24 20:15:59
Great article.

But I think Asynchronous Programming can already be done in PHP with the pecl extension pthreads (using other syntax), doesn't it?
http://pecl.php.net/package/pthreads

"Backwards Compatible Mode" seems inviable, because some features just could not have a simple syntax like comments (use of class with generics, for example).

In any case, I think PHP could adopt some optional improvements and walk beside the hack quietly.

  2. Re: Opinion   Reply  
Picture of Manuel Lemos
Manuel Lemos
2014-03-25 00:57:47 - In reply to message 1 from Rubens Takiguti Ribeiro
From what I understood Hack asynchronous programming is not implemented with threads, but I am not certain either.

The idea for the backwards compatible mode would be just for features that could be emulated with comments, so you can have a PHP version that takes advantage of Hack features.

The original hack syntax would still be supported for those that want to migrate their code and make it more readable.

As for PHP adopting Hack improvements, I agree. The problem is that PHP core developers often disagree, as many of the hack features were already proposed to the PHP core.