Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Edmond Dantes
> Defining new syntax would encourage us to define a minimum top-level > behaviour, such as "inside an async{} block, these things are possible, > and these things are guaranteed to be true" True. This is precisely the main reason not to change the syntax. The issue is not even about how many ch

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Larry Garfield
On Wed, Mar 5, 2025, at 3:10 PM, Edmond Dantes wrote: >> No, just those functions/objects that necessarily involve running async >> control commands. Most wouldn't. >> They would just silently context switch when they hit an IO operation (which >> as noted above is transparency supported, whi

RE: [PHP-DEV] RFC: short and inner classes

2025-03-05 Thread Juris Evertovskis
Hi, Maybe I didn’t read the RFC carefully enough, but… Do any of these features require the other one? I’m asking because I wouldn’t want to see them both denied just because the voters disagree with one of them. Good luck with this proposal! Juris

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Rowan Tommins [IMSoP]
On 05/03/2025 23:10, Rowan Tommins [IMSoP] wrote: This is roughly what happened with Closures themselves in PHP: first, decide that "$foo = function(){};" will be valid syntax, and define Closure as the type of $foo; then over time, add additional behaviour to the Closure class, the ability to

[PHP-DEV] RFC: short and inner classes

2025-03-05 Thread Rob Landers
Hello PHP Internals, I'd like to introduce my RFC for discussion: https://wiki.php.net/rfc/short-and-inner-classes This RFC defines a short class syntax as well as the ability to nest classes inside another class. This introduces an unprecedented amount of control, flexibility, and expressiven

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Rowan Tommins [IMSoP]
On 05/03/2025 21:10, Edmond Dantes wrote: Essentially, this is Kotlin, but it should also resemble Python. However, unlike Kotlin, there are no special language constructs here—code blocks naturally serve that role. Of course, syntactic sugar can be added later for better readability. To pi

Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API

2025-03-05 Thread Dennis Snell
> On Feb 16, 2025, at 3:01 PM, Máté Kocsis wrote: > > > Hi Dennis, >> >> I only harp on the WhatWG spec so much because for many people this will be >> the only one they are aware of, if they are aware of any spec at all, and >> this is a sizable vector of attack targeting servers from user-s

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Morgan
On 2025-03-05 11:54, Eugene Sidelnyk wrote: > Hi there, > > I would also like to highlight some interesting ideas that I find being useful to consider. > > Recently Bend programming language has been released, and it incorporates a completely different view on the conception of "code", in th

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Edmond Dantes
> > Thinking aloud, perhaps we could cause `new Fiber` to create an automatic async block? > The main issue with Fibers is their switching logic: If you create Fiber A and call another Fiber B inside it, Fiber B can only return to the Fiber that created it, not just anywhere. However, the Schedul

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Larry Garfield
On Wed, Mar 5, 2025, at 3:37 AM, Edmond Dantes wrote: > Good day, Larry. > >> First off, as others have said, thank you for a thorough and detailed >> proposal. > Thanks! > >> * A series of free-standing functions. >> * That only work if the scheduler is active. >> * The scheduler being active is

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Larry Garfield
On Wed, Mar 5, 2025, at 11:50 AM, Edmond Dantes wrote: >> You might want to look to parallel extension as it's already dealing >> with that and mostly works - of course combination with coroutines will >> certainly complicate it but the point is that memory is not shared. > > Do you mean this ex

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Edmond Dantes
> You might want to look to parallel extension as it's already dealing > with that and mostly works - of course combination with coroutines will certainly complicate it but the point is that memory is not shared. Do you mean this extension: https://www.php.net/manual/en/book.parallel.php? Yes, I

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Jakub Zelenka
Hi, > > > I thought about this quite a bit and I think we should first try to > clarify the primary design that we want to go for. > > What I mean is whether we would like to ever support a true concurrency > (threads) in it. > > If we think it would be worth it (even thought it wouldn't be initia

[PHP-DEV] [VOTE] Marking return values as important (#[\NoDiscard])

2025-03-05 Thread Volker Dusch
Hey everyone, As announced on Monday: https://externals.io/message/126232#126551 We just started the vote on the "Marking return values as important (#[\NoDiscard])" RFC. References: - RFC: https://wiki.php.net/rfc/marking_return_value_as_important - Implementation: https://github.com/php/php-sr

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Edmond Dantes
Hello, Eugene! What I think it could be. async function baz(): int { $foo = foo(); $bar = bar(); return $foo + $bar; } // value is returned just like from any other ordinary function $val = baz(); If we have code like $x + $y, and in one block it follows rule 1 while in an

Re: [PHP-DEV] PHP socket ethernet support - step 2

2025-03-05 Thread Tim Düsterhus
Hi Am 2025-03-05 13:11, schrieb David CARLIER: And what is the payload object, is that just stdClass? Not really it's supposed to be one of the new classes. Okay, please check if you can find a more appropriate type in the stub then. `?object` is awfully generic (and thus useless to the u

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Edmond Dantes
Hello, Jakub. > > I thought about this quite a bit and I think we should first try to clarify the primary design that we want to go for. > What I mean is whether we would like to ever support a true concurrency (threads) in it. > If we think it would be worth it (even thought it wouldn't be initia

Re: [PHP-DEV] PHP socket ethernet support - step 2

2025-03-05 Thread David CARLIER
On Tue, 4 Mar 2025 at 22:34, Tim Düsterhus wrote: > Hi > > On 3/4/25 23:18, Gina P. Banyard wrote: > > Those two classes predate the Namespaces in bundled PHP extensions [1] > RFC, I do think adding a namespace is better. > > And we could also move the two classes into the new namespace and add >

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Jakub Zelenka
Hi, > https://wiki.php.net/rfc/true_async > > I believe this version is not perfect and requires analysis. And I > strongly believe that things like this shouldn't be developed in isolation. > So, if you think any important (or even minor) aspects have been > overlooked, please bring them to atten

[PHP-DEV] [VOTE] Add get_error_handler(), get_exception_handler() functions

2025-03-05 Thread Arnaud Le Blanc
Hi, I just started the vote on the "Add get_error_handler(), get_exception_handler() functions" RFC: https://wiki.php.net/rfc/get-error-exception-handler The vote will end in two weeks, on March 20th, 2025. Kind Regards, Arnaud

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Edmond Dantes
Good day, Larry. > First off, as others have said, thank you for a thorough and detailed proposal. Thanks! > * A series of free-standing functions. > * That only work if the scheduler is active. > * The scheduler being active is a run-once global flag. > * So code that uses those functions is onl

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Rowan Tommins [IMSoP]
On 4 March 2025 18:36:37 GMT, Larry Garfield wrote: >PHP doesn't have Python-style context managers (though I would like them) So would I, I've actually thought about it a lot... But more importantly, this highlights something important about that Python library: it is built *on top of* a n