Re: [PHP-DEV] RFC Draft: Comprehensions

2019-03-20 Thread Robert Hickman
> > Hi! > > > >> It's not that you can't make an array into a generator, but you can't make > >> an eagerly-evaluated expression into a lazily-evaluated one. > > Not sure what you mean here. > > > I mean that, given a syntax that lazily-evaluates something, you can > "fast-forward" the result to

Re: [PHP-DEV] RFC Draft: Comprehensions

2019-03-20 Thread Rowan Collins
On 20/03/2019 20:39, Stanislav Malyshev wrote: Hi! It's not that you can't make an array into a generator, but you can't make an eagerly-evaluated expression into a lazily-evaluated one. Not sure what you mean here. I mean that, given a syntax that lazily-evaluates something, you can

Re: [PHP-DEV] RFC Draft: Comprehensions

2019-03-20 Thread Stanislav Malyshev
Hi! > It's not that you can't make an array into a generator, but you can't make > an eagerly-evaluated expression into a lazily-evaluated one. Not sure what you mean here. If you already have the data, of course you can't un-evaluate it in order to lazily-evaluate it again. But why would you,

Re: [PHP-DEV] On fixing DOMNameSpaceNode and DOM NS API Inconsistency Problems

2019-03-20 Thread C. Scott Ananian
On Sun, Mar 17, 2019 at 6:57 PM Rob Richards wrote: > I'll take a look through the lists you have but you need to remember > that the DOM specs were not written for HTML. While HTML might have some > more restrictive requirements that piggy back on the DOM specs > themselves, they are not the

Re: [PHP-DEV] Offset-only results from preg_match

2019-03-20 Thread C. Scott Ananian
On Mon, Mar 18, 2019 at 9:44 AM Nikita Popov wrote: > On Thu, Mar 14, 2019 at 8:33 PM C. Scott Ananian > wrote: > >> I'm floating an idea for an RFC here. >> >> I'm working on the wikimedia/remex-html library for high-performance >> PHP-native HTML5 parsing. When creating a high-performance

Re: [PHP-DEV] Offset-only results from preg_match

2019-03-20 Thread C. Scott Ananian
On Tue, Mar 19, 2019 at 10:58 AM Nikita Popov wrote: > After thinking about this some more, while this may be a minor performance > improvement, it still does more work than necessary. In particular the use > of OFFSET_CAPTURE (which would be pretty much required here) needs one new >

Re: [PHP-DEV] PCRE partial matching

2019-03-20 Thread C. Scott Ananian
Looks nice to me. In connection with the PREG_LENGTH_CAPTURE option floated in a previous post, this would easily let the wikimedia/remex-html package parse HTML in a streaming fashion; it would fill up a buffer array and then do an incremental parse, stopping as soon as a (hard) partial match

Re: [PHP-DEV] Re: [VOTE] RFC: Unbundle ext/wddx

2019-03-20 Thread Remi Collet
Le 20/03/2019 à 15:02, Christoph M. Becker a écrit : > I have removed ext/wddx[1] now, and documented that[2]. An open > question is whether we want to publish a PECL release. Personally, I > don't think so, but others might disagree. If someone what to step as a lead for this extension, and

Re: [PHP-DEV] Re: [VOTE] RFC: Unbundle ext/wddx

2019-03-20 Thread Christoph M. Becker
On 20.03.2019 at 14:04, Nikita Popov wrote: > I've set up the git.php.net repo and github mirror, imported the ext/wddx > directory as of PHP-7.4 (doing this for the first time, hope it's right) > and gave you karma for the repo. Thanks Nikita! I have removed ext/wddx[1] now, and documented

Re: [PHP-DEV] RFC Draft: Comprehensions

2019-03-20 Thread Larry Garfield
On Tue, Mar 19, 2019, at 3:25 PM, Levi Morrison wrote: > Today in the Dart world, Bob Nystrom published an article called > [Making Dart a Better Language for UI][1]. I think it's an incredibly > relevant article, since it is essentially about comprehensions, why > they are a thing, as well as

Re: [PHP-DEV] Re: [VOTE] RFC: Unbundle ext/wddx

2019-03-20 Thread Joe Watkins
Maybe put a readme in the git repo ... Cheers Joe On Wed, 20 Mar 2019 at 14:04, Nikita Popov wrote: > On Wed, Mar 20, 2019 at 1:43 PM Joe Watkins wrote: > >> Looks like someone done that too, I think you have everything you need >> now ? >> >> Cheers >> Joe >> >> On Wed, 20 Mar 2019 at 13:29,

