ideas:php6

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ideas:php6 [2014/02/17 06:23] – . pajoyeideas:php6 [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 8: Line 8:
 Each of them will require a RFC then, at least for important or large changes. Each of them will require a RFC then, at least for important or large changes.
  
-  * OpCache integraton+  * OpCache integration
   * Improved and actual 64bit support    * Improved and actual 64bit support 
   * Unicode support   * Unicode support
Line 16: Line 16:
   * JIT compiler (libjit?)   * JIT compiler (libjit?)
   * Annotation Support   * Annotation Support
 +  * Named argument
 +  * Scalar Type hinting
   * HTTP2 support (avoid our own implementation, nghttp2?)   * HTTP2 support (avoid our own implementation, nghttp2?)
   * Reliable, userfriendly RNG APIs (internally and userland)   * Reliable, userfriendly RNG APIs (internally and userland)
Line 24: Line 26:
   * bundle pecl's http (add http2 support too)   * bundle pecl's http (add http2 support too)
  
-===== OpCache integraton =====+===== OpCache integration =====
  
 Opcache has been bundled with 5.5.0. A real integration did not happen yet while stabilizing it was the highest priority. Opcache has been bundled with 5.5.0. A real integration did not happen yet while stabilizing it was the highest priority.
Line 33: Line 35:
   * Change opcodes to ease opcodes caching and optimization   * Change opcodes to ease opcodes caching and optimization
   * Add necessary changes to support JIT compilation to native, most likely only partial part of the running code (a function/method or a portion of a function method). This part is totally undefined now, see the JIT section   * Add necessary changes to support JIT compilation to native, most likely only partial part of the running code (a function/method or a portion of a function method). This part is totally undefined now, see the JIT section
 +  * Get rid of compat API in OPCache about old PHP versions (some code still refers to PHP 5.1)
  
  
Line 65: Line 68:
   * https://wiki.php.net/todo/php60   * https://wiki.php.net/todo/php60
  
 +See [[ideas/php6/unicode|the dedicated Unicode support ideas page]] for more or actual details.
 ===== internals API Cleanup ===== ===== internals API Cleanup =====
  
Line 73: Line 77:
  
 This proposal could be extended to hash, as hashes are widely used as well for internal storage. This proposal could be extended to hash, as hashes are widely used as well for internal storage.
 +
 +Clean the APIs to have consistent ones. Actually, APIs are composed of functions and macros, some macros are lowercased written making think you 're using a function (zend_hash_add f.e)
  
 The stream API, as being very powerful, suffers from code duplication all over the place. We have stream/IO related functions in the engine, TSRM, main/ and ext/standard. Tests exist in even more locations. It makes stream a hardly maintainable part of PHP, let alone to use in a consistent manner. The stream API, as being very powerful, suffers from code duplication all over the place. We have stream/IO related functions in the engine, TSRM, main/ and ext/standard. Tests exist in even more locations. It makes stream a hardly maintainable part of PHP, let alone to use in a consistent manner.
Line 91: Line 97:
 ===== Improve OPcodes, compilation and runtime ===== ===== Improve OPcodes, compilation and runtime =====
  
-PHP mainly got new opcodes, growing in almost all major versions but never actually git a redesign/rewamp. Old design choices (due to technically limitation or performance reasons f.e.) have been kept in there for ages.+PHP mainly got new opcodes, growing in almost all major versions but never actually did a redesign/revamp. Old design choices (due to technically limitation or performance reasons f.e.) have been kept in there for ages.
  
 Some of these choices cause us troubles with the recent additions (OpCache), like the absolute address usage for jump/call operations. Some of these choices cause us troubles with the recent additions (OpCache), like the absolute address usage for jump/call operations.
  
 It would be interesting to begin a discussion about what we could change to make them more efficient and maintainable in the long run. It is also necessary to think long term, like how can we support JIT compilation to native code from the OpCode (full or partial). It would be interesting to begin a discussion about what we could change to make them more efficient and maintainable in the long run. It is also necessary to think long term, like how can we support JIT compilation to native code from the OpCode (full or partial).
 +
 +Ideas posted on the list:
 +  * AST based compiler (Julien, Nikita)
 +  * Rewrite parts of the engine (https://wiki.php.net/ideas/php6/engine)
 +
 +Also as much as I would like a full rewrite of the engine, it sounds very hardly possible to do it within a reasonable time-frame (say two years), except if we suddenly have a couple of developers working full time on this task.
  
 ===== JIT compiler ===== ===== JIT compiler =====
Line 160: Line 172:
 The 2nd option obviously has my vote. It has only advantages. Fully BC, no namespace pollution with hundred of aliases. However both options share the same challenge: Define a clean API. This has to be done carefully and quietly, without FUDs or trolls :) The 2nd option obviously has my vote. It has only advantages. Fully BC, no namespace pollution with hundred of aliases. However both options share the same challenge: Define a clean API. This has to be done carefully and quietly, without FUDs or trolls :)
  
- +===== Scalar type hinting and return typing ===== 
 + 
 +PHP should never be a typed language, at least, on a mandatory basis. 
 +We already had RFCs about scalars type hinting, which all had pretty nice BC implementations 
 +https://wiki.php.net/rfc/scalar_type_hinting_with_cast 
 + 
 +For return type hinting, see https://wiki.php.net/rfc/typehint as well
  
 +Those two concepts become more and more crucial nowadays, and may be rethought for PHP6 as well.
ideas/php6.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1