« first day (3797 days earlier)      last day (1133 days later) » 

12:13 AM
Francisanisa ・ *General Issues ・ #80848
 
 
4 hours later…
4:27 AM
Hello
 
 
2 hours later…
6:46 AM
posted on March 09, 2021

3
 
 
3 hours later…
9:27 AM
ugh the CRLF behaviour of git on windows with a linux VM involved is so fucking stupid.
they need an alias shipped in the contrib git unfuck-my-files to fix a cloned repo after you realise and fix the CRLF setting
 
10:16 AM
It's a similar issue if working with someone on Mac and you're on Windows. Also, watch out for composer.
Something something symlinks >.<
 
10:29 AM
^ I think this is only an issue if you create binaries from composer files, I'd have to double-check though.
 
 
2 hours later…
12:41 PM
@Tiffany the problem im talking about isn't even related to team collaboration.
assuming that you want all text files to have windows line endings in 2021 is kind of stupid.
how many editors/IDEs for Windows don't support, or even default to Unix line endings
 
In fairness, when installing git, it'll ask you which line ending to use, but I stuck with the default cause it was "recommended" but I changed it last year when I encountered issues
@Stephen and yeah, even though I was collaborating with someone on Mac, I was using a Linux VM as my test/dev environment locally, so I ran into the same issues on my own environment. It made me tempted to dual boot Linux
 
@Tiffany right, and having it configurable is smart, but the defaults are wrong for 2021 IMO.
 
ThW
@Stephen Even Notepad support them now. But I think .bat/.cmd still needs CRLF
 
@ThW I mean, what I really wanted to say is "using windows for development in 2021 is kind of stupid" but I can't seem to find my flame proof jacket anywhere :P
I had to fix an inordinate number of typos in that single comment.
 
ThW
12:58 PM
@Stephen Let me check ... where did I put my flame thrower ... :-P
 
cmb
@ThW I think .bat/.cmd is fine with LF; however, bash has serious issues with CRLF
 
yes, please everybody stop writing applications that try to be "smart" with line endings, and just pop up a huge warning if any CR is encountered anywhere
for git, this seems to finally give sane behaviour: add a .gitattributes file in the root of the project containing * eol=lf
that over-rides all the over-complicated settings that try to detect your OS and all that nonsense
 
@NikiC (et all) how would you register a namespace constant from within an extension?
 
1:38 PM
REGISTER_NS_*_CONSTANT (where * is NULL/BOOL/LONG/DOUBLE/STRING)
 
cheers
 
@IMSoP ah that's a nice option to solve the issue of (mis)configured windows users.
 
@Sara it even works in PHP 5.3 without modifications ;-)
 
I sometimes despair of the number of macros in php-src.... but only sometimes. :D
 
1:56 PM
it is a very shouty codebase
 
Current status: trying to reproduce a stupid file permissions issue under Debian in a VirtualBox VM on Windows in a Parallels VM on macOS on a computer the size of a ham sandwich. What a time to be alive.
and of course I can't reproduce the issue.
 
2:19 PM
@Sara Just curious, but now that you're here, why do you oppose Fibers?
 
3:05 PM
Too little, too userspacey.
 
@Sara so you'd rather have a big package including internals integration?
 
