« first day (3904 days earlier)      last day (1269 days later) » 
00:00 - 22:0022:00 - 00:00

00:00
I forgot putting salt and vinegar potato chips on bread was a thing, and now I'm kinda craving it
 
2 hours later…
01:55
@Trowski @kelunik wanted to chat with y'all about your sponsorship push. I'm going to be offline this weekend but maybe next week if y'all had a few moments would love to talk to you about some things.
 
1 hour later…
03:11
@CharlesSprayberry I'm around at the moment, want to chat for bit?
03:29
moin
04:07
Is facebooks Portal advertising on television in the USA @Trowski ?
@JoeWatkins Dunno, don't have regular TV anymore. Haven't seen it on youtube at all.
they have the most distasteful advertising campaign in the uk at the moment
they're using miscarriage to sell it, and I just wondered if only the UK is being subjected to that ...
I'm surprised they're still trying to sell that thing. Facebook is the last company I would trust with a camera and microphone in my house.
they're pushing really hard, before they ran a campaign that features a new mother struggling to breastfeed, and keeping in touch with her own mother for advice ... quite a tear jerker ... but using the death of unborn children to sell your thing, there should be laws against that ...
Public opinion should (hopefully) take care of that.
04:22
I also find these devices a little scary, no matter who makes it ...
 
2 hours later…
06:41
@IluTov the original use-case I had in mind was for traits that provide protected/private methods, and need to define either flags, magic numbers, etc. Enum's kind of make it less of an issue now for a lot of cases, but for something that's purely internal, a constant would be much simpler IMO.
@Girgias just wait till someone wants to add str_first_three_chars(), because neither substr nor str_left are obvious enough
07:34
@Girgias I can see some use for this. While it's trivial to implement manually (similar to clamp) I think having a more expressive name makes sense. Of course it could be in a package but there is no such standardized package with common functions. Now whether these functions are actually more expressive is a bit of a question mark. The names are definitely not optimal.
but substr specificially does the left/right thing already.
@Derick I could imagine that many people don't know that it works with negative indexes. But even more so, seeing str_right (or a better name) would make it immediately obvious that you're taking from the end of the string, while with substr($str, -5) you won't see that until you look at the parameter. The difference isn't huge but when the cost of the function is minimal it can improve readability.
"@Girgias just wait till someone wants to add str_first_three_chars(), because neither substr nor str_left are obvious enough"
from Stephen earlier
@Derick "Clean code" can definitely be taken too far, I wholeheartedly agree there.
But also, FWIW, back in 2005! I worked on a templating engine, in which we did implement str_left and str_right: zetacomponents.org/documentation/trunk/Template/…
but it has no substr
07:44
@Stephen Alright. It's too late for 8.1 anyway but I'm sure I can find a few hours to see what's possible for 8.2 if you want. I can see myself supporting it for consistency (I don't know why constants were singled out for traits) but only if the implementation is trivial. And I probably don't see myself using that.
 
2 hours later…
09:58
@IluTov no worries, I appreciate it. I keep meaning to go back to it, and re-send that draft to internals to ask for any further input on it before trying to create an actual RFC and then bribing someone to write an implementation, and every time I get caught up with work and other shit and forget about it until it's too late.
@IluTov what if the strings you're dealing with are RTL? (Also, does str_starts_with take this into account?)
strings in PHP being byte arrays, RTL is irrelevant.
.. Its possible I have this understood wrong, but my understanding is that a sentence that's read RTL would still be stored LTR, and the unicode flag would tell the device - e.g browser - to display it RTL. But what I meant I guess, was "shouldn't these names reference 'start' and 'end' not "left" and "right"
because "right" is not necessarily the same as "end"
ah, legit point.
10:14
@IluTov Another possibility would be to have dedicated entries in the PHP doc about those typical problems (e.g. compare the x first / last character of a string) and those would explain + point to the existing functions
10:26
@Trowski Sorry I missed you. My wife and I are moving today and I'm going to be offline until Tuesday. Definitely wanna sync up with you then if you're available.
10:36
@PatrickAllaert an overview of each 'family' of functions might help with common uses that experienced developers will mostly just know
10:58
@IluTov or we could have a generic str_grab($str, 'first three chars') similar to strtotime('next month')
cmb
cmb
:D
@Gordon So expressive 🤩 Relevant: github.com/BrandonShar/stack-overflow-buddy
Is socket_set_blocking() deprecated?
@IluTov I like it :D
11:20
Is there any site where you can post job ads found on the internet and have people write snarky comments translate the ads. I wanna post stackoverflow.com/jobs/521867/…
Sometimes /r/choosing beggars, if it fits the context
- You identify when it's necessary to build things CORRECTLY vs. when to build them QUICKLY: we never build anything correct and have tons of technical debt and unrealistic deadlines.
- You invest personal time in self-development and improving your craft: we don't have a training budget for you.
- You are HONEST about your capabilities: our requirements are poorly communicated and if you don't get them we'll blame you for it. also, we hired plenty of juniors.
- You have a GROWTH mindset: this is a shitty place but you can persevere
My employer still has a job posting up for PHP devs
up to $200,000 a year for 4 years experience... I smell BS
But you gotta be a laravel ninja
I like how the "about this company" is a link to a Google drive file
And they have eight "five star" reviews on glassdoor... that's not shady
On the subject of possibly switching to GitHub issues: github.com/features/issues
11:37
@PatrickAllaert Expressiveness is also about cognitive load when reading code. If you can understand a line in 3 vs 5 seconds that makes a big difference.
Q: in the following code, PHP will first look for `App\count` then fallback to `count`, PHP will do this over and over since there's no guarantee that `App\count` won't be added at runtime, but is there to make PHP ( or more specifically OPCache/JIT) understand that the code won't change, and new type will not be introduced to allow for such optimization?

