« first day (3864 days earlier)      last day (1066 days later) » 
00:00 - 21:0021:00 - 00:00

12:07 AM
About to start some series/movie, but if you are fast I can get at least the start!
 
@Danack Is pythonsadness a thing?
 
@StatikStasis sure likes to lube stuff!
onlyfans.com/statikstasis
 
@Girgias Yes but it's the blog of a very lonely snek
 
12:20 AM
@Crell Sorry for the double email, thought I hit reply-all.
 
I get a double email from most people on that damned list who don't know how to hit Reply-List...
 
@Crell If only that button existed. I have to manually edit.
 
Get a better mail client. :-)
 
So should you, my mail client combines the emails.
Some people ignore emails not addressed to them and only the list… so yeah, I'm not sure there's a good solution.
 
@Trowski I liked the first one better, but still a nice retort
 
12:29 AM
@PeeHaa Based on what I've heard that site is used for… I'm not sure I'm interested.
Especially if lube is involved. That's going to be a hard pass.
 
Which explains the lube.
 
@Trowski Lube helps with it though
 
The names Skywalker. Lube Skywalker
 
\o/ subnautica below zero 1.0 is released today
@StatikStasis hint hint play play
 
12:37 AM
oshit
long time ago I think it looked really really nice
then I got back to playing factorio
 
ftr you can make lube from creepvine seed clusters :-P
@FélixGagnon-Grenier it's still my favorite casual game :) first game was awesome too
after the first game I got into Surviving Mars
 
@Ekin I have many questions
 
no worries, we can ask them to @StatikStasis when he's collecting them for his lube station
 
hmm. I just seen they remade mass effect trilogy and I now need more RAM
 
oooh really
is that the legendary edt
I wonder now if it's worth re-playing all that again
 
1:11 AM
@Ekin I believe that, given an extremely beautiful legendary edition on a big screen, the story will be that much more impressive
... you know, because I'm vain and superficial
 
:)
 
I think I agree it'd be. Some games are just great to play again with their remastered editions
It's been some years too now since I played it, so yeah why not
 
so, there are two paths.
1. impulsively buy ME legendary edition now
2. wait for it to be reduced
 
do you have a neat game you're enjoying right now?
if yes, it's #2. Otherwise I guess you have just one option :P
 
 
2 hours later…
2:50 AM
@Crell ping
 
3:49 AM
also @LeviMorrison
 
 
4 hours later…
8:16 AM
Morning
 
moin
 
How's it going Joe?
 
8:46 AM
Hi @MarkR, hope you're well. If your free atm (it's not urgent), can we discuss the is_literal RFC, I know we've discussed it a few times, and you've helped me a lot (how it could be done, and alternative ideas), I just want to make sure we're all on the same page, and agree this is the best approach.
 
@CraigFrancis I'm not sure what else to offer at this point as you seemed quite far ahead :-) if you're polishing the feature you're better off hitting up Joe or Nikita
 
@MarkR exhausted
 
