« first day (4932 days earlier)      last day (12 days later) » 

Wes
9:35 AM
@StatikStasis \o all good here. you? i tried avoiding programming work but ended up doing programming again only in a different language. you just can't avoid it these days :P
 
 
4 hours later…
1:35 PM
@bwoebi What would a full-ass version of PFA look like?
 
1:47 PM
@Crell Not less complete / able than the last proposal in terms of engine handling.
 
@bwoebi Did I see somewhere that there were more Observer API issues?
 
But I have no idea what's up with that report.
 
hmm, maybe
 
@bwoebi Engine level, or user-facing level? (I consider FCC to be the half-assed version we got instead, which is useful, but still half-assed.)
 
@Crell what's fcc? the function call cache?
 
1:56 PM
First Class Callables
It is confusion tho with what we call FCC internally lol
 
Ah I see - yeah exactly, confused it with the internal thing :-D
 
I also don't really know why it's called a cache, it's... like the function, the FCI is mostly the arguments needed to execute a call
 
the first class callables are the minimum viable feature subset of the partial function application
@Girgias because it caches the handler lookup
 
My dumb idea for PFA, is to basically not execute the call but add the parameters to a hashtable and then pass this hashtable to the named argument field of the FCI
And not use any positional args
But that's also a bit weird in that the types are only checked when the call is actually made :/
 
@Girgias Isn't that basically what Joe had?
 
2:01 PM
Not as far as I know?
 
@Girgias It might make more sense to say no infixed or suffixed positional args
 
I still think a slightly different syntax so we can known "this is a PFA call" before the function call starts executing (this was the very complex part of Joe's version) would greatly simplify everything.
 
leading positional args probably should be fine
 
@bwoebi Well you need to be able to handle a PFA call like: foo($a, ?, $c)
I mean it's probably doable to support this, I really should try to play with my idea, but so much stuff :(
 
2:23 PM
The basic syntax we had (with ? and ...), I think worked pretty damned well. It's just the location of the engine hook that was an issue. If instead we did something like %foo($a, ?, $c) or %$bar->foo($a, ...), that would have solved it.
At least that's what my engine-ignorant brain keeps saying. (And of course figuring out an unused symbol or keyword.)
 
@Crell yes, your brain is engine-ignorant because that's trivially distinguishable on the AST level
 
With the symbol you mean, or without?
 
without
 
... Then why did Joe keep insisting that it had to be done inside the function call setup?
 
the implementation did do it inside the function call executing instruction, not on setup?
Unless I'm confused what exactly you mean with "it"
The impl added ZEND_SEND_PLACEHOLDER and ZEND_DO_FCALL_PARTIAL
which is basically the right thing to do
 
2:28 PM
Joe's implementation (as he explained it to me) worked by starting a new-function setup, hitting the ? or ..., deciding "oh, this is a PFA call", setting up a partially-complete argument struct, then backing out of the function call. Then the partially-complete argument struct could be used as a callable and it would fill in the rest.
It was that "back out" logic that Nikita and others found too fragile.
 
Is someone aware of "*/_arginfo.h linguist-generated -diff" means in .gitattributes ?
 
@Crell Well, the FCC does the same - it sets up the frame and then collects the info from the frame to crate the Closure
 
this config make "git diff" to generate binary diff, which is unexpected
 
Not sure why that would be fragile or problematic @Crell
 
@bwoebi I dunno. It was above my pay grade then and still is. :-) If you think you can do a simpler version of Joe's patch that won't scare people away, the previous RFC can probably be reused near verbatim. :-)
 
2:32 PM
@Crell the patch went through multiple iterations, and if memory serves me well the intial patch did have some issues though.
But the final version doesn't (needs a bit cleanup still, but was mostly there).
@RemiCollet I think the intent is that arginfo doesn't become a massive diff in github commit diff viewer when the stub was slightly modified in some way.
 
hmm... this seems a github thing.. which breaks local git usage...
@bwoebi see github.com/php/php-src/issues/13990 created to track this an get feedback
 
2:56 PM
@bwoebi Well, the implementation is what kept it from passing so it wasn't fully there.
 
Did the implementation change during the RFC vote? I don't recall.
 
 
3 hours later…
6:18 PM
No? Which RFC?
 
6:46 PM
@Crell PFA
If the implementation is similar to FCC as @bwoebi says then maybe it's time to try again? There are definitely times I have wished we had PFA.
 
I think part of why PFA failed was because it was overhyped with pipe operator, which some didn't like.
 
7:17 PM
They do naturally complement each other.
(And I'd like to take a second crack at pipes, too.)
 
7:44 PM
Did a double take on that last line ngl
 
8:32 PM
Lol. Not sure if that was intentional. :)
@Crell I think PHPs internal functions are just so bad that even with pipes/pfa it's still going to look bad. I think pipes for anything but collections and strings is a bit niche, so I wonder if a good iterator api might get us most of the way there. I'd also be interested to see whether an internal iterator api with closures is actually fast enough (as f-calls have non-negligible overhead).
 
So this is interesting (by-ref in an array passed into a function, essentially doing call-time pass-by-ref removed since PHP 5.4): 3v4l.org/ErCrS Anyone has any idea what's going on?
I'd expect same output as here 3v4l.org/5ZqG8
 
@OndřejMirtes Array elements can be by-ref, so this is what I'd expect. We can't really remove that without major breakage.
Maybe I'm misunderstanding.
 
8:50 PM
@IluTov I don't know, seeing it like that makes me wonder why was even call-time pass-by-ref removed when this is still possible.
Also it's interesting that this syntax isn't mentioned at all at php.net/manual/en/language.types.array.php
 
Yeah, that's a new one to me
I thought it would have been the same as: 3v4l.org/9ftLT but it isn't
 
@OndřejMirtes Right. Arrays containing references is a big red flag, outside of a foreach by-ref (probably including, actually :P)
@Girgias The reference is unwrapped in [$r], you need a & there to maintain it.
 
Blergh
 
One of the few good things about references ^^
 
References are confusing AF
picks up some torches to light up and burn references
 
 
2 hours later…
10:38 PM
@IluTov Yeah, the APIs are bad, and everyone keeps saying we need to redo them, but we never do, because we can't agree how to. That said, I disagree that collections and strings are the only places for pipes. They're a common case, but not the only.
What Elixir does may actually be the prettiest approach for PHP: foo |> bar(baz) translates to bar(foo, baz). It effectively does a hard coded partial and then immediately calls it.
That would still allow for SA or compile-time type checks, avoid the need for a PFA syntax, and be infinitely extensible. You'd just need to write functions such that the first argument is equivalent to $this, basically, like many other languages do. Which... yes, means some of the existing functions will not work, but frankly, I'm OK with that. We can take that as an opportunity to redesign them to new versions like we keep talking about, like taking an iterable rather than an array.
 
JRL
11:05 PM
33-1. wow. i did not expect it to be this stark based on the discussion.
still unaccounted for no votes out there, but its been long enough i would expect more to be there
 

« first day (4932 days earlier)      last day (12 days later) »