```
<?php
namespace App;
$a = [];
var_dump(count($a));
```
@Tiffany I'm really excited about this.
@SaifEddinGmati too late for 8.1, but that would be part of the functions (and other stuff) autoloading.
As having the same function looked up over and over again, and possibly having different results each time, would be insanity.
@SaifEddinGmati Yes, add a backslash. \count().
Apart from that, no.
@CharlesSprayberry it does look pretty neat. Will need to do some research to see if it's a viable replacement to bugs
I have today and tomorrow off, so going to try working on stuff
11:43
i mean without doing that :D

there was an RFC to add support for compiling PHP code into OPCode file, that would be deployed, i think that would have allowed for such optimization, also with union/intersection types, type checking could have been cached.

This is exactly what HHVM does with repo auth mode which gives it a good performance kick: https://docs.hhvm.com/hhvm/advanced-usage/repo-authoritative
@Danack Even with autoloading we don't know. 3v4l.org/iSXM2
The issue with the RFC i remember it was mostly focused on obscuring PHP code, not optimization :/
But once a class has been found, it never triggers the autoloader again for that class, right?
@Tiffany Yea, I'm not sure about the viability of replacing PHP's bug tracking system but for some of my own personal/OSS use it looks to be a pretty significant upgrade. Particularly being able to track issues across multiple repos apparently... at least from what I read about it yesterday
@Danack Once it's found, yes. But it will always be triggered if it's not found. 3v4l.org/UYSmq
11:46
yes, but if it's not, it will, same with functions, the point is to avoid doing that again, since there's a guarantee new types can't be added.

but with something like repo autho mode, autoloading is not even needed.
@SaifEddinGmati I'm certainly making a note of adding optimization as seeling point.
and be annoying by saying, "repo autho mode" == pakidge?
The thing is, usually an undefined function/class will terminate the program. It's probably not useful to store a map of undefined functions to skip the first lookup in the local namespace. After all, that's a hashmap lookup vs a hashmap lookup. I doubt this will improve performance.
Although technically I guess it could be stored in the opcode. Anyway, this would be a breaking change.
@IluTov undefined functions will not ( e.g: App\count() ), since it will fallback to global function count(), but it also has some other optimization benefits as i said, e.g: if a parameter is a union ( A|B ), and we are running in repo auth mode, all types are already known, all subtypes of A and B are known, therefor it will be an O(1) operation to lookup if the type checks.
@IluTov agree, and it shouldn't, unless it's wiki.php.net/rfc/direct-execution-opcode
@SaifEddinGmati I've written my thoughts down in a confusing matter. What I mean is double-triggering the autoloader is not a problem since usually failure in autoloading means the program terminates.
yes, Saif was just talking about where the function is found on the first go.
What is a more polite way of saying "get a less shitty email client or go away":
11:51
@IluTov understood, i'm just trying to make a point for wiki.php.net/rfc/direct-execution-opcode :p
@Danack actually, the opposite :D
@SaifEddinGmati I don't quite understand what you're saying here. You mean the optimizer can make more assumptions? I'm not sure that's true if what function is called still depends on runtime, which function is called first.
Alright, got a 1300~ mile road trip and then 2 days in a cabin with no internet access, get some tech-free time. If I don't become a grease-stain on the freeway see y'all next week!
3v4l.org/oveNN Which function is called depends on if Bar\foo is defined when calling foo(). Of course this is terrible code. But I'm not sure if sticking with the same function after the first call is a lot better.
yes, but only with this RFC: https://wiki.php.net/rfc/direct-execution-opcode + banning the same functions hhvm bans in repo auth.