Tech wise, I think we are (I've been using Joe's implementation for a few weeks, and it's been brilliant)... but once I iron out the last couple of points with Dan, I think it's voting time, and want to make sure I've not missed anything (i.e. will anyone vote against it).
 
@JoeWatkins I recommend an IV drip of Yorkshire tea
 
tea is not working, my brain is fuzzy, I've been looking at the same error for hours, and I know it's a simple thing, but I can't figure it out ...
 
8:56 AM
when did you last sleep? (I know, sleep is for the weak).
(or you could share the problem, I know I'm no more than a Rubber Duck, but I'm happy to look).
 
it's been about a week since I slept for more than a few hours ...
 
ouch, that's rough... brain can't stop?
 
nods
 
I feel that... Me 2 weeks ago: Okay... I want to get this upgraded to typescript while I've got a chance before the next version.... 12+ hours a day for 2 weeks later... still not fixed
 
focusing on code, while trying to avoid thinking about something else that's bothering you?
@MarkR it's amazing how, what seems like a simple job, turns out to be a heck of a lot of small jobs.
 
9:04 AM
nothing else can really get my attention properly
not even the conversations I'm meant to be listening too ... I am trying, and y'all should know that I've attempted almost everything that has been suggested, even when I said it was wrong and didn't like it ...
 
@JoeWatkins do you have someone to talk to, just to go over the things going around your head?
fair
 
I think the meaningless placeholders are harmful
 
how so?
 
I would first ask what you mean by meaningless placeholders, as harmful is a pretty strong statement.
 
and it just is not reasonably possible to change the order of named arguments, and the only other option is disabling them ... it's possible, but not practically, the thing you end up with is horrible, it's not "a shortcut to a callable" anymore, it's this horrible thing whereupon every application (including call) we are actually generating whole functions ... that's not what partial application is supposed to do and it's so very cumbersome ...
and even when I do that, I still can't make it work properly, presumably the thing that works possibly is even more complex ...
 
9:11 AM
Can you drop a link to your working branch please?
 
I don't have one, I'm working in one branch that I git reset --hard before I push ... I'll try for a couple of hours, then give up and reset and go at it again later ... last night I messed up a push and some vm changes got in, but it's throw away until it works ... and it doesn't work, and I can't see a way to make it work ...
I think multiple trailing ? should be an error, otherwise how am I suppose to know at a glance if a partial declaration will error? Plus it’s adding multiple ways to declare the same thing, which I was hoping to avoid.

fourParams(1, 2, ?); // OK
fourParams(1, 2, ?, ?); // OK for you, should error to me
fourParams(1, 2, ?, ?, ?); // Again OK for you, should error to me
fourParams(1, 2, ?, ?, ?, ?); // Error for both

What value is gained in allowing any of those but the first?

I’d also be fine allowing a trailing ? in any declaration. It’s unnecessary, but one could argue that it’s consist
 
This in regards to the debate between ? for single placeholders and ...? for 0 or more?
 
I'm pretty sure we don't want two tokens, but pretty sure ? meaning "nothing, something, or anything" which essentially it does, is the harmful bit ...
 
I would agree that it's somewhat lacking on the intuitive side, which is why I keep bringing up ? for fixed and ...? for 0 or more (trailing only) matching the syntax for parameter lists in general.
 
@MarkR The use of ...? looks more explicit on what's happening.
 
9:20 AM
the only place you could use it, is at the end of the param list ... the problem, or thing causing confusion, seems to be there is no end to the param list ... if we define the param list has an end, it restricts the definition of ? to something you can make sense of
I think
 
Sure, that would be like the same goes for function($a, $b, ...$c) only being usable at the end
 
I lost my train of thought, sorry
 
No worries. I'd highly recommend finding yourself manual to do for a few hours today though, the last thing we want is you BBQing your own brain.
 
There is something good about physically exhausting yourself while doing something without thinking (although music can help, or maybe an audio book, so your brain has something to do).
 
9:35 AM
I built an entire wood workshop in my conservatory just so I'd have something practical to do, or out in the garden. It's helped keep what little is left of my sanity, being able to start something, and finish it the same day, and have something to look at and go "I did that"
 
That's a good idea... and much better than housework, where the results disappear in a few hours.
 
Sadly housework is my task today .__.
I'm pretty skilled at making things untidy considering I spend 99% of my waking time sat at my desk in one room
 
Isn't that the thing though... entropy is against us?
Do you have other people in your house who also to add to the pile?
 
Just my cat, although she does make her fair amount of contribution by knocking things off and dragging them around the place
 
... and the fluff? not that I'd be without my dog, who also helps making a mess, but is certainly worth it.
 
9:49 AM
Not so much with the fluff, she mainly confines that to the blankets she sleeps under, with one exception, sometimes she'll rub up against my SM7B microphone and cover it in furr. So annoying
The foam cover is a cat hair magnet
 
aww, she's just trying to help with the audio dampening (say the one who has no idea about microphones).
 
10:03 AM
morns
 
o/
 
mornin \o
 
 
2 hours later…
12:20 PM
@JoeWatkins I think multiple trailing ? should require at least as many arguments as there are ? present
But if you pass more arguments, they get forwarded
 
@cmb I have good news and bad news.. I got the GA-based Windows build to work, but GA will not allow me to run services (mysql/postgres/mssql) on a Windows based pipeline, thus can't make the tests work :( ideas?
 
cmb
@FlávioHeleno great news! Aren't MySQL, PostGreSQL and SQLServer already running?
 
12:36 PM
@cmb I don't think they are, let me double-check
 
cmb
at least PostgreSQL is explicitely listed: github.com/actions/virtual-environments/blob/main/images/win/…
 
well, 1 out of 3 already :)
there might be a way to install using "choco"
I'll dig more into it
 
1:18 PM
Happy weekend all
 
