« first day (4249 days earlier)      last day (924 days later) » 

Wes
Wes
04:06
\o
 
3 hours later…
07:20
Was there a contentious decision to not allow object destructuring when adding array destructuring in PHP7.1? 3v4l.org/rjpnG
 
2 hours later…
09:09
Is there anybody who can give me access to github.com/phpinternalsbook/PHP-Internals-Book?
 
1 hour later…
10:29
@IluTov Nikita, probably.
10:50
[$a , $b ?? 2] = [1, null];
Hope this works in feature
 
5 hours later…
15:25
@Crell I think I've said this before. Adding something that either does pre-processing or allows users to hook in to when compile errors occur (and so only transform a file when it has unknown syntax) is a generic thing that would make it possible for people to write code that uses generics without committing core to a particular syntax.
The difficulty of the argument would probably come from people who experience the "not great" experience that pre-processing has in JavaScript.
16:10
> "F,F4xQeY->Wj7q3'z+Uv2??
I hate password fields like that. More than once I've noped out of registering for a thing because I couldn't get through the requirements. Special call-out to ancestry.com...
Tried registering through their site a couple years ago, password requirements were ridiculous, and IIRC I went through the trouble of trying to make my password comply, and it still was "missing something" so... yeah... they're not getting my data then...
Because nothing ever good comes from it... I should complain on Twitter
 
4 hours later…
19:58
@Danack You're talking about Rust-style macros, it sounds like?
20:11
@Danack IMO the macro syntax etc problem has already been solved, psalm / phpstan are way ahead of us (and it's a very common format used in many other languages). The thing that is missing is a) the ability to use them inline without docblocks and b) some kind of engine-transparent define to specify which variant it's used... i mean it'd be standardised within a week either way
@Crell Probably not. I meant something that transforms a PHP file when PHP can't compile it.
@MarkR that's fixing a specific problem, which is different from being able to fix the generic type of the problem - that PHP is not really extendible from userland.
plus it moves that conversation to be owned by core, which is also a bad thing
IMO if you want to do transpiles beforehand, there's already a proven solution for that which is overriding the autoloader.
"a proven solution" - but no-one does that.
s/no-one/approximately no-one/
20:30
There's major performance concerns to that.
Depends how you build it. In most cases it would be almost imperceptibly less performant.
Yes if you did it every single time you'd be slowed down to a crawl, but why would you do that? Do it once then cache it based on last modified time.
If you're going to do that, don't do it at runtime and just pre-transpile it to begin with.
But at that point, we're back to "It's Psalm's problem", which is not the goal.
Which is what github.com/mrsuh/php-generics does which I saw Girgias was looking at, so maybe he knows more
IMO until PHP comes out with its own official static analysis engine, there's still going to be a huge amount of things which become "it's psalms problem" and IMO if we can make it easier and more fluent to use in core, all the better
 
1 hour later…
22:07
What should the "callable" link redirect to on this page? php.net/manual/en/language.types.callable.php
The same page
The links are autogenerated from the <type>callable</type>
Normally other types should also link but that was broken at one point in PhD
@Crell that's annoying for local dev work. Having to run something in the background is one of the things that makes JS more annoying than PHP.
> we're back to "It's Psalm's problem", which is not the goal.
Meh. It probably moves it closer to being usable, and it could allow the whole conversation about syntax to happen outside of core, which both relieves work on core contributors and means it can iterate separately from core.
I'd ask you to explain how much experience you have with comparative environments, because IMO the working experience with something transpiled / analysed like TS or PHP + psalm is enormously more enjoyable than without.
@NikiC I can't see a page for the stub generation on phpinternalsbook.com - if I made one, should it be a page under 'Building PHP' or somewhere else?
@MarkR I think I get all the benefit from my IDE through autocomplete which works fine for both PHP and Preact/JSX stuff transpiled to JS.
There's a strong likelyhood I'd be able to save a bit of time using generic storage containers, rather than creating specific storage containers......but not sure it would be world altering.
I think if something as simple as array<Foo> was introduced natively, you'd see old version of PHP that didn't support it being abandoned reallllly quickly
22:19
@MarkR That's just preprocessing the thing in a specific way
Stars are usually bookmarks for me lol
@MarkR I've thought the same thing. Just start with a typed array
The complexity for typed arrays and full generics is the same soooo
Because the problem is inheritence and or how type coercions work
On top of the boxing
@CharlesSprayberry my understanding is that would be 90% of the work for 5% of the benefit.
@Girgias Complex type logic... sounds like it's right up your street
@MarkR Well, engine hell
22:24
btw, i'll offer a starting $1k at anyone (via the foundation) who wants to try tackling struct-like / TS Interface-like objects with a meaningful splat / clone + new property mechanism.
I <3 me readonly DTOs w/ constructor property promotion, but damn if create a new instance with a single changed value isn't fugly as hell (runtime reflection + array usually)
22:49
@MarkR I wonder if generic arrays could be an opportunity to fix the numeric string key coercion as well. E.g. an array<string,Foo> wouldn't coerce keys. Could be practicable as long as the type is explicitly specified.
I'm not sure what the internals are on that. I would assume that once generics came, list<T> and map<T> would come soon after
This would be really great
array is possibly one of those legacy things that might have to remain forever, but gradually be pushed out by other methods
Anyway, merry Platty Joob to all who celebrate it.
I like arrays though :D Having a native LinkedHashMap in the language is really great for many tasks. Fixing key the coercion problem and adding the list and map types as specializations of arrays would be perfect. And array shapes.
23:02
They're handy things, but changes to them are one of those super high risk things just because of how broken they were in the first place
What else if broken in arrays currently in your opinion?
The main thing is they do too much, have no typing, and many functions give them weird behaviour.
But they were the only thing we had

« first day (4249 days earlier)      last day (924 days later) »