« first day (1996 days earlier)      last day (2952 days later) » 

1:18 AM
Dear All,

Based on the concerns I wrote some tests. Can you check those and give feedback? Also, in ruby, $a ||= $b, the implementation is not equal to $a = $a || $b, but is equal to $a || $a = $b; I am a little bit confused, I am not entirely sure, but I guess this approach would solve our problems.

https://gist.github.com/midorikocak/abc9fd9b6ca30359d201bc859edba9ee

We can use these examples as the part of the new documentation and as a guideline for implementation tests. Can you add also any extreme cases that should raise errors to my test?
 
@MidoriKocak Consider cases involving ArrayAccess, __get, __set and __isset()
(with multiple dimensions eventually)
also, cases where the array we're operating on gets altered (via arrayaccess handler)
 
@bwoebi did you click the link?
and scroll downn
 
yes, I've seen… meant more convoluted ones … especially two dimensions of access
just one dimension is actually pretty "trivial"
@MidoriKocak but when we have to retain fetch state (which may be even altered in the handler) everything gets much more complicated
 
I am getting confused. Give some examples please.
 
class foo { public $ref; function &__get($x) { $this->ref = new class($this) { private $p; function __construct(&$p) { $this->p = &$p; } function __isset($x) { $this->p = new foo; return false; } function __get($x, $y) {} function __set($x, $y) { $this->$x = $y; } } return &$this->ref; } function __set($x, $y) { /* not called */ var_dump($x, $y); } function __isset($x) { return true; } }
$a = new foo;
$a->b->c ??= 2;
var_dump($a);
especially note the function __isset($x) { $this->p = new foo; return false; }
which alters the target during the second dimension __isset() fetch.
please … just tell me what the value of $a will be after that code @MidoriKocak
(there's a tiny parse error as semicolon forgotten, but just quickly typed it up)
and obviously it's not return &$this->ref with an & … but I hope you got the idea @MidoriKocak
 
1:40 AM
trying to indent thsi
this
 
yeah, turns out much more unreadable than I thought, sorry
 
<?php
class foo {
public $ref;
function &__get($x) {
$this->ref = new class($this) {
private $p;
function __construct(&$p) {
$this->p = &$p;
}
function __isset($x) {
$this->p = new foo;
return false;
}
function __get($x, $y) {

}
function __set($x, $y) {
$this->$x = $y;
}
} return &$this->ref;
}
function __set($x, $y) { /* not called */
var_dump($x, $y);
}
function __isset($x) {
return true;
}
}

$a = new foo;
$a->b->c ??= 2;
var_dump($a);
maybe gist world be better
 
true, will do next time
 
still trying to understand and it does not compile actually
PHP Fatal error: Method class@anonymous::__get() must take exactly 1 argument in php shell code on line 20

Fatal error: Method class@anonymous::__get() must take exactly 1 argument in php shell code on line 20
php >
php > $a = new Brainfuck;
PHP Warning: Uncaught Error: Class 'Brainfuck' not found in php shell code:1
Stack trace:
#0 {main}
thrown in php shell code on line 1

Warning: Uncaught Error: Class 'Brainfuck' not found in php shell code:1
Stack trace:
#0 {main}
thrown in php shell code on line 1
gist: c5325d19699254f6926af8eebdd1ee8a, 2016-04-03 01:53:31Z
<?php
class Brainfuck
{
    public $ref;

    function &__get($x) {

        $this->ref = new class($this) {

            private $p;

            function __construct(&$p) {
                $this->p = &$p;
            }

            function __isset($x) {
                $this->p = new Brainfuck;
                return false;
            }

            function __get($x, $y) {

            }
            function __set($x, $y) {
                $this->$x = $y;
            }
        };
        return $this->ref;
    }
    function __set($x, $y) { /* not called */
        var_dump($x, $y);
    }
    function __isset($x) {
        return true;
    }
}

$a = new Brainfuck;
$a->b->c = $a->b->c  ?? 2;
var_dump($a);
 
@MidoriKocak yeah, it was bit pseudo-codeish - remove the actual mistakes, then it should be fine (like __get just taking one param)
 
1:55 AM
ok now the result is
object(Brainfuck)#1 (1) {
["ref"]=>
object(class@anonymous)#3 (2) {
["p":"class@anonymous":private]=>
*RECURSION*
["c"]=>
int(2)
}
}
ph
 