@JoeWatkins my experience with something similar is that trying to power through doesn't work.... stepping away from the computer and doing some exercise and stretches helps a big, but sometimes brain has just had enough. Funny story, it seems that my neck pain was causing the muscles to clench hard enough to actually restrict the flow of blood to my brain....which doesn't help me code well.
And if you don't already have one, a foam roller for helping with stretches is a good investment.
 
2:20 PM
I wonder how to break the deadlock on this partial application discussion; it feels almost like one of those optical illusions where some people see a vase and some a pair of faces
 
I was going to suggest everyone taking a week off from talking about it...
 
yeah, maybe; frustration doesn't breed clear thinking
 
2:53 PM
@JoeWatkins Oh hai.
I am holding on the pipe RFC until partials at least gets into voting, so I don't want to wait TOO long. :-) But we also don't want a baked Joe.
 
I only know Joe baked
 
I think for me, the important bits are:

foo(?) // Works for any arbitrary function of any arity.
twoArgs($one, $two, ?); // Works to let you pre-fill all args, but not actually invoke it until later.
fiveArgs(?, 2, ?); // Works, same as putting in the extra ? to match all the args.
arbitrary(?, ...$args); // Prefill by name, placeholder everything else.

As I said on list, I don't mind losing "arbitrary number of trailing ? work, no matter what." I can't see a use for it, but I can see a use for the 3rd in the list above, as is.
Reordering params, I really don't care about and wouldn't spend any time on. That's sufficiently niche that I'm fine telling people to write their own arrow instead.
 
@Crell for you personally, is the downside of a separate "..." token just the extra length, or is there something more fundamental?
 
6 hours ago, by Joe Watkins
it's been about a week since I slept for more than a few hours ...
 
@Danack Yeah, that's not actually good. :-( Tried melatonin?
 
3:08 PM
45 mins ago, by Danack
I was going to suggest everyone taking a week off from talking about it...
 
@Crell probably safe to say he's tried a lot of stuff
as a sleep aid, I mean
 
@IMSoP I find it extra conceptual complexity of extra visual bits, extra typing, and a second token to have to think about to offer no value. "At least one ? means it's a partial, fill in the params you want and ignore/placeholder the rest and the engine figures it out" is a very simple model for people to learn and use and read.
 
@Crell yeah, that's where my optical illusion analogy comes in, because I don't find it conceptually simple at all
the "?" means "either a placeholder for an argument, or just a marker to make this a partial, depending on where it appears and what else is going on"
 
Inquiry: Given that it's already mid-May, how do people feel about me bringing the pipe RFC back up for discussion before partials have started vote? The discussion on it a year ago was mostly "I like it, but we want partials first to make it prettier." At this point I think partials are going to happen, it's just a matter of polishing these edges.
 
I just can't get my head around foo(?, 42) and foo(42, ?) not producing the same kind of function
 
3:13 PM
When you allow for PHP ignoring extra arguments already, "and put an extra meaningless optional argument here at the end" just kinda fits in my brain naturally.

Plus, auto-currying languages like Haskell work by "if you don't provide all args, it partials on everything else automatically". So a tail ? seems natural to me.
 
@Crell you keep coming back to that extra args thing, but I don't get why it's related
in $a=foo(42, ?); $a(); there are no "extra args", there's a missing arg
 
Looking at that, my brain mentally translates it to $a = fn($x = null) => foo(42);
And then shrugs.
 
why is $x optional?
there's a ? there, why shouldn't that create a mandatory parameter?
 
Because you can placeholder an optional param in a function just as easily. Nothing about ? implies required.
 
Unless it comes first...
 
3:20 PM
four($a = 1, $b = 2, $c = 3, $d = 4) {}
$f = (?, 20);
$f(); // Works
 
That is going to confuse a lot of people without doubt :-)
 
yeah, that's just weird
this doesn't work:
function foo(...$args) {
    var_dump($args);
}
$a = foo(?, 42);
$a();
 
It doesn't?
 
not on the branch currently on 3v4l.org
 
/me headscratches.
 
3:28 PM
I understand why it would work, I can also guestimate around 90% of people are are going to come across that and spend more time trying to figure out why it works, than they'd ever spending typing ...?
 
@Crell Might need to copy default params to the partial.
I don't recall seeing that done.
 
Do they show in reflection?
 
I'm mostly OK with saying ? to the left of a bound means 1 and to the right means 0 or more.
 
looking closer, the error for that case indicates a missing parameter call foo(), which is odd
 
At least that's a concrete definition.
 