Re: [PHP-DEV] Re: [VOTE] RFC: Unbundle ext/wddx

2019-03-20 Thread Nikita Popov
On Wed, Mar 20, 2019 at 1:43 PM Joe Watkins wrote: > Looks like someone done that too, I think you have everything you need now > ? > > Cheers > Joe > > On Wed, 20 Mar 2019 at 13:29, Christoph M. Becker > wrote: > > > On 20.03.2019 at 13:09, Joe Watkins wrote: > > > > >

Re: [PHP-DEV] Re: [VOTE] RFC: Unbundle ext/wddx

2019-03-20 Thread Christoph M. Becker
On 20.03.2019 at 13:43, Joe Watkins wrote: > Looks like someone done that too, I think you have everything you need now ? Yes. Thanks a lot! > On Wed, 20 Mar 2019 at 13:29, Christoph M. Becker wrote: > >> On 20.03.2019 at 13:09, Joe Watkins wrote: >> >>> https://pecl.php.net/package/wddx >>

Re: [PHP-DEV] Re: [VOTE] RFC: Unbundle ext/wddx

2019-03-20 Thread Joe Watkins
Looks like someone done that too, I think you have everything you need now ? Cheers Joe On Wed, 20 Mar 2019 at 13:29, Christoph M. Becker wrote: > On 20.03.2019 at 13:09, Joe Watkins wrote: > > > https://pecl.php.net/package/wddx > > Thanks Joe! My request was badly worded, though. Actually,

Re: [PHP-DEV] Re: [VOTE] RFC: Unbundle ext/wddx

2019-03-20 Thread Christoph M. Becker
On 20.03.2019 at 13:09, Joe Watkins wrote: > https://pecl.php.net/package/wddx Thanks Joe! My request was badly worded, though. Actually, I need somebody to create a respective Git repo (something like pecl/xml/wddx.git). > On Wed, 20 Mar 2019 at 13:03, Christoph M. Becker wrote: > >> On

Re: [PHP-DEV] RFC Draft: Comprehensions

2019-03-20 Thread Rowan Collins
On Wed, 20 Mar 2019 at 00:35, Stanislav Malyshev wrote: > > And converting from a generator to an array is trivial; the other > > way, very not so much. > > BTW, how it's not trivial to make generator from array? > > function generate($array) { foreach($array as $k => $v) yield $k => $v; } > >

Re: [PHP-DEV] Re: [VOTE] RFC: Unbundle ext/wddx

2019-03-20 Thread Joe Watkins
https://pecl.php.net/package/wddx Cheers Joe On Wed, 20 Mar 2019 at 13:03, Christoph M. Becker wrote: > On 13.03.2019 at 20:47, Christoph M. Becker wrote: > > > Still, I'm looking for someone who is willing to create a new home for > > ext/wwdx on PECL. > > This is just a gentle reminder that

Re: [PHP-DEV] Re: [VOTE] RFC: Unbundle ext/wddx

2019-03-20 Thread Christoph M. Becker
On 13.03.2019 at 20:47, Christoph M. Becker wrote: > Still, I'm looking for someone who is willing to create a new home for > ext/wwdx on PECL. This is just a gentle reminder that somebody should please create a new home for ext/wddx on PECL. -- Christoph M. Becker -- PHP Internals - PHP

Re: [PHP-DEV] RFC Draft: Comprehensions

2019-03-20 Thread Robert Hickman
>> Honestly, I cannot think of any case where I'd use a comprehension >> where I would definitely want an array and not a generator. In the >> majority case both work equally well, cool, but I don't know when I >> would even use an array-dependent version. >> And converting from a generator to an

[PHP-DEV] PCRE partial matching

2019-03-20 Thread Nikita Popov
Hi internals, PCRE has some very nice partial matching functionality described at https://www.pcre.org/current/doc/html/pcre2partial.html. This is useful for streaming processing, as it allows you to distinguish between "there's definitely no match here" and "this could match starting from

Re: [PHP-DEV] Offset-only results from preg_match

2019-03-20 Thread Markus Fischer
On 19.03.19 15:58, Nikita Popov wrote: I'm wondering if we shouldn't consider a new object oriented API for PCRE which can return a match object where subpattern positions and contents can be queried via method calls, so you only pay for the parts that you do access. Or also a literal syntax