@MidoriKocak interesting … it doesn't check __isset()?
 
the ruby way result is $a->b->c
object(Brainfuck)#1 (1) {
["ref"]=>
object(class@anonymous)#3 (2) {
["p":"class@anonymous":private]=>
*RECURSION*
["c"]=>
int(2)
}
}
 
IMHO, ??= should check __isset() though
 
??= is only a macro like thing translates into $a = $a ?? $b; or $a ?? $a = $b; I did not implement yet the implementation.
and I did not decide what to use.
 
and woops that like $this->ref = new class($this) { should be $this->ref = new class($this->ref) {
 
1:59 AM
but at ruby. $arrayAccessObject[0] with default return, is not assigned. $a[0] ||= 3 is still null
I still didn't get your concern.
 
basically, inside the isset() fetch the $this->ref gets altered
(via references)
 
I am feeling stupid
 
why?
 
I don't understand.
php 7 code returns above one with $a = $a ?? $b; and $a ?? $a = $b
 
well, ??= needs to first check for whether it's true or false … so it checks whether $a->b->c are all set. the __isset("c") of $a->b returns false. Now it needs to assign: it should call __set("c", 2) on the original $a->b instance.
I'm emphasizing the original because that's the semantics compound assign operations are usually having
 
2:06 AM
ah I got that now.
 
sorry for thinking code would be explanative enough
 
that was a concern at ruby implementation too.
can you give me feedback on this link? rubyinside.com/…
 
@MidoriKocak that's the ruby semantics … are you asking whether we should copy these semantics for PHP?
 
the only implementation existing in the world is that for now.
I think yes.
But I am still confused.
Why ??= can't be equal to $a = $a ?? $b; or $a ?? $a = $b; I don't understand really.
Can you enlighten me?
 
Wes
mornings
 
2:17 AM
well, it actually is $a ?? $a = $b; … the main point is that $a->b->c ??= $b; is not $a->b->c = $a->b->c ?? $b;, but rather isset($a->b) ? ( $_ = $a->b; $_->c ?? $_->c = $b ) : $a->b->c = $b;
 
Is this php?
 
@MidoriKocak note that $a->b is fetched only once for __isset() and __get(), not twice, like it would with the other behavior ($_ is denoting a temporary variable here)
 
so what is your proposition?
 
@MidoriKocak what do you mean?
 
my RFC was proposing exactly this. $a ??= $b equals $a = $a ?? $b or an alternative is $a ?? $a = $b; But you are saying something different. I did not understand your point. What do you advise?
 
2:24 AM
I'm saying we should avoid double fetches (of $a->b for example if we assign to $a->b->c)
 
isn't $a->b->c = 2 possible?
 
Anonymous
Oh, god no. First this and now $a->b->c = 2??
 
@MidoriKocak the problem is that this fetches b property again from $a and possibly calls __get() again, which it shouldn't.
 
$a = $a ?? $b and $a ?? $a = $b; does exactly that. Is it what you say, $arrayAccessObject['nonExistentKey'] that returns default, should not be assigned with $arrayAccessObject['nonExistentKey'] ??= 3, and still return null?
ruby avoids that.
 
@MidoriKocak Well, ruby doesn't specify in that rubyinside post what happens if property accesses execute code
possibly this isn't possible at all in ruby, I don't know?
Do they only have setters, but no getters or __isset() equivalent?
 
2:32 AM
I was checking github.com/ruby/spec.
but they have hashmaps with default values. if a hashmap has default value, $a ||= $b is not equal to $a = $a || $b;
similar logic as you say.
 
default values are static though
 
Did I understand correctly?
 
these don't execute code actually
 
you say that ??= should avoid to execute isset or get or set two times.
Is it right?
 
...
@MidoriKocak yes
 
2:35 AM
At least! I understood.
@samayo I proposed that.
But I am not sure what would be the correct behavior. $a += 3; will not be similar to $a ??= 3;
 
@MidoriKocak no?
 
But I would expect ??=, $a = $a ?? $b; or $a ?? $a = $b;
even $a += 3 is not really equal to $a = $a + 3; makes things complicated but anyway.
 
@MidoriKocak yes, it isn't and that's good that way. After all we just ask once for $a, and not twice.
 
But I'd think ??= as if(!isset($a)){$a = $b;}
so it will evaluate twice I think. Is it?
 
@MidoriKocak not evaluate twice … once it does an __isset() check and once a __get() fetch
 
2:42 AM
that's good.
 
As long as __get() and __isset() are both only called once, all is fine.
 
so the right behavior is that if I understand correctly.
same as $width = $imageData['width'] ?? 100; equals to $width = isset($imageData['width']) ? $imageData['width'] : 100;
 
that is true
the issue is really only when you do a two-dimensional fetch:
> $a->b->c ??= $b; is isset($a->b) ? ( $_ = $a->b; $_->c ?? $_->c = $b ) : $a->b->c = $b;
 
so you are fine with if(!isset($a)){$a = $b;}
why not if(!isset($a->b->c)){$a->b->c = 2} ?
 
You can do something like $a->$b->$c = 2 in php?
 
Wes
2:48 AM
@bwoebi why is that way?
 
@MidoriKocak because that __get() fetches $a->b twice (once inside the isset(), once inside the assignment)
@littlepootis yes.
 
should a little operator care about that?
 
@MidoriKocak yes.
(we have the same behavior for the other compound assignments)
 
$a->b->c += 3 ?
 
should fetch $a->b only once
yes
 
2:50 AM
calls get once?
 
calls __get once on $a, yes.
 
I understood.
 
Wes
@bwoebi finally managed to understand :B
 
@Wes same here. But I am not sure if it should be compatible with other compond operators or not. I did not dive into internals since last months but I probably am going to implement @bwoebi 's way. let's see.
 
@MidoriKocak I don't see a reason why we should make it inconsistent with the other assign ops
 
@MidoriKocak note that it should be $this->ref instead of $this on line 8 (was my mistake before)
 
ok corrected that.
 
Wes
anyone asked support for variable references yet? rofl
&$foo ??= &$bar;
 
that won't work
 
Wes
do other variable references work?
i heard they suck :P
 
2:57 AM
I think variable references should be deprecated too.
 
@MidoriKocak nah, they have their use …
 
do java have them?
I know they are used. :P
 
no, but they don't have arrays either. Everything is by-object there
 
Wes
@bwoebi i usually love you, but i also hate you for your infatuation for references
 
@Wes I just want PHP to be inherently consistent as far as it is possible.
 
Wes
3:00 AM
php will never get rid of them
 
@wes of course it will. it will also get rid of var too. :) If that would true, we were still using C for web development. and the Earth spins.
have a good day fellows. I am sleeping. 05:02 here. @bwoebi thank you so much for enlightening. see you soon.
 
@MidoriKocak same time here … good night ;-)
@MidoriKocak It won't get rid of references (I'll oppose! =D)
 