3:29 PM
@Trowski I'm ... not
it feels unnecessarily arbitrary, when we could just have "..." or "??" or something, and not need an "if" in the definition
 
I'll have to double-check. There are reflection tests now but I don't know if they exercise 100% of cases.
@IMSoP I really don't know what the perspective difference is that we have that makes Trowski's guideline there complicated. I see it, grok it, and move on without issue.
 
@Crell the same token means different things in different positions
 
Which has never happened anywhere in PHP...
 
but why do it again when we don't need to?
why have "special trailing ?" when you could just have "..." ?
 
Remember, your advanced skillset and knowledge of other languages is not representative of the millions of people using PHP :-) If we have a choice of subtle complication and confusion, and explicitness, we would be well advised to err on the side of explicitness.
 
3:32 PM
but looking at the example with default, I think I'm beginning to see the other side of the optical illusion: calling the partial doesn't necessarily even use the fixed values from the partial syntax
that's the bit that really hadn't occurred to me
so $a = foo(?, 42); $a(); just calls foo() and completely ignores the 42
 
Hang on, I'm fiddling with a test a bit.
Actually... I have to run out for an errand right quick, so I'm going to do that and come back and let you know the result of the improved test. :-)
 
@Crell This… looks like a bug.
 
I think a better reflection test may help explain what's going on (to all of us).
 
@JoeWatkins What's up?
 
@IMSoP this is just a bug
the call is performed with undef slot
 
3:37 PM
That makes sense, probably need to copy the default from the prototype?
 
if the prototype has a default it's not undef, when you call() what you applied(?, thing) the first slot is undef, and you don't provide a value, thing is copied at index one, but before it gets there the engine borks on the undef slot at 0
ah, looks like we need to just handle variadics better ...
 
foo($a = 1, $b = 2); $a = foo(?, 2); $a() would make more sense if PHP allowed omitting previous arguments, but it doesn't, so at that point it's no longer comparable to a closure.
 
doesn't seem worth fixing if we're just about to change what things mean ...
@LeviMorrison @Crell that's what I was pinging about, can we (you) get together the changes I need to implement ...
 
This also looks wrong: 3v4l.org/ppjb9/rfc#output
I think we're mostly down to 1) Should a trailing placeholder be ? or ... 2) Should named arguments with a placeholder be an error.
 
@JoeWatkins I wish I knew. On one hand, I'm happy that some people liked my original design better with both ? and ... (although they keep spelling it ...? instead).
 
3:42 PM
And 3) make multiple trailing placeholders an error or not?
 
Back in about a half hour, I think.
 
Just thinking aloud in an attempt to see if named parameters could be useful for something (reordering is not an option, named args are not positional). What if f(x: ?, y: ?) meant that arguments x and y must be supplied at some point, and if they aren't it's an error?
 
@LeviMorrison That's probably my fault :( I thought using ... would conflict, but if not then I prefer it.
 
This is not quite the same as always erroring on named parameters.
 
@LeviMorrison that would feel natural to me based on my guess of what "?" means
 
3:44 PM
@LeviMorrison That would be fine, at least then they have meaning.
 
I'm fine with ... but we should spend a bit of time theorycrafting if there's anything we might potentially use it down the line that it might conflict with
 
Oh, probably require that they are applied by name, not position? Would avoid some of the issues like:
 
it would also be consistent with foo(42, ?, ?) requiring two positional arguments at call-time, which was also my guess until I read the RFC & discussion
 
function f($x = 0, $y = 0) {}
f(y: ?)(1);
 
I guess the downside is that it creates a new notion of "named-only parameters" which doesn't exist elsewhere; but maybe that's OK
 
3:49 PM
I assume we'd have no trouble parsing telling $a = foo(...) apart from $a = foo(?, ...$args) ?
 
At least we didn't a few years ago when I wrote it originally.
That could have changed -- it changed for intersection types, for instance.
 
Crell's earlier example with ? used with a default and a fixed 2nd argument has confused me even more tbh. What "?" means seems even wider than it did before.
 
yeah, I think there may still be a conceptual gap here
 
@MarkR Well, there is a bug there.
That's part of why I'm more OK with a trailing ? being 0 or more, since it doesn't really translate directly to a required closure argument if there's a default available.
 
it all comes down, I think, to how many arguments the created Closure has; I initially assumed the number of arguments would match the number of "?" placeholders; then I assumed it was the number of "?" placeholders except for trailing ones, which is what felt weird; now, I'm wondering if the Closure's signature is completely independent of the "?"s somehow
 