We keep bundling script code on the basis that:
1/ Using composer is hard (it's not)
2/ Extensions need access to these types (then let's fix THAT problem)
I'd rather have something that does something more than provide a few interfaces for saying "stop" and "start".
 
@Sara you mean pecl, not composer?
 
No, I mean composer.
 
how is that related then?
or does composer now also install pecl exts?
 
3:07 PM
Because there's nothing in here that can't be done with userspace script.
No, I'm saying stop making this an extension.
Stop putting things in C just to show off knowing C.
 
@Sara I agree, but that absolutely does not apply to fibers? I mean, how would you do green threads in PHP without ffi?
 
With yield?
 
@Sara which has the current "which color is your function" problem - generators are not stackful, fibers are
 
But wrapping a generator in a (userspace defined) fiber is as well.
 
You don't have a stack tho?
 
3:12 PM
You can HAVE that nice fiber interface without the overhead and lack of portability of pushing things into internals.
 
also brief hello while I'm learning how to play Riichi Mahjiong :|
 
You do tho
 
@Sara no, you cannot … a least I wouldn't know how
 
You lift the abstraction up one level, I don't know how to simplify it past that.
 
I'm just saying, if we could, we would do it in userland.
 
3:14 PM
That's not true either.
We do LOTS OF SHIT in internals that we could otherwise do in userspace.
 
I'm talking about fibers only now
in general, I fully agree
 
Well. You asked for my reason. There it is. /shrug
 
yeah, thanks for the answer, but I think you didn't fully grasp why exactly that needs to be an extension and is not really doable in userspace
but okay
 
I'm willing to entertain the idea that there's some hidden, unexplained edge case that I'm just not pulling out of the RFC, but I can only vote on what's in there.
 
> Fibers can be suspended in any function call, including those called from within the PHP VM, such as functions provided to array_map or methods called by foreach on an Iterator object.
you cannot do a yield from passthrough through array_map for example
and any other internal function working with callbacks as well
 
3:20 PM
@Sara When I spoke with Aaron about this for the podcast, he explained a few things he can't do in just an extension, so let alone in user land: phpinternals.news/74 (from 11:32)
 
@bwoebi Okay, that's got my attention...
 
@Sara if we could have implemented fibers in userspace, we would have long ago.
 
@Sara everything else, can be emulated in userland, with enough overhead. The point though is about the overhead. with a yield-API, you have to do $someCall = await(doAsyncOp()); - with fibers, you can do $someCall = doAsyncOp(); you do not await anymore, but you decide what shall be run concurrently. Put the other way round, generators force you to deal with whether something returns Awaitable or not. And then you have to streamline all the awaitables (or immediately await).
 
A generator being stackless requires the return type of an async function to be a promise
Which @bwoebi just explained :)
Generator based coroutines in the call stack pollute the entire call stack with promises, because a generator can only pause execution of itself, not the function above. A fiber is able to switch the entire call stack. In other words, subroutines can request pausing of a coroutine in a fiber. That is not possible from a generator.
@Sara An example that demonstrates suspending a fiber in an array_map callback: github.com/amphp/amp/blob/…
Another example that pauses a fiber within a generator: github.com/amphp/amp/blob/…
Partly because that's just awesome, and also because it's genuinely useful. A generator can do async I/O to generate the values it yields.
 
3:38 PM
@Trowski by the way, what's the difference in performance between fibers and generator-heavy code (few yields of actual I/O tasks, mostly function overhead)?
 
@bwoebi The fiber code is faster mostly I think due to the coroutine/promise objects that are dropped.
Switching fibers is more expensive than switching generators, but because we're doing less of that and not wrapping the generator, it's an overall win.
 
@Trowski how much more expensive is it actually?
 
Not bad actually, depends on platform, but on x86_64 it's only about 20 pointers or ints getting swapped.
 
so, it defacto isn't any more expensive than switching generators … I mean, that are … what? 20 cycles?
 
Well, yeah, so I mean it is worse, but not by enough to really care about.
 
3:43 PM
pretty sure doing the internal call to switch the Fiber is much more expensive
 
Oh by far. I'm sure the method call to resume has more way instructions.
 
but I'm really asking about how much performance we gain by not having the yielding through overhead of extra promise objects and coroutines
"Switching fibers is more expensive than switching generators," is like mentioning some negligible point to just have some small con to not seem to have only pro-arguments :-D
 
Okay, but those arguments actually bring me to 'No', but my complaint now isn't userspace-ability as much as "why not async/await like Javascript"?
To which I think the answer is "flexability".
 
Well, yeah… I don't have exact numbers, and it's hard to single out just the benefit of fibers.
 
I would feel happier about Fibers if we marked it as an experimental feature or beta or something so we have full capability of doing backwards incompatible changes for it in PHP 8.2.
 
3:46 PM
Hi all
 
@Sara Javascript style async/await still has the "what color is your function" problem.
 
And that's compelling, but I'm not sure it's convincing.
Is it a problem though?
There's value in explicitness.
 
@LeviMorrison That would be fine. I'm not sure if we have precedent for that.
 
If I call a function that I have no idea may end up suspending itself, I may end up VERY surprised when something executes in a completely unrelated part of my application.
That hurts debugging.
 
I want to have a variable that I set value for that when calling an API and then use the set value for it when calling another API.
How can I do this?
I tried static variables but I could not succeed...
 
3:51 PM
@Sara I agree on that particular point. But having worked with C# and with Go, I'd chose goroutines over c#/js async/await. At some point, your application gets so large, that at the bottom of your stack everything is an asnyc function. At which point the benefits get lost. What I'd rather have is annotating things as "pure" (no side-effects) than async vs non-asnyc (no io vs io).
 
This is an example where if it lives in a branch nobody will play with it, but we kind of need people to play with it...
 
On the flipside, you get to decide what's running concurrently, by explicitly wrapping the call in an async-closure and get a Promise. So it is very explicit where you put code in parallel instead of having "everything" Promises
@Sara but tbh, that can happen with everything … just have a logger which dispatches an i/o call to save it to somewhere and suddently you're in an elasticsearch-API handling library
 
@Sara That's a valid point, but in an async app nearly everything is a promise, so that becomes a problem for nearly every function call, so "coloring" them differently offers little information.
 
yeah that
 
@LeviMorrison It could be included but not compiled by default, but that probably leads to the same problem.
 
3:59 PM
Moving to on the fence (will think about it), removing my vote for now.
 
I was wondering if anyone would care about the size and growth of the C stack in Fiber.
 
@LeviMorrison I think, if we had a feature model like Rust does with its #[feature], we could go that way, but that's beyond the scope of just this RFC
 
@Sara Having written a lot of async code now with both generators and fibers, I can tell you that generator/async/await style present the exact same state problems that fibers do. Applications for either model will have to assume any code may be executed concurrently. Even code that doesn't perform I/O cannot assume that it won't be called simultaneously, so introducing either async/await or fibers will produce very similar state problems.
I much prefer the fiber based code. It's so nice to not have to wrap every single function into a generator just because it calls one async function.
 
@Trowski and beyond that not await (yield) every single damned function call
 
@sj-i The C stack tends to not get too deep in PHP. It's not terribly different than having separate threads with growing stacks.
 
4:07 PM
@bwoebi I'm fine with something as simple as "this is experimental in PHP 8.1, use at your own risk."
 
@bwoebi Exactly. With fibers the 'await' call only needs to happen where the I/O operation actually happens, e.g., within the class that's reading from the stream. With promises, now every layer calling that function needs a yield.
 
@sj-i Apart form that most of the stack memory allocated is not written to and thus not actually dirtying memory
 
Fibers allow await to be used only where concurrency is explicitly needed, rather than every single function call that has anything to do with I/O.
@LeviMorrison It's not something PHP has done before, but I think people could understand that. "This feature may have BC breaks in 8.x versions."
 
@Trowski Yeah, most libraries are built in a synchronous way. If we don't want to wait 10 years to use async with most common frameworks fibers are the way to go.
@Trowski I think the JIT is implicitly viewed as experimental :D
 
@IluTov Exactly, well said.
 
4:18 PM
Except we can change a LOT about JIT compilation without changing userspace -- not sure that's true for fibers.
 
@IluTov Heh, pretty much. At least there's no public API to the JIT.
 
@Trowski Exactly what I was saying.
 
@LeviMorrison I don't believe the public API would need to change. It's based on the Ruby implementation.
I have no problem marking the API as experimental and unstable, especially since most PHP users won't use it directly.
Is that something I should email internals about now, or?
 
IIRC, if there is an extension hooking zend_execute_ex, recursion to VM would occur on function calls.
I'm a little worried if there aren't other situations that eat a lot of C stacks.
 
@sj-i sure, with xdebug, there will be a minor impact, but I don't think this posits any real issue
 
4:24 PM
@sj-i In PHP 8.0 we provided a new observer API to help move some users off this hook.
It probably needs improving by 9.0 if we want to remove zend_execute_ex entirely (which I think we do want to do eventually).
 
@LeviMorrison If, by removing, you mean the extra handling for when zend_execute_ex != execute_ex, then I agree
 
If you try to reserve a lot of memory, you will need to allow overcommit in the OS settings, which may cause the OOM killer to run around happily, so I hope there is a way to handle this better.
Assuming a call stack to call PHP from the C side, I can't think of a good way to efficiently extend the stack.
 
@sj-i overcommitting is the default tbh, you never want to disable it except for tightly controlled environments usually
 
@LeviMorrison Yeah, good job!
 
@Levi there are still valid reasons to replace zend_execute_ex, but these do want to reimplement execute_ex and not wrap it :-)
 