Wes
@MidoriKocak i could be likely dead when it will, though. PHP5 was 12 years ago
 
hehe
Well, at that time we'll probably have all quantum computers at home…
and then have no usage for something that primitive as PHP :-D
 
Wes
seriously though, can we guess when PHP8 will be released?
12 years is not reliable as time was lost in php6 which never happened
 
3:09 AM
@Wes ~3-5 years
 
@Wes Way before Perl 7
 
At least that would be when PHP 6 normally were released too if it hadn't failed
 
Wes
@littlepootis rofl
@bwoebi i think web moves fast. code evolves. i don't think it's absolutely necessary to have code capable to run for decades these days... in the past maybe
 
@Wes it still is… or at least with only minor modifications.
But you shouldn't have to spend hundreds of working hours to port a big project, ideally.
 
@Wes yet typeof null === 'object' is still true in js.
 
Wes
3:16 AM
js is... js
it's a different world, with 3 legged unicorns and people walking by hopping
 
At least we have a spec
Oh, I can't make that joke anymore
 
Wes
lol?
 
3:40 AM
moin
 
Wes
\o
 
mornin
 
$return = array();
include("someFile.php"); //can I append to $return within this file?
echo json_encode($return);
I can't remember if that's how php works. ColdFusion does it lol
 
Wes
someFile.php <?php return [1,2,3,4];
$return = array_merge($return, include("someFile.php"));
or you can simply add to $return as the included file scope is the same of the inclusion caller
 