4:00 PM
Not entirely. In this, the closure (when the bug is fixed) is defined as fn ($a = 1, ...$args) => four($a, 20, ...$args)
 
For me what fries my noodle is that an optional can effectively come before a value, which is not permitted anywhere else.
 
@MarkR Think of ? as copying the param definition from the prototype.
Type, name, and default value.
 
is that true of trailing "?" though?
 
<?php

function four($a = 1, $b = 2, $c = 3, $d = 4) {
    var_dump($a, $b, $c, $d);
}
$f = four(?, 20);
$f(); // Doesn't send bound 20
what do you expect ?
 
No, a trailing ? is translated to ...$args
@JoeWatkins I expect 1, 20, 3, 4
 
4:03 PM
@Trowski so what if you want to copy the definition from the prototype?
 
@IMSoP Well, I mean it effectively does when it splats the other args.
 
But PHP does not allow omitting earlier args, if you want to reach an optional you have to set everything before it e.g. foo($a = 1, $b = 2) you can't do foo(, 5). So it feels odd that a partial could effectively do that
 
I'm also over-simplifying. The closure returned by the partial doesn't actually copy the type.
It does need to copy the default, hence the bug.
@MarkR It's not though.
 
no it doesn't need to copy the default
default are filled
 
if I hadn't read any of this discussion, this would be my intuition:
foo(?, 42) == fn($x) => foo($x, 42)
foo(42, ?) == fn($x) => foo(42, $x)
 
4:06 PM
@JoeWatkins No? Just make sure to not pass undefined, or how will that work?
 
$f = four(?, 20);
$f(); // Doesn't send bound 20
 
@JoeWatkins Not sending the bound 20 seems wrong.
 
yeah but what position to send it in is not clear
 
I would expect that call to use the default for the first arg and 20 for the second, and default for the rest.
@JoeWatkins It's not? You're binding the second arg.
$f(1) gives me 1, 20, 3, 4 as I expect. So should $f() (or error with not enough args).
 
an error is what I was expecting initially; but that's based on my apparently incorrect intuition of "? means argument"
is this a better intuition of what currently happens?
foo(?, 42) == function(...$args) { array_splice($args, 1, 42); return foo(...$args); }
foo(42, ?) == function(...$args) { array_splice($args, 0, 42); return foo(...$args); }
i.e. the signature of the closure is independent of the number of "?" tokens, they're just a way of counting args to skip over?
 
4:13 PM
function f($x = 0, $y = 0) {}
f(y: ?)(1); // y was never supplied! An obvious error.
f(y: ?)(1, 2); // Still confusing
f(y: ?)(1, y: 2); // Better
So... model it that way?
Seems like the best way forward to me.
 
@LeviMorrison So using a placeholder with a named arg requires named args at the call site?
 
@Trowski Yes, especially because you can't just look at the original signature anymore; parameters can be bound positionally out of order, so it may not be obvious at this a given partial site what is being place-holdered. If you do (y: ?), then make sure y: $y is given at some point later, ether by a further partial, or by final invocation.
 
f(?)(); // error, or not? if f(y:?)() is an error
 
we can totally do that
 
@JoeWatkins That sounds great.
@IMSoP Yes, still error, no y was provided.
 
4:18 PM
sorry, unclear question
 
okay I start in the morning, I rest now ... lata all ...
when you're done having this conversation, ping me so it's marked for me to read please ...
 
rest well; thank you for all your effort on this
 
@IMSoP I think it is cohesive to error. This would necessitate something like ... to be added to allow for cases like f(...), f(1, ...), etc, where.
 
@IMSoP This is kind of how it actually works, yes.
 
Time permitting I'll do one better: I'll write it up in an email with justification included. My wife is hosting a party today, so I may not have time, we'll see.
 
4:21 PM
The default args need to be spliced in there as well it seems.
 
@NikiC and @Crell, what do you think about this behavior for named parameters and placeholders?
And to finish that last sentence (oops): This would necessitate something like ... to be added to allow for cases like f(...), f(1, ...), etc, where you aren't trying to specifically create a placeholder and want whatever the original had.
And there may be some interaction required with default such that something like f(..., y: 4) or f(y: 4, ...) should be legal; see if you can think of examples that would suggest that's correct or incorrect.
 
@Ekin @PeeHaa You guys are hilarious! =P
 
