rfc:vector
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
rfc:vector [2021/09/19 22:59] – elaborate on php-ds tandre | rfc:vector [2021/09/24 00:49] – tandre | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2021-09-16 | * Date: 2021-09-16 | ||
* Author: Tyson Andre, tandre@php.net | * Author: Tyson Andre, tandre@php.net | ||
- | * Status: | + | * Status: |
* Implementation: | * Implementation: | ||
* First Published at: http:// | * First Published at: http:// | ||
Line 328: | Line 328: | ||
- | - Datastructures | + | - No matter how useful or popular a PECL is, datastructures |
- End users can make much stronger assumptions about the backwards compatibility and long-term availability of data structures that are included in core. | - End users can make much stronger assumptions about the backwards compatibility and long-term availability of data structures that are included in core. | ||
- The php-ds maintainers do not plan to merge the extension into php-src (see quote for full context) | - The php-ds maintainers do not plan to merge the extension into php-src (see quote for full context) | ||
+ | - Opcache may be able to make stronger optimizations of internal classes found in php-src than any third party PECL. (e.g. because '' | ||
+ | |||
+ | === Perceived issues and uncertainties about php-ds distribution plans === | ||
This has been asked about multiple times in threads on unrelated proposals (https:// | This has been asked about multiple times in threads on unrelated proposals (https:// | ||
- | but the maintainer of php-ds had a long term goal of developing the separately from php's release cycle (and was still focusing on the PECL when I'd asked on the GitHub issue in the link almost a year ago). | + | but the maintainer of php-ds had a long term goal of developing the separately from php's release cycle (and was still focusing on the PECL when I'd asked on the GitHub issue in the link in September 2020). |
To quote the maintainer on the GitHub [[https:// | To quote the maintainer on the GitHub [[https:// | ||
Line 345: | Line 348: | ||
</ | </ | ||
- | There have been no proposals from the maintainer themselves so far to add php-ds to core or distribute it alongside core in any form. That was just what the maintainer mentioned as a long term plan. | + | < |
- | I personally doubt having it developed separately from php's release cycle would be accepted by voters (e.g. if unpopular decisions couldn' | + | > > Do you mean OS distribution level (Windows, Ubuntu, CentOS, HomeBrew for mac, etc.?) |
- | With php-ds itself getting merged anytime soon seeming unlikely to me, I decided to start independently working on efficient data structure implementations. | + | |
+ | > He meant distribution with PHP core (on all platforms where PHP is available) | ||
+ | |||
+ | Whichever is more viable - simply not merged into core, but distributed and enabled by default alongside it.0 | ||
+ | </ | ||
+ | |||
+ | There have been no proposals from the maintainer themselves so far to add php-ds to core or distribute it alongside core in any form. | ||
+ | That was just what the maintainer mentioned as a long term plan. | ||
+ | |||
+ | The model of distributing an extension separately from core has never been done before, and even if approved would raise multiple concerns: | ||
+ | |||
+ | * I personally doubt having it developed separately from php's release cycle would be accepted by voters (e.g. if unpopular decisions couldn' | ||
+ | * This may limit what features could be added by the community: For example, introducing the '' | ||
+ | * I'm not certain | ||
+ | * This may cause delays in publishing php releases, e.g. if the maintainers were unable to quickly review patches for crashes, incompatibilities or compile errors introduced in new php versions, etc. | ||
+ | * and other concerns (e.g. API debates such as https:// | ||
+ | |||
+ | With php-ds itself getting merged anytime soon (if the maintainers continue to plan to distribute php-ds that way) seeming unlikely to me, I decided to start independently working on efficient data structure implementations. | ||
I don't see dragging it in (against the maintainer' | I don't see dragging it in (against the maintainer' | ||
But having efficient datastructures in PHP's core is still useful. | But having efficient datastructures in PHP's core is still useful. | ||
Line 353: | Line 373: | ||
The timeline for php-ds 2.0 is also something I am uncertain about. | The timeline for php-ds 2.0 is also something I am uncertain about. | ||
- | Additionally, | + | <del>Additionally, |
+ | |||
+ | * //EDIT: I misread the maintainer' | ||
While PECL development outside of php has its benefits for development and ability to make new features available in older php releases, | While PECL development outside of php has its benefits for development and ability to make new features available in older php releases, | ||
Line 366: | Line 388: | ||
It's definitely a mature project, but I personally feel like reimplementing this (without referring to the php-ds source code and without copying the entire api as-is) is the best choice to add efficient data structures to core while respecting the maintainer' | It's definitely a mature project, but I personally feel like reimplementing this (without referring to the php-ds source code and without copying the entire api as-is) is the best choice to add efficient data structures to core while respecting the maintainer' | ||
- | As a result, I've been working on implementing data structures such as Vector based on php-src' | + | As a result, I've been working on implementing data structures such as '' |
+ | |||
+ | === Minor differences in API design goals === | ||
+ | |||
+ | Traditionally, | ||
+ | |||
+ | My hopes for ease of use, readability, | ||
+ | |||
+ | < | ||
+ | < | ||
+ | |||
+ | Again, I understand the rationale behind this decision, like reducing duplication and keeping only the core functionality in DS. However, sometimes you have to take into consideration ease of use vs purity of the code. | ||
+ | |||
+ | Ease of use / DX / readability: | ||
+ | |||
+ | '' | ||
+ | |||
+ | Rather than: | ||
+ | |||
+ | '' | ||
+ | |||
+ | Speed: as you said, internal iteration is faster. And speed is one of the selling points of DS vs arrays. | ||
+ | |||
+ | Static analysis: I love the fact that '' | ||
+ | |||
+ | Thank you for your work on DS anyway, I already use the extension in my closed-source project, in particular Map. I would love to use data structures in my open-source projects, one day! 🤞 | ||
+ | </ | ||
+ | |||
+ | Additionally, | ||
rfc/vector.txt · Last modified: 2021/09/26 16:46 by tandre