If the whole code base has been made into 1 file, that guarantees not more types will be introduced at runtime.
12:04
IMHO PHP's future is going to be pre-compiled, or rather, fully pre-loaded.
@SaifEddinGmati Yeah, something like "Repo Authoritative" (never heard of that term, in Swift they call it "whole module optimization") would enable a lot of improvements for the optimizer. Preloading already kinda does something similar but I'm not sure how much we take advantage of that in the optimizer.
12:32
I don't understand PHP EA's error on this line :
if (!is_dir($concurrentDirectory) && !mkdir($concurrentDirectory, 0755, true)) {
> [EA] Some check are missing: '!mkdir($concurrentDirectory, 0755, true) && !is_dir(...)'.
if I listen to it, and put a second !is_dir after the mkdir it stops complaining alright but I grasp nothing of the intention or potential problem here.
Anyone knows what's the edge case that could bite me if I don't?
12:46
@MarkR oh my goodness this is marvelous, with the popped sounds hahaha. I love how everyone just keeps serious :D
@SaifEddinGmati all that proposal would have allowed was to delete the source files and rely on the cache; the individual parts of the application would still be loaded in an arbitrary order at run-time
@IMSoP yea, it could have been better if it was focused on optimization rather than obscuring source code as i mentioned before.
that's not what I'm saying; I'm saying it's completely unrelated to the optimisations you're talking about
to optimise the lookup for a function, you need to know that no new functions can be declared in the current namespace
that's nothing to do with whether you parse source files or caches
@IMSoP This is part of what I was considering with classmap, if a full classmap can be considered authoritative (the same would apply to a function map)
banning same functionality as hhvm repo auth would have allowed it to be used for optimization.

the point is that RFC could be used as a building block to have repo auth mode in PHP
12:56
I don't think it helps
@IMSoP how could things make it in runtime if we did this? docs.hhvm.com/hhvm/advanced-usage/repo-authoritative#tradeoffs
what you need is for "namespace App { function count() { } }" to be an error
@SaifEddinGmati the fact that you don't need the source files is actually completely separate from the fact that you have pre-defined all the code
for instance, you could have a "pre-load authoritative" mode, where no code can be defined outside the preload script
@IMSoP what if the preload script itself can spawn symbols at runtime?
what do you mean?
if i preload this:

<?php

make_foo(): void {
eval('function foo(): void { echo 'hey'; }");
}
13:01
sure; if you dynamically define things, they can't be statically optimised
that's true whatever intermediate representation you store on the server
hence why if we add a new mode to build all source code, it can scan for eval, require, require_once, .. etc at build time
and bail if they are present
sure; but it can equally do that at run-time
or both
require_once 'foo.php';
require_once 'bar.php';
optimise_now_and_ban_new_code();
catching these early would be better :/
sure; I'm all for adding static analysis to core PHP
but that still doesn't require you to be able to ship compiled opcache files
the part you may be missing is that creating a safe and stable intermediate code representation is really difficult; JVM bytecode and .net IR are much more carefully designed than the structures used by the Zend Engine
expanding the role of preloading and the existing opcache is much easier
@IMSoP Yeah, that's the main issue with the RFC above. PHPs opcodes are not very atomic, and they change in every minor version.
13:08
you mean a new mode where you can preload everything and ban dynamic code after the entry point file? that sounds god
@SaifEddinGmati yep, that's precisely what I was trying to suggest above
@IluTov IMHO that's not a problem, you can't use hhvm repo autho compiled with hhvm 4.114.0 with 4.114.1, and it's not a problem.
the optimiser can then have a phase that runs after the preload script has completed but before accepting any requests, which can make much stronger assumptions
cmb
cmb
@Trowski, does bugs.php.net/bug.php?id=79719 ring a bell?
@SaifEddinGmati seems like HHVM doesn't even attempt to check the versions match, which seems pretty awful
> Getting this wrong will lead to extremely cryptic errors about missing units in the repo.
on the plus side, the build script produces a single file for the optimised deployment
that's very different from copying around opcode files corresponding to individual PHP files
I think the "ban all run-time definitions" mode is the first building block
yea, agree
figuring out how to prepare on one server and deploy on another then has more value, particularly if the optimisations are slow
13:30
Hi
Anyone having good Mysql knowledge then please suggest what change I need to make to show actual yearName value instead of just an alias as yearName?
http://sqlfiddle.com/#!9/1a8da8/2
generally, column names in SQL results aren't dynamic
I don't know if MySQL has any functionality for that scenario, but the key word to search for is "pivot"
yeah! I searched the same but in that column name is static
oh thanks SO chat, I type up a message with new lines and press send, my message doesn't appear to send my message is gone from the text box -_-
I guess the "send" button is finicky with the SO dark chat extension?
the yearname value is dynamic so I am finding to make it dynamic. this way I will be able to show on the Table without any hurdle
yeah, I suspect that's going to be tricky
you might have to build the SQL dnyamically
13:45
docs question, I am looking at rewording a statement in the manual for ucwords, but I'm unsure about a part that I want to use.
> The definition of a word is any string of characters that is immediately after any character listed in the separators parameter (By default these are: space, form-feed, newline, carriage return, horizontal tab, and vertical tab).
I was planning to change the wording to
> A "word" is described as any string of characters that is immediately after any character listed in the separators parameter. By default these are: space, form-feed, newline, carraige return, horizontal tab and vertical tabs.
I'm unsure about the usage of double quotes for "word" -- this doesn't seem sterile enough for technical documentation. Feedback?
or, you can just have the DB result return "Year1", "Year2", "Year3", and have a separate query to get the header row for output
okay. but I just found another use case
If year2 is not available then it should null but it is not showing instead it is throwing it at the end

http://sqlfiddle.com/#!9/679ce9/1
cmb
cmb
@Tiffany the basic problem is that the beginning of the string (first byte) is also upper-cased, but the manual doesn't mention that
@cmb it does in the first paragraph, I think. "Returns a string with the first character of each word in string capitalized"
rereading that, the wording is a bit clumsy...
let me get another whiteboard and try to wordsmith it, it uses a parameter tag in the sentence, which may not need wordsmithing
cmb
cmb
yeah, and then says a word is a substring after a separator
13:59
I see, let me try something else
A "word" is described as any string of characters that is separated by any character in the separators parameter. -- not entirely happy with using "separated" in the sentence, given that separators is the parameter name
maybe "partitioned" but I'm not sure how well that would translate?
segmented
14:18
delimited
cmb
cmb
^ that
updated
@cmb No, never experienced anything like that. How about you, @kelunik?
would I be okay to close github.com/php/doc-en/issues/685?
cmb
cmb
@Tiffany yes, please go ahead :)
14:31
I was a little trigger happy
@Tiffany 😛
Is it Friday yet?
yesterday was my Friday this week, I took today and tomorrow off to do other stuff
@salathe 😅
14:52
@CharlesSprayberry Alright, good luck with the move! I'm around nearly every day, so just give me a ping again.
PHP 8.1.0alpha2 is announced!
3
"Returns a string with the first character of each word in `string` capitalized, if that character is alphabetic and not listed in the `separators` parameter.
"By default, `separators` are space, horizontal tab, carriage return, newline, form-feed, and vertical tab."
thoughts, @cmb @salathe?
as I was rewriting the second paragraph, I specified "alphabetic characters" and thought what I was writing could be rolled up in the first paragraph
cmb
cmb
done
thanks
15:07
@Tiffany That's going backwards from what we had already: it doesn't say what a "word" is.
I like what was already there: a description of what happens to each word (i.e. what the purpose of the function is), then a clarification of what exactly a word is in this context.
alright
should I reopen the previous PR or create a new PR? (sorry)
@Trowski @cmb I haven't either and I'm confused, because PHP usually sets SIGPIPE to ignore, no? /cc @NikiC
cmb
cmb
@Tiffany better do new one
15:20
@kelunik Good point, it does.
cmb
cmb
But user might call pcntl_signal(SIGPIPE, SIG_DFL)?
They could. The OP of that bug is frequently in our chat room, I'll ask. I wouldn't think he did, but you never know.
cmb
cmb
ta
15:41
@cmb If you do, expect all kind of aborts like that :D
cmb
cmb
then it might be better to not allow that in the first place, or at least to document that
16:12
aren't things like str_left and clamp too late for PHP 8.1 now?
Technically not, but... ugh
Wasn't it past Tuesday with 2 weeks + 2 weeks until feature freeze?
alpha2 just went out so.... yeah, beta1 in under 4 weeks. Clock has run out.
Calling a feature clamp is going to confuse me every time I touch the X25519 reference implementation :P
Which makes it down to RM discretion, technically
16:23
right, beta1 on July 22nd, with feature freeze on the 20th.
It makes me think of wheel clamps
is the 2022 release still going to be 8.3 or are we going for 9.0?
This function is dumb. str_right/left are dumb. These features are dumb.
Give me something to get excited about, not more userland kitchen sink bullshirt.
The question is... do I want to talk about them on the podcast.
Let's ship scalar objects and call it 9.0 :P
@ScottArciszewski I expect 8.3, unless there's a compellig reason to bump
16:25
Cool :)
8.2, surely, in 2022 ?
@Derick Invite me on to talk about 'em, I'll give you something to get rating over
oh wait, 8.1 is this year
8.2, 8.3, whatever... I don't need maths, I'm a software engineer
I have an off-by-one bug in my brain
16:26
@Sara haha, happy to do that, but It'd be unfair to the authors who spent time on it.
I skipped 7.4beta3, remember?
@Derick Pfft... fine. I'll go back to shaking my fist at clouds then.
this is what happens when I contribute to core; I look at the internal build version and think "oh yeah so 8.1 exists, therefore 8.2 is coming in November"
@ScottArciszewski The struggle is real
@Sara Are there many clouds?
@Derick There only has to be one.... it knows what it did.
16:28
shakes fist at cloud from the Sunshine State
Sigh, I really need to start looking at online credit card payments.
@Derick I think that is spelled "integrate with Stripe".
Stripe doesn't handle EU VAT rules.
still?
16:44
@Derick I've built a few payment gateway integrations over the years and audited even more, should you need help
tbh, for now I just need something simple.
So, Omnipay with an authorize.net gateway that supports VAT?
Also, depending on your average transaction size, it might better to ask for "Interchange Pricing Plus" (0.10% + $0.30) instead of the standard 2.9%. I don't recall if that requires PCI-DSS compliance and/or quarterly pen-tests, because every time I was involved those were already in play.
17:20
cheers, I'll have a look at that too
18:07
@Derick most of the work i did with Stripe consisted of trying to get VAT working, we had to do it ourselves ...
@SaifEddinGmati I figured, thanks!
@JoeWatkins I tagged you on a Twitter thread where someone asked an implementation question about partials I cannot answer.
yesterday, by Joe Watkins
@cmb can ? target a variadic ? if it can, we tried those semantics already, they were universally hated because it means ? sometimes means one thing, and sometimes another ... if it can't, how do you target a function that is only variadic ?
yesterday, by Joe Watkins
any complexity you remove from the implementation lands on the users lap ...
Mm, placeholdering ...$args. Yeah, that would be an issue.
As a thought exercise, if we supported single-value-only ?, no variadic placeholder, would that simplify the implementation at all? I mean, a meaningful amount?
18:17
@SaifEddinGmati You have to manually create the rates, there's still no ability from Stripe to look them up, correct?
yesterday, by Joe Watkins
@cmb in case curious, it was and would be simpler, and it's what everyone else does ... but the first version tried to something closer to other languages and it just ended up confusing ... if we're going to accommodate php, there is no simple ... there's only the option to limit complexity by reducing scope and leaving out named/unpack, but reduce it further and leave out variadics and you no longer have a useful/usable feature ...
@Trowski yes, but you can list them, what we would do is: list them all, see if any of them match ( description is "{country} VAT" ), if none, create one, save it, and use it, otherwise use the one available, something like that, not totally sure, worked on this about 6 months ago lol
oh, actually, we would check the "jurisdiction" property
Would it be unusable without variadics? It would mean a function with existing variadic params couldn't use it, but you could still fn() it. And if you're placeholdering a lot you'd have to type ? a bunch. But... would that be a middle ground people would accept in 8.2? (Since I'm sure we don't have time to try again in 8.1.)
@SaifEddinGmati VAT is probably simpler than taxes in the US. Here you need to look up tax rates based on shipping address.
I'm not shipping anything though, no goods are involved
18:21
No idea what tax law is like in Europe.
In the US, I would still need to charge you a tax based on your address for software, even if I'm not shipping it to you.
@Trowski well, you get the country from the billing address, there's also some cases where you shouldn't set a VAT, other cases where you should..., it's annoying, and I'm not even European lol
@Trowski yea, same for EU
I should have said it's no longer generally useful, no longer generally usable ... and that is true
we could have also removed a bunch of complexity by leaving out magic support, but that too means it's not generally usable ... imo what we have now is what is minimally required for a generally useful/usable implementation
@Trowski Even business to business? I don't think so.
It's also not ... software, it's a service, like AWS.
@Derick Unless I have a tax exception certificate, yes, even business to business.
@Derick AFAIK ( this is based on my experience working with Symfony on the payment for SymfonyInsights, SymfonyCertification, SymfonyLive ... ), yes, even business to business.
18:29
Hey guys .. the open job opportunities for PHP developers are getting decreased in our country .. and golang jobs are getting increased .. do you think I have to start learing golang?
I've heared from some CTOs that golang is much more powerful (supports over 50k requests per sec) and uses less resources than PHP .. that's why they are migrating
Saas products are generally non-taxable.
Again, this is the US. No idea about the EU.
@Shafizadeh ugh, golang is slow, we are migrating to assembly, here's the framework we are using: github.com/dbravender/someassemblyrequired
@SaifEddinGmati Assembly? I guess the development speed will be too much slow ..
@Shafizadeh but your website will be much faster ;)
that's right
18:37
@Shafizadeh that was a joke, we use PHP, and you should use whatever language you want, as long as you can write good software, the technology doesn't matter, I'm not saying you shouldn't learn Go, if you want to, go for it, it's good to explore other languages, but simply switching to another language will not make everything better, faster, and more secure.
ah .. yeah I see what you're saying .. thans
thanks *
@JoeWatkins Personally I'd have been entirely fine without __call support, TBH. I'm trying to figure out if there's an 80% feature set / 20% complexity point that would be more palatable.
@Shafizadeh Go is a good language to learn. As is Rust. Neither would be my first choice for building an app that generates web pages, though. They might be for generating high-traffic API-only requests, depending on the situation.
Right tool for the job blah blah blah. :-)
ah <like> :-)
18:56
@Crell I don't want to get it in at any cost ... if the level of complexity we have now is fundamentally not acceptable, then it will never be acceptable. That means we can't half implement it now, and work towards a complete implementation later, because it leads to the same level of apparently unacceptable complexity, and in the mean time, we're asking everyone to use half an implementation ... this doesn't make sense to me ...
Once the style becomes more common, there would be a different cost/reward balance. The argument now isn't (generally) "it's too complex to have", but "it's too complex for the benefit we get." If we can get an 80/20 point, then in the future the argument for bringing back the rest (mixing ? and ..., __call, etc.) may be made stronger.