4:36 PM
Trying to catch up... Which of the three floating questions are you talking about, there? :-) (Trailing args, named args, and the other one I can't recall.)
 
Named args in that case.
Though if we have a ... placeholder, that can be required for trailing args.
 
it sounds like it's coming back around to the "what does ? mean" question as well
as in, if foo(y: ?) means "must have param y", should "?" always mean "must have param"
 
If it were up to me, I would choose ? to mean "Copy a single parameter from the parent prototype, including default value."
y: ? would mean the partial must be called with named param y.
 
@Trowski That is how it works in my head as well. "copy-pasta this argument from the function being partialed."
 
@Crell Unless it's a trailing ? :P
That's why I'd like to see a different symbol there.
 
4:49 PM
"Copy-pasta all the rest of them." :-)
 
Which I can live with so long as we forbid extra trailing ? to avoid confusion. Still would prefer the other symbol though.
 
5:02 PM
@Crell To be somewhat cohesive this would mean one or more, not zero or more -- we'd still need another symbol, so at that point just use the other symbol and don't special case the trailing ? placeholder.
 
@StatikStasis :) you too! how's the keyboard doing?
 
Curious. The reflection API is worse than I thought. :-)
So this is interesting. Currently, default params do work, and get passed through... but the reflection API can't detect them.
 
@LeviMorrison My 2c is that foo(?, x: ?) is fn($v1, $v2) => foo($v1, x: $v2) with copied types/ref but not default. Under that model, named params should be supported with reordering or not supported at all.
 
We really need to all agree on a mental model of how it works, because that determines what is logical. :-)
 
@Crell Uh, I'm not sure that's true. 3v4l.org/ppjb9/rfc#output
Intuitively, I thought named params would work as @NikiC described.
 
5:12 PM
They're working. But reflection isn't seeing them.
 
Did you click on the example? That's not working.
 
I think the meaning of passing too few args is different in different mental models
 
If I bind a param in a partial, I expect that param to always be bound.
 
@Trowski That looks like a bug, but a different bug than the bug I'm talking about. :-)
 
Yeah, I see what you mean. I think it's because the default isn't being copied to the partial.
The partial invokes the original function, that uses the default if the partial didn't provide it.
 
5:17 PM
But it's still executing as I'd expect it to.
 
Which is why my example breaks.
Yes, because the partial invocation doesn't provide the params at all, so it uses the default.
 
3v4l.org/uQLB1/rfc#output - It does use the supplied argument here.
 
3v4l.org/OsDdU/rfc#output three: int, 1 o_O
Also notice on the last example it doesn't use the 20 in the $two() case.
 
@Danack @Crell soft feedback : etags are now in action, and seem to do exactly what I've always wanted from cache: cache hit stuff when necessary but never have problems when a resource actually changes (profile picture changes, deployment of new releases). no need for query string random strings.
 
yay
The main thing to think about with etags is transclusion, which happens a ton with modern CMSes.
 
5:25 PM
(just a sec, googling :P)
 
Embedding one object in another.
Which can include, say, a "latest post by this author" block beside the content.
 
Nothing in the page object you're viewing changes, so the etag wouldn't change, but that OTHER object changed, so the etag of the whole page should change.
And depending on your CMS, there could be a metric assload of those. (A typical Drupal page has a dozen.)
 
I might be missing something, but wouldn't generate the etag based on the html content of the document be sufficient?
like, at the end, when everything has been rendered, and the last posts are inside the document
 
There's 2 ways to deal with that sort of thing:
1) Build some elaborate caching mechanism that tracks the IDs of all involved objects and use all of those as the hash for the etag, and do other involved tracking to know when to cache bust.
2) Fuck it, keep the cache lifetime short-ish, people can deal with stale secondary data.
 
5:28 PM
:P
 
Yes, but then how do you know that the page doesn't need to be regenerated without actually regenerating it?
 
I have a question about this actually, about php's header function
... but the more I try to articulate it, the more I discover spaces of information I have no certitudes about, such as where is the time mostly spent when transferring the response, in generating it server side, or the transport?
 
That will depend greatly on about 500 specific details of each request.
 
... yeah I'll just throw it out but it might make very little sense
when the header function is used, I believe it sends headers right away?
 
Correct, give or take buffering that may or may not happen.
 
5:33 PM
then, if that's the case, wouldn't a normal page load, generating the etag sufficiently early, be able to send it early and make the rest of the request hit cache instead of transferring the server's response?
I think I need to understand http better at this point, I feel like "response" in that sentence is not what an actual http response is
 
