nikic / buffer

PHP extension for buffer based typed arrays
Other
42 stars 5 forks source link

Q: Project Status #4

Open nikeee opened 1 year ago

nikeee commented 1 year ago

Hi!

I think this extension looks really great and I'm considering it for a use case. Thus, I have a few questions:

If something is missing, I'd be happy to contribute! :)

nikic commented 1 year ago

So until a couple weeks ago this extension was dead. It was originally written for https://www.phpinternalsbook.com/ and only supported PHP 5. Recently @DrDub ported it to PHP 7. So this project was revived after nine years of silence :)

I just checked, and it currently doesn't build on PHP 8. It wouldn't be hard to support, but it would be helpful to know what PHP versions we want to target. (In particular, supporting only PHP 8 would save a good bit of conditional code -- not sure if that's fine for @DrDub's purposes or not.)

Regarding JS compatibility, I don't think the API is the same (most of the helper methods are not implemented), but I believe the results should match.

nikic commented 1 year ago

FYI I've added support for PHP 8 now.

nikeee commented 1 year ago

Nice, thanks!

supporting only PHP 8 would save a good bit of conditional code [...] FYI I've added support for PHP 8 now.

If that required some conditional code: If that makes the code less readable and there is no PHP version < 8 that is still supported, it might be a good idea to just tag the current version as v1.0.0 and state that it is the last one that supports PHP 7.

If I'm not mistaking, the extension is currently lacking the equivalent of a DataView. Is this in scope?

DrDub commented 1 year ago

In particular, supporting only PHP 8 would save a good bit of conditional code -- not sure if that's fine for @DrDub's purposes or not.

For the RubixML we only need PHP 8 so that will answer also the conditional bit in #5.

PurHur commented 1 year ago

<8 is also deprecated. Why bother around.

nikic commented 1 year ago

Okay, sounds like nobody needs PHP 7 support, so let's drop it.

nikic commented 1 year ago

PHP 7 support is dropped, and we no longer have #ifdefs.

If I'm not mistaking, the extension is currently lacking the equivalent of a DataView. Is this in scope?

From a quick look, that seems like a pretty reasonable addition.