4:49 PM
@bwoebi Personally I think they are crazy because the semantics of function calls seem to happen every 1-2 minor versions...
 
Can anyone tell me how I can define a static variable in Trait and set/get its value?
I tried many solutions from the Internet but I couldn't
 
@LeviMorrison not really, execute_ex is quite stable
 
trait Test
{
    private static $data = [];
    public static function Set($key, $value) {
        static::$data[$key] = $value;
    }
    public static function Get($key) {
        return static::$data[$key];
    }
}
Something as above...
 
5:20 PM
I can set the variable through the Set function when an API is called, but when calling the Get function, there is no previous value inside the variable...
 
5:31 PM
@MRS1367 3v4l.org/86J6R I wrote some of the most convoluted code to produce this example
I feel icky
why are you using traits? you may need to make your variable names less ambiguous... I remember having a similar problem with an API that used a term that meant about three different things, I ended up having to re-write my code to more specific terms. As a result, it made finding bugs much easier.
 
@Tiffany: I can't change them from another functions in the trait?
Can only change them from a class that use it?
@Tiffany It's just an example from a part of my code
 
5:47 PM
@Tiffany And thank you for your helps :)
 
the wifi key at an unnamed business I visited this afternoon is megiveyouinternetlongtime10dollar
 
6:10 PM
Incident on 2021-03-09 18:10 UTC
Incident on 2021-03-09 18:10 UTC ・ GitHub Pages has Partial Outage
 