And if you call header() after sending even one byte of normal output, you get an error. :-)
 
yeah, god bless ob_start :P
the first lines of my bootstrap
require __DIR__ . '/../vendor/autoload.php';

if (function_exists('ob_gzhandler')) {
    ob_start('ob_gzhandler');
} else {
    ob_start();
}
I could move the require after the ob I guess
 
Most frameworks now don't bother with ob_start, but instead just build a response object over time and then send it all at once, header and body together. That is almost always more robust.
 
I somehow managed to make my app do both these!
I ob start, then the last stages of handling the request use a response object to echo content and send headers
then flush the ob
 
That's the thing: How do you generate the etag? There's broadly two options.

1) Load the content object that defines the page from your DB, hash it, use that as the etag. If it matches, you skip the rendering process.

2) Compile the Etag based on the rendered page, just before sending it. The upshot here is the etag logic is very simple. The downside is you may have HTTP traffic, but you save zero CPU time since you're still doing all of the work on every request.
In other words, you base the etag on the INPUT (raw data) or the OUTPUT (rendered HTML). The former is faster, but then you need to know up front what all of your input is, and that requires a lot more knowledge of your page generation process than most CMSes have unless they were built specifically for this functionality.
Or if you know you're not doing any transclusion, like in simple REST cases, in which case everything is easier, but also less necessary.
 
5:43 PM
I think I start to understand the "static sites ftw" current lately :P
 
yesterday, by Danack
@Crell Did you try using last modified time everywhere? if yes, how did it go, if not, what seemed wrong with it?
possibly you didn't see that due to inconvenient trolling...
 
@JoeWatkins Partials conversation after you left.
 
@JoeWatkins I updated the reflection test. It's now failing in a way I think it should be passing. (The parameter default is working, but reflection isn't reporting it as working.)
@Danack Last modified time of which object, though? The main blog post on that page? The concatenation of all the timestamps of the comments on that page? The timestamp of the most recent post shown in the sidebar block?
Each of those has different trade-offs. It's not a trivial answer either way.
 
what about images and js scripts?
 
Almost everyone finds GET hashes easier to work with for those, if they're generated. :-)
If not, then an etag is easy enough to generate off of the file system or a file hash.
 
5:50 PM
@Crell any of them? Unless one of the things is changing every few seconds then worrying about a small increase in cache misses seems ...not a thing to worry about...
 
Depends on your use case. (We seriously spent weeks arguing about this in Drupal 8. Because Drupal.)
Because if the etag NEVER changes, then even if the expiration time passes it may not get regenerated.
 
the art seems to be into choosing things that will not allow the etag not to change when stuff actually changes?
(many double negations, yes)
 
> If I was going to write a blog post about them, I'd probably go with "Using Etags is as simple as naming things!".
 
Essentially, yes. What information do you want to go into determining the etag? Anything that isn't in that list will inherently be stale on any page they appear on, unless something in the include list happens to also change.

What's safe to do that to is a very use-case-specific question. There is no all-encompassing answer.
Especially not when most CMSes don't even have the ability to give you a list of all the inputs that go into a given page.
 
 
2 hours later…
7:44 PM
@Crell ping
also @LeviMorrison
 
8:17 PM
@Trowski
krakjoe@Fiji:/opt/src/php-src$ cat test.php
<?php

function four($a = 1, $b = 2, $c = 3, $d = 4) {
    var_dump($a, $b, $c, $d);
}

$f = four(?, 20);
$f();
krakjoe@Fiji:/opt/src/php-src$ sapi/cli/php test.php
int(1)
int(20)
int(3)
int(4)
 
@JoeWatkins +1
 
also I fixed the strange reflection ...
 
Yeah, figured that was just a bug.
 
and rewrote the code that fills in parameters so it's easier to understand (and remodel, based on whatever we need to change) ...
 
What do you think of Levi's suggestion with named params?
 
8:21 PM
well I was pretty excited about it, on the face of it, requiring named parameters solves a few problems ... the problem is that we can't always tell what is a named parameter and what isn't ...
the current code will optimize away the named parameter if its used in order, it just uses the offset, so by application time the information about what was named and what wasn't it lost
tbh I think we should probably just disable them ... the value they bring seems dwarfed by the possible confusion they cause ...
 
I see no problem disabling them, maybe even preferred as it won't limit a potential future use.
 
we could require that they are only used in order, and that would make application sites easier to understand, but you loose the main benefit of named params ...
 
Right, then what's the point?
 