aka as I typed it, $return is above the scope of the included file so it should work fine?
Your other suggestion may be a better option -- I'm not sure yet. I have about 100 freaking scripts I need to modify for this to work
 
Wes
3:48 AM
@SterlingArcher yes
 
If you don't mind I'd like to pick your brain on the matter.
 
why didn't you just try it ?
 
Wes
ill be happy to help if i can...
 
So right now this game has an inventory system that's ugly and static. I'm async'ing it. So as of right now, a GET request is sent to another page, which includes the item's ability file. The logic is done in there, then is echo'd out. I'm turning this item use script into an API so my front end model can simply XHR it and get the return message (error, text from use, etc).
Is my only route to modify each of these included files to return or append their results to my API's JSON return?
@JoeWatkins ^ that's why. And to be honest, I'm lazy lol (and sometimes just because it works, doesn't mean it's right)
 
XY
that sounds like a really horrible way to build an API ...
 
3:52 AM
@JoeWatkins moin
 
moin bob
 
Well, do you have a suggestion for a better way?
 
Wes
@SterlingArcher do you think it looks poor or you want to avoid modifying these files?
 
@SterlingArcher too lazy ...
 
Well aren't you a basket of kittens
@Wes mmm I'll do what I must to make it good. That's why I'm just trying to find the right way to go about this, given the crap code I'm working with
 
3:55 AM
@bwoebi NCE is a terrible mess ... we dropped the ball there ...
 
@JoeWatkins NCE is abbreviation for…?
 
tl;dr Inventory UI calls use. API gets a request for /item/use/(:itemID). The goal is to return the text in a nice JSON format (error or success). Each item's ability is in /includes/inventory and currently echo's the text out
 
null coalesce equal
 
@JoeWatkins I think it'll be a nice addition though
(not engine-wise… but for users)
 
Wes
i'd try to avoid polluting the scope with junk/temporary data, and at the same time i would avoid hardcoding a variable ($return) in all of these files. for instance you could do
 
3:58 AM
@bwoebi there's no working patch, there should have been no vote ... finding implementation problems after something has been voted in, for something we don't even have a patch for, is fucked ...
 
Wes
you can even not call the closure, so that you can parameterize the result from the outside
 
@JoeWatkins agree. I doubt though this is unimplementable. It just has some special semantics which need to be respected.
 
I think that's a good way. Unfortunately it means modifying 67 files :(
 
@bwoebi oh I doubt that too, but I need to see a patch, or a good description ... we have literally nothing ...
 
Thanks for the help Wes
 
Wes
4:00 AM
3v4l.org/2RLqK - 3v4l.org/iCeaM @SterlingArcher
 
@JoeWatkins I think we have quite a clear vision of the semantics though (at least I do, I think)
 
Wes
how these files look right now?
 
you think !! that's exactly the problem ...
 
@JoeWatkins but only code will be able to actually describe all the semantics.
 
@Wes I don't think I'll need to return an array, but the concept is perfect
 