6:37 PM
HTTP Status header truncation ・ FPM related ・ #80849
 
6:52 PM
All issues have been resolved!
 
 
2 hours later…
8:41 PM
@DaveRandom That's got to be a small, local business. No way anyone who does heavy trade risks putting off their customers with something that... inappropriate.
 
9:00 PM
morns
 
@Sara very much so, obviously, but I also wonder whether the sweet ~65yo guy who runs the place has ever actually read it as anything other than a string of characters
like I do not believe he chose it, nor that he would be OK with it if I pointed it out
and next time I go I will probably try and find a way to tactfully point it out#
it took me a while to register what was going on it was a weirdly jarring out of context experience
 
9:48 PM
Received my pre-ordered paperback copy of At the Edge of Time: Exploring the Mysteries of Our Universe's First Seconds. Should be an interesting read.
 
13.73+/-0.15bn years, must have taken a lot of editing
 
@Sara I'm too 'tired' to discuss it properly, but have you read What Color is Your Function? I think it's pretty much the opposite of the view.
 
@NikiC We missed an edge case, namely class Enum (extends|implements). I tested T_STRING T_STRING in the parser, that technically works but it's an ugly workaround. Can I test in re2c that enum isn't followed by extends or implements in a simple way? That would be BC less because class extends is not a valid class (or enum) declaration.
 
> We estimate that the first stars appeared in our universe about 200 million years after the Big Bang. These early stars were much larger and shorter lived than those found today. Only now are telescopes powerful enough to produce images of these stars about to come into use. Our Sun and its Solar System are relative latecomers to our universe, forming about 9.2 billion years after the Big Bang. Today, at the age of 13.8 billion years, our universe continues to expand, cool, and evolve.
 
@Tiffany fyi, someone made a better visualization for space-time diagrams.... which might come in handy: youtube.com/…
 
9:56 PM
@Danack but I want to read something other than a computer book :|
 
Also, tl:DR "Bang! hisss........"
 
And astronomy/cosmology has been a longtime fascination of mine that I've yet to explore
 
Nevermind, got it.
 
@Tiffany sounds cool. It's just that if that book shows space-time diagrams at all, I've always found them really difficult to understand, and it turns out that at least in part it's because they're easier to understand when animated, rather than static on a page.
 
@Danack though, touche: "If you've ever watched a documentary, listened to a lecture, or read a book about the Big Bang, there is a good chance that you've been presented with a timeline similar to the one described over the past few pages." (sorry for double ping)
 
9:59 PM
@Danack like diarrhoea held right to the very last nanosecond
 
@DaveRandom related, using the phrase "blackhole" to describe matter compressed to a point, allegedly took longer to gain usage in the USSR due to the fact the equivalent word was already in use as a synonym for arse....
 
I suspect that "synonym for arse" is not doing justice to the actual translation
 
And no-one wanted to say, "I'm interested in researching blackholes" ( ͡° ͜ʖ ͡°)
 
in fact its extremely specifically descriptive :-P
 
@Tiffany Do you know the Daniel and Jorge podcast?
 
10:06 PM
@Crell I do not
 
If you're into cosmology, it's definitely one you should add to your list. iheart.com/podcast/105-daniel-and-jorge-explain-t-29862087 (Or via all the podcast networks.)
It's a particle physicist explaining just about anything physics to his roboticist/cartoonist friend for an hour, twice a week.
 
I'll check it out.
 
10:27 PM
I spent a good few days trying to understand the GR field equations, tl;dr: I failed
I still don't get how spacetime "flows"
 
11:04 PM
@Tiffany That's been me for a looong time. Then we started this 'bookclub' at work and now we're reading The Calculating Stars by Mary Robinette Kowal.
When I started it out, though, I had just ordered two more programming related books :-P
 
@Ekin I have a book I really want to read, but it's not great nighttime reading cause it needs my brain to work. The Magic of Math
Can't lazy-read it and expect to understand what I'm reading :/
I may just lend it to my niece because it might interest her, and she'd get better use out of it presently than me.
I should post a picture of the stack of programming books on my "coffee table" next to me...
 
@Tiffany I started taking myself a 'coffee hour' every day when I wake up, mostly because every day I find myself trying to make time for non-work thoughts. That's when I'm reading, for about an hour.
 
11:20 PM
something similar has been suggested to me before, I should take it up...
 

« first day (3797 days earlier)      last day (1133 days later) »