yeah exactly, the only possible benefit is param: ? is slightly nicer to read than ?, you don't have to go back to the declaration site to tell what's going on, sometimes, maybe ...
 
Could you still bind using named? i.e. foo(?, param: 'bound')
 
8:26 PM
but it's not really worth it probably ...
 
If you can bind by name, but placeholders can't be named, that'd be plenty.
 
yeah that'd be possible, as well as named at final call time, I think, although haven't thought about it very long ...
 
Using name at call should be possible I'd think.
How about trailing placeholders then? I think limiting to a single trailing symbol makes sense, so f(1, ?) is the only allowed partial definition, not f(1, ?, ?), f(1, ?, ?, ?), etc.
 
<?php
function foo($one, $two) {

}

$foo = foo(?, one: 1);
what does that mean ?
 
@JoeWatkins That wouldn't work with defaults though, would it? That's one of the primary use-cases for named parameters in the wild (lots of defaults).
 
8:32 PM
Make a partial, binding $one. the name at least makes it clearer.
 
@JoeWatkins Depends on what model is chosen, which we still don't agree on, ha.
 
So if using named params in a partial, the ordering no longer matters (like normal named param calls).
 
In one model that should definitely error, as you are providing a placeholder and a bound parameter on the same thing.
 
@LeviMorrison It should work with defaults, I think there's some tests that do that now.
 
yeah, I'm not sure what is best
@LeviMorrison it would, not really connected, that I can see ...
<?php
function foo($one, $two = 2) {
    var_dump(func_get_args());
}

foo(one: 1);
foo(1);

$foo = foo(?, one: 1);

$foo();
?>
(gdb) r
Starting program: /opt/src/php-src/sapi/cli/php test.php
array(1) {
  [0]=>
  int(1)
}
array(1) {
  [0]=>
  int(1)
}

Breakpoint 1, zend_partial_call_magic (execute_data=0x7ffff7a00040, return_value=0x60) at /opt/src/php-src/Zend/zend_partial.c:391
391	{
(gdb) c
Continuing.
array(1) {
  [0]=>
  int(1)
}
consistent with engine, but I don't know if surprising ...
 
8:39 PM
I think that makes sense.
Named args reorder on call, so reordering on partial definition is fine too I think.
 
function f($x = 0, $y = 0) {}
f(?, x: 1); // what happens here?
 
> Test PECL bug #20636
That is a comment from 2010....anyone know what/where "pecl bugs" are? it doesn't appear to be related to bugs.php.net/bug.php?id=20636
 
@LeviMorrison x is one in function, same as ^^
 
I think I need to go through a giant list of potential edge cases and decide what I think it should do, and see if I can adjust the model to accept and reject to match.
 
so I think you were thinking that the first ? at application time would result in the default being fetched .... defaults are filled at call time, by call magic, not by the engine - because it can't figure out where to get them (nor could reflection) ...
I said earlier they'd be fetched by the engine and we didn't need too, but it turns out we did, the engine was getting it wrong, which a few of our tests covered up/obscured ...
 
8:47 PM
I noticed some of the tests bound what is the default value, which is not a great idea.
Which is probably the covering up you're referring to.
@JoeWatkins Maybe you missed this before: How about trailing placeholders then? I think limiting to a single trailing symbol makes sense, so f(1, ?) is the only allowed partial definition, not f(1, ?, ?), f(1, ?, ?, ?), etc.
 
I'm totally down for those restrictions and they shouldn't be hard to figure out, I'm waiting for a concrete definition of what they should be ..
 
I guarantee you that's going to confuse the majority of people :-)
 
@JoeWatkins I think if you limit it to a single ? for now, we can then debate if that symbol should be ? or ...
I do believe there's consensus on a limit though.
 
@Trowski What if there are four parameters? Is f(?, 1, ?, ?) okay?
Did I get these all correct, Joe? Based on the current patch?
function f($x = 0, $y = 0) {
  var_dump(func_get_args());
}

A: f(?, ?)(1, 2); // f(1, 2)
B: f(?, 1)(); // f(0, 1)
C: f(1, ?)(); // f(1, 0);
D: f(1, y: ?)(2); // f(1, 2)
E: f(1, y: ?)();  // f(1, 0)
F: f(1, x: ?)();  // f(1, 0)
G: f(1, x: ?)(2); // f(1, 2)
 
00:00 - 21:0021:00 - 00:00

« first day (3864 days earlier)      last day (1066 days later) »