4:02 AM
yeah but at least a good description is better than what we have now ... absolutely nothing ...
I would have needed to see a patch anyway ... that the vote went ahead is baffling ...
@SterlingArcher when I asked you why didn't you try it, you said "I'm lazy lol" ... the lol doesn't make what you said funny, as far as I can tell, the actual reason you didn't try for yourself, is that you are actually lazy ... I am in fact, a basket of kittens ...
 
Your retort was still rude when I was just trying to ask a question.
 
@JoeWatkins yeah, most voters actually aren't actual core contributors which would care too much about impl
 
@bwoebi but they were given the impression that there was a patch, as far as they could tell, it was ready ...
disappoint in everyone who knew better ... I don't understand the rush, not like we're coming up to any deadlines or anything ...
 
@JoeWatkins You could present them any patch and they'll still vote yes
Seriously, it's not like we would really vote on the patch...
Officially, we do…
 
@SterlingArcher rude is asking perfect strangers on the internet to do your work for you because you are too lazy ...
 
4:10 AM
but most people don't actually respect the patch when voting
 
lol you say that like I asked you to write my entire API, when I just asked if including files could modify a variable defined above the include statement
 
I vote on patches, I don't blame people who don't, but, those people who do should ensure that no vote goes ahead while there is no suitable patch ... those people who don't/can't vote on patches [have to] trust the judgement of those people who can/do ... we can't be finding problems with implementations we don't have, that's a stupid situation to be in ...
 
I get it, I could have googled it, but you're being incredibly high and mighty for a minor inconvenience
 
@JoeWatkins How can we ensure so? We're far too few.
 
by speaking up, when the vote was started, all of us should have emailed internals and just said STAPH ...
 
4:13 AM
@JoeWatkins I still think we should vote on semantics in a primary vote (okay, they were missing too to some extent from this RFC…) and then having an informal consensus on whether the patch is fine amongst core devs
 
@bwoebi if they weren't missing, fine ... but they were ... and I don't want a process where everything needs two votes, or it's normal to have two votes even if not required ... or a feature can be voted in, and then internals can drag their heels for months finding a suitable implementation ...
 
@JoeWatkins not two votes, one vote and one informal consensus.
(Basically: if anyone has objections, no merge until the problems are solved… that's basically what also happens right now)
 
I just don't think that can work in the general case, a lot of the time you need the opinion of people who do not approve of the feature
 
@JoeWatkins for the general vote, sure.
 
@SterlingArcher try empathy ... that it was so easy to find out the answer to your question for yourself makes it worse from my point of view ... if it was something hard, I wouldn't be surprised you hadn't tried it for yourself ...
 
4:22 AM
> "(and sometimes just because it works, doesn't mean it's right)"
 
do you know what XY means ?
 
Sure, did you see what you responded with when I asked how I could better ask?
 
!!urban xy
 
[ xy ] a popular magazine aimed towards gay males aged 15-28 years of age.
 
4:23 AM
Ha!
 
@SterlingArcher no, I didn't see that ...
dude, chill out, give your brain a chance ...
if you had tried for yourself, you would have only been left with the sensible question you asked, the actual problem you have ...
 
If I had tried myself, it would have worked (again, i get it), and I wouldn't have learned that it wasn't a good way to do it
 
no but you would have only been left with the question "even though this works, is it okay?" ... which is perfectly good question ...
 
Which it came to within a matter of what.. 60 seconds?
 
I'm not saying don't ask questions, I'm saying don't ask questions you can and should answer for yourself ...
 
4:27 AM
Which is fine, but maybe next time word it a little less condescendingly
 
really ? if I had said "you can and should answer that for yourself" that would have been easier to swallow ?
c'mon ...
why do you think I'm talking to you at all right now ?
it isn't to argue ...
 
I'm a room owner in the JS room man. People tell me that everyday
 
Guys, Calm Down :P
 
Well... not everyday lol but you get my point
 
tell you what ?
 
4:31 AM
If something is easy to figure out via the docs or a google search
It's an easy pill to swallow if it's dished out nice enough
 
you want dinner, a movie, and a reach-around with it too?
 
lol
 
Ok, but I prefer the reaching
But Joe is buying dinner >:(
 
I didn't know I was required to be nice ... I wasn't being condescending ...
 
Well, for what it's worth, sorry Joe
 
4:34 AM
it's much easier not to care, I was trying to teach you a lesson, but now, that sounds condescending ... but that's genuinely what I was doing ...
 
might have worked better ... who knows if it would have discouraged you from continuing to talk and explain the real problem ...
 
tbh (sadly) it probably would have worked (I assume we're talking about the meme?)
 
yeah
 
totes would have worked
 
4:39 AM
that meme ain't even right here though - there's no need to google it either, just friggin' try it
it's so goddamn easy to just try shit
 
beating a dead horse there Paul
 
I do keep saying try it ... but RTFM, try it, DIY, all same, put some effort in ...
I wouldn't have guess that would work ...
Hi, I'm Joe ... I am a C programmer, I have a deep and abiding knowledge of void pointers, and triple indirection, and no fucking clue how other humans work.
7
 
People underestimate the power of dank memes
 
@SterlingArcher if the horse is still talking it ain't dead
 
If the horse is talking, stop beating it because you've just found a freaking talking horse
 
4:42 AM
it talks out the wrong end though
 
ffs dude how many times do I have to say I get it
 
this is gonna sound a bit out there ... but maybe if talking isn't working, you should think about expressing yourself through the medium of ... interpretive dance ?
just an idea :D
 
5:01 AM
@JoeWatkins hey. I'm a dark wizard having fun with using custom memory managers inside signal handlers and intentionally triggering SIGSEGVs with well-placed mprotect() syscalls. And having an idea how harmless Joe actually is.
6
 
'n
 
@bwoebi hehe ... why you engaging in such dark wizardry ?
 
@JoeWatkins ya know… phpdbg ;-)
 
ah right
that shit is so scary ...
 
5:05 AM
@JoeWatkins I'll have to rewrite that thing properly…
 
super clever ... but scary ...
 
at least the watchers
 
it's sometimes a bit strange ...
 
they don't work actually half of the more complicated times
the idea is fine, but things break … need to control invariants much more extensively
 
BTW, according to ya'll, what is the most scary thing in php's source ?
 
5:07 AM
the code ?
 
yea
 
no, I think he means the code
 
he does mean that ...
but ...
broken down into small enough chunks, none of it is scary ...
some of it is even quite clever now ...
 
@JoeWatkins may I vote for Opcache? (the shared memory handling)
 
oh except for opcache, that's clever and scary
yeah
oh I get that ...
 
5:09 AM
:P
 
it's the rest of it I don't get ...
well I do, but have to read very very slowly, 5 times ...
 
@JoeWatkins well, then you get what I don't get and the inverse :-D
 
and then ask someone else, because not quite sure ...
@bwoebi as a team, we understand it ... good enough :D
 
@JoeWatkins hehe
 
posted on April 03, 2016

New Cyanide and Happiness Comic

 
5:15 AM
if we can vote for stuff that isn't core yet, but is likely going to be in some form in the future this deserves a vote ... or a handful of votes, really big ones ...
 
@JoeWatkins I wouldn't do a vote about that … it's way to early now.
 
I mean vote for as "scariest stuff in php"
 
@JoeWatkins oh. yes. or not yes.
well… depends pretty much on the implementation then.
 
at the moment it's scary ... if php binds to llvm, life won't be worth living any more ...
 
!!xkcd php
 
@JoeWatkins Depends on how things are done by then … possibly we'll just call a bunch of functions and llvm will do all the magic constant propagation for us
Aren't you seeing what we're doing currently with ADD_INT_INT opcodes in vm_execute.h?
 
yeah seen
have you ever tried to work with llvm ?
 
I definitely don't want to reimplement the actual VM in LLVM code
@JoeWatkins no.
 
it changes every five minutes ... I don't think versions mean much there, even before you've got anything complicated, you have to deal with really stupid differences in the API between versions, it's a nightmare by itself ... and then there's just the massive complexity of the API, and I mean massive complexity ...
 
@JoeWatkins yeah, I'm a strong proponent of having only a minimal coupling layer
 
5:22 AM
even that is difficult, codegen api changes too, things like the name of basicblock has even changed in the past ...
 
If we'll have to do that much llvm coupling as in the zend_jit project, I'll probably reject it.
 
I don't know how reasonable it is to suggest we homegrow something ...
 
@JoeWatkins nah, not homegrow… llvm with a much smaller coupling layer
I want to be able to leave it alone for most part
 
hhvm has their own codegen ...
 
@JoeWatkins would you want to work on it…?
 
5:26 AM
I would rather work on that than work with LLVM ...
 
_ Unfortunately the maintenance burden has grown too large_ … yeah totally
 
because they never stop changing ...
I'd rather home grow something stable, a lot of the code we have already can be reused ... sharing stuff, inference stuff, optimization stuff ... maybe not reused verbatim, but at the very least the knowledge is in principle useful ...
 
@JoeWatkins right
 
still I don't know if collectively we have the expertise ... if we don't we should go looking for them ... and I think, we probably do ...
we only need to support two platforms ...
experts in other platforms, embedded or strange ones, will emerge if there is demand for that ...
 
@JoeWatkins Dmitry is the master … Perhaps by that time we'll have the necessary typing in PHP to make that viable for PHP 8.0
but we still have 3 years time I guess, before the next quantum hop
 
5:33 AM
simple instructions are simple, I've looked a little bit into that when playing with libjit (it's not finished) ... it does get super complex and I don't understand all of it, but probably between us it's not a totally unreasonable suggestion, at least it's more reasonable than binding to llvm ...
 
@JoeWatkins if we find ways to end up just having to do constant propagation, our coupling layer may end up small enough to actually properly support multiple backends
 
I'm not sure there is much point in multiple backends ... llvm is the best that there is, in terms of complete frameworks ... and it's not usable for us ... we have special requirements of our implementation that nothing is going to emerge to support by accident, I don't think ...
 
Wes
@bwoebi i forgot to answer this. perpetuating bad things just for consistency's sake is bad, imho
 
@Wes totally agree. But references per se aren't bad.
 
compiling code is really quite expensive, however you do it, and, the processing models where PHP is used means that you have to multiply that expense by some very high number (number of distinct processes across all servers) ... also, the nature of the code we want to compile is such that the code compiled is rather complex, so that even though HHVM has a JIT, there is no benefit in the real world ... we need to find some smarter way to do it ...
 
Wes
5:42 AM
but references have nearly zero uses, and the code for allowing them to exist is huge (you guys' words, not mine)
 
@JoeWatkins right, but we can quite efficiently cache it though…
there's benefit in real world, but really only when you can specialize nearly everything away
which we need types and more types for.
 
well ...
 
Also, they had a tracing jit where the gain pretty much got lost by the tracing overhead
It's all about static analysis
 
I know it's a tracing jit, but that can mean many things ... I'm not quite sure how it works ... I would guess that it only attempts to compile a whole function if tracing and inference can provide enough information to compile the function entirely ?
zends jit does focus on compiling whole functions (or op arrays) ...
 
don't know.
The goal is whole project compilation, not just on per file basis though … we first need to solve these issues
to have possibly efficient inlining of getters and such things
which commonly steal a lot of time
 
5:51 AM
yes of course, but the unit of compilation matters, because this changes the cost, the way it's spread out across all servers ...
 
@JoeWatkins hmm?
 
organizing words
a complicated function is more complex to compile than it's individual statements if those statements were functions themselves, because of how inference and compilation works, that's always true ...
 
@JoeWatkins true… … at least functions will typically be type-guarded (return type, input types)
 
you can still have the goal of whole project compilation while considering the unit of compilation to be an individual instruction, rather than a function ... does that make sense ?
 
yeah
 

« first day (1996 days earlier)      last day (2952 days later) »