rfc:vector
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
rfc:vector [2021/09/24 00:49] – tandre | rfc:vector [2021/09/26 16:46] (current) – php-ds maintainer response tandre | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: final class Vector ====== | ====== PHP RFC: final class Vector ====== | ||
- | * Version: 0.1 | + | * Version: 0.2 |
* Date: 2021-09-16 | * Date: 2021-09-16 | ||
* Author: Tyson Andre, tandre@php.net | * Author: Tyson Andre, tandre@php.net | ||
Line 325: | Line 325: | ||
===== Rejected Features ===== | ===== Rejected Features ===== | ||
- | ==== Why not use php-ds instead? ==== | + | ==== Why not use php-ds/ext-ds instead? ==== |
- No matter how useful or popular a PECL is, datastructures available in PHP's core will have much, much wider adoption in applications and libraries that are available in PECLs, allowing those applications and libraries to write faster and/or more memory efficient code. | - No matter how useful or popular a PECL is, datastructures available in PHP's core will have much, much wider adoption in applications and libraries that are available in PECLs, allowing those applications and libraries to write faster and/or more memory efficient code. | ||
- 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, and believe php-ds should coexist with new functionality being added in a separate namespace instead |
- Opcache may be able to make stronger optimizations of internal classes found in php-src than any third party PECL. (e.g. because '' | - Opcache may be able to make stronger optimizations of internal classes found in php-src than any third party PECL. (e.g. because '' | ||
Line 388: | Line 387: | ||
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 '' | + | As a result, I've been working on implementing data structures such as '' |
=== Minor differences in API design goals === | === Minor differences in API design goals === | ||
Line 418: | Line 417: | ||
Additionally, | Additionally, | ||
+ | ==== Update: php-ds maintainer response clarifications ==== | ||
+ | |||
+ | On September 24, 2021, [[https:// | ||
+ | |||
+ | < | ||
+ | Hi everyone, I am happy to see this discussion and I thank you all for taking part. My reservation to merge ds into core has always been because I wanted to make sure we get it right before we do that and the intention behind the mythical v2 was to achieve that, based on learnings from v1 and feedback from the community. I have no personal attachment to this project, I only want what is best for PHP and the community. | ||
+ | |||
+ | I would love to see a dedicated, super-lean vec data structure in core that has native iteration and all the other same internal benefits as arrays. In my opinion, the API should be very minimal and potentially compatible with all the non-assoc array functions. An OO interface can easily be designed around that. I'm imagining something similar to Golang' | ||
+ | |||
+ | **As for the future of ds itself, I think these can co-exist and ds can remain external. I've been researching and designing immutable data structures over the last 4 years and I still hope to develop a v2 that simplifies the interfaces and introduces immutable structures. Attempting to implement a suite of structures in core or an OO vector would take a lot of work and might be difficult to reach consensus on with the API. I don't think we should attempt to merge ds into core at any time.** | ||
+ | |||
+ | I am currently traveling and have not followed this discussion in detail on the mailing list. I'd be happy to assist in any way I can and will catch up as soon as I am home again this week. Feel free to quote this response on the mailing list as well. | ||
+ | </ | ||
+ | |||
+ | I'm still awaiting some clarifications on how they they were willing to assist before updating the remainder of this RFC. | ||
+ | |||
+ | Additionally, | ||
==== Adding a native type instead (is_vec) ==== | ==== Adding a native type instead (is_vec) ==== | ||
Line 445: | Line 461: | ||
Also, even if a type '' | Also, even if a type '' | ||
+ | |||
+ | ==== Changelog ==== | ||
+ | |||
+ | 0.2: Add php-ds maintainer response, improve documentation, | ||
rfc/vector.1632444597.txt.gz · Last modified: 2021/09/24 00:49 by tandre