Or we may find that no one even misses __call in the first place, in which case, we genuinely don't need that bit.
sometimes it's a reasonable strategy to introduce complexity slowly, this describes how the entire type system has evolved ... if at PHP-5.6, we proposed a patch to the type system at once to do everything it does today, nobody at all would have voted for that .. everyone has been able to use each little improvement along the way ...
but here, that doesn't look reasonable to me, we have to start with something usable, and that something is necessarily complex, and that complexity is apparently not acceptable ... I don't think there's anywhere to go from here ...
For me personally, if I'm honest, I doubt I would ever use anything more than a single ? or just ... on its own.
That's my question; IF we were to reduce the scope, would it actually reduce the complexity? (I don't know the answer to that, or what parts introduce what complexity.) Or is simply adding ? 90% of the complexity right there?
I can't put a number on it and won't guess ... some of the complexity comes with semantics, and some of it as a result of interactions with the system that doesn't want us to do what we're doing ... the later doesn't go away if we change the semantics ... it makes the implementation easier to read - ie the functions we are adding become simpler, but it doesn't make it easier to reason about - ie the resulting objects still have to interact with zend as it is ...
I guess that's something I don't grok at this point. If the net result is producing a Closure object, and various things already know how to use Closure objects, why does it require special casing in so many places?
19:07
it isn't a closure
That changed again?
no no, it isn't a closure in the internal sense, it presents a Closure API, but the object is not a closure, it cannot be ...
Ah. Ok, so if it's effectively a ClosureInterface, same (uninformed on my part) question applies.
okay, imagine there is a ClosureInterface, it follows that each concrete implementation has it's own detail, the detail for the concrete Closure exists already, the detail for the concrete Partial (imaginary) is what we are introducing, and it differs from the Closure detail, because they aren't the same concrete implementation ...
Right, with you so far.
19:15
well ... that's it ... all they share is the ClosureInterface, not details ... it's not special casing, it's just normal implementation of that imaginary interface ...
OK... so why does it "interact with Zend" in so many ways then that it becomes unacceptably complex?
@Trowski Yeah, we don't have silly rules like county specific tax where you need the exact address and a provider for the correct tax amount :D
the engine expects certain things to happen, and is designed and then optimized around those assumptions ... for example, a stream of INIT, SEND, DO_FCALL is not meant to be interrupted, the first fundamental change you have to make is making the engine aware that stream of INIT, SEND, + are not always followed by DO_FCALL
Ah, and breaking that assumption/optimization is the sort of complexity that Nikita is talking about.
yes, and others
19:23
Is there no opportunity to have independent logic for that structure? That is to say, could it be simplified in some way by not using the funky build and unbuild the stack stuff and just eating the extra frame?
and these are the things that don't change, no matter the semantics we have ... and there's a fair amount of edges there ...
ErnestErarp ・ *General Issues ・ #81199
@MarkR My entirely uninformed brains says the alternative would be to treat partials as sugar for making an actual closure object and move on with life, performance difference be damned. (Honestly in the common case it's probably not measurable; repeated partialing is a very edge case.) I don't know how viable that is to actually do, though.
Well if it were added in the somewhat inelegant, slightly worse performing way, and then we saw people using the fuck out of them, that would provide the evidence necessary to justify the complicated way to get the extra performance..
I think that's the approach Ilija had been trying, but I don't know if he ran into irresolvable problems or just out-of-his-league problems.
19:38
What's your thoughts on that @JoeWatkins?
20:12
Is there a reason you can't unpack arrays into echo when being used as a function? (eg. echo(...$args);)
echo is a language construct, not a function
echo isn't a function, but a language construct. There's a few language constructs that look like functions but aren't.
Jinx!
You guys are in sync, nice
You should see our tap dancing performance.
I figured it was syntactical sugar for the function
Now that is an event I would attend
20:14
I've no idea why it is a language construct... just that it is.
I'm trying to abstract out calls to echo for a transition phase to OO code
function ech0(...$args) { echo implode("", $args); }
Just opened internals and what a pile of shit posting from some over the last few days lol
I was going to loop over them but yeah that makes more sense
Any time you're about to loop, ask if you could use implode, array_map, or array_filter instead. :-) You can't always, but you can always ask.
20:22
echo has a magic syntax for multiple arguments - echo 1, 2, 3;
note that echo(1, 2, 3); is not valid
echo(1); is only valid because (1) is just a silly way of writing 1
Because PHP.
I recently added a note on all this to the manual: php.net/echo
So... like Crell said
according to the readme for PHP 3, the print statement in PHP/FI 2 actually operated as printf, supporting format specifiers and placeholders
for some reason, printf became a normal function, and print and echo continued life as a pair of weird, not-quite-equivalent, not-quite-functions
I do wonder what they were thinking back then... I've heard Rasmus talk about using the function name length for the hash bucket etc... but many things just leave me scratching my head
20:27
I don't think there was any thinking before PHP 3. And only a little bit of thinking before PHP 4.
Somewhere around PHP 5 people realized they were actually writing a language and should pay attention to it. :-)
what always amuses me is how much that is also true of C
the most recent piece of PHP code I wrote that is being used in (sort of) production is running on 4.3.10. I wrote it ~&10 days ago.
I don't trust any language developed before 2000. Yes, I write 99% PHP. Don't at me.
define "trust"
I trust VBA to do the same absolutely retarded thing every time
people had spent years of expensive R&D budgets trying to design the perfect programming language, and then a couple of hackers went "eugh, this machine's not powerful enough for a proper language" and built C as a side project
20:36
@Crell good call :p
@IMSoP Yes, and look how many billions of dollars in damage that has caused!
hah, indeed
I think I've found that using less language constructs is usually better
maybe learn Lisp rather than Raku then :P
I kind of want to learn Raku, but only for entertainment; I can't imagine trying to write maintainable code in it
Wait did Perl change to Raku?
I'm confused
Oh it branched off kind of
I was watching a video of this lady talking in a ruby convention who started with smalltalk
You may have seen it, "Nothing is something"
20:46
A few years ago Perl 6 got renamed to Raku, because the Perl 5 community just wasn't interested.
There are very few language constructs in smalltalk, which I think the language constructs are a good thing but thinking about how they would be done without the constructs and just objects is interesting. Made me want to learn smalltalk just for that in itself
iirc Perl 6 was an approximate contemporary of PHP 6, with very different outcomes
ah that makes sense
@scorgn yeah, Smalltalk seems really interesting; I love the idea that you can implement true and false entirely via polymorphism
@IMSoP Yup, seeing that made me change the way I think about a lot of things
I thought true / false and if statements were these integral parts of programming which everything else was built around
20:52
some of the concepts people come up with for esolangs are fascinating like that, too
21:13
So, hypothetically, what's the most value one could extract for the PHP project for say... $1000 USD?
Ideas welcome
Ten bookcases for elephpants
@MarkR it doesn't make sense, a closure isn't a partial, making an "actual closure" isn't helpful
@JoeWatkins I don't believe I said an "actual closure", and if I did I already forgot I did. I asked if there's a less intrusive way of doing it without a bunch of stack re-writing that might sacrifice a bit of performance, for less complexity.
To provide an opportunity for the feature to prove it's worth, the balance of its cost to its unknown worth apparently being a major factor in people voting against it
oh I thought you were asking me about the whole bit ...
Jun 18 at 22:08, by NikiC
@JoeWatkins Yeah, I don't think it can really be materially simplified. The previous semantics were kind of simpler on a technical level, but less intuitive
Where does the complication occur? I'm assuming it's something to do with reflection, because it's quasi-possible in userland, given an existing callable.
21:22
2 hours ago, by Joe Watkins
I can't put a number on it and won't guess ... some of the complexity comes with semantics, and some of it as a result of interactions with the system that doesn't want us to do what we're doing ... the later doesn't go away if we change the semantics ... it makes the implementation easier to read - ie the functions we are adding become simpler, but it doesn't make it easier to reason about - ie the resulting objects still have to interact with zend as it is ...
I really feel like I'm repeating myself a lot ... we can't talk our way out of this complexity ... it is inherent, it is throughout, it is unavoidable if we want semantics that make sense ...
It is the 'interact with zend' bit that would perhaps benefit from some communication. Is there a working PHP userland implementation available?
how would you do that ?
let me throw a hack together
(that wasn't really a question)
you can't do the things we do in userland, you can make something that behaves a bit like it, but apples and oran ... whales ...
@MarkR there's just so much confusion from every angle that I don't know what to address first or how ... I think one of the assumptions I'm hearing is that the implementation has tried to be optimal, and if we removed those optimizations it makes it simpler
that isn't the case
For those of us who aren't experts, knowing why that is the case is difficult without a semi dumbed down explanation.
21:34
probably you were mislead by the RFC, the "Optimizations" section, which for some reason is missing any kind of explanation of what to expect (must have been removed) ...
we didn't optimize anything in order to be able to have many applications be one call, that's a natural consequence of partial application, there's no reason to expect anything different
Seems an issue is that the parser change is required here almost no matter what you do. INIT and SEND may not be followed by DO_FCALL if partials are a thing, no matter how you implement it after that.
that's the bit I don't understand, what prevents those from being swallowed and the args pushed onto the stack properly formed for another call?
I would think you could press an internal function into creating the partial and returning it, rather than a separate opcode.
Though my comprehension of that portion of the engine is still a bit lacking, so there may be a reason that wouldn't work.
21:50
3v4l.org/lcsC9#focus=8.0.7 im just throwing things together here with little care of attention obviously
references etc are naturally a no-go in userland
I'm not sure what is being suggested or why
I am enquiring as to technical reasoning behind why the stack manipulation, as opposed to a copy-and-forward.
what stack manipulation are you referring too ?
I believe it was previously explained that on the ) rather than performing the call, they're stripped off and stored inside the partial, rather than performing the call, or is that no longer the case / never the case?
we don't perform the call, but we have to leave the stack in a state that looks like we did, so that execution may continue normally
00:00 - 22:0022:00 - 00:00

« first day (3904 days earlier)      last day (1269 days later) »