« first day (1886 days earlier)      last day (3061 days later) » 

Abe
8:06 PM
what does _ex mean? i understand what the _ex functions do, but not the acronym :B
 
@Abe extended
basically a function doing the same, just with more params usually
 
And that is so much more helpful, I'm sure.
 
Abe
lol
yeah @bwoebi got that :D
surprisingly, i'm understanding something :D
what's the purpose of the "result" param in obj.handlers.do_operation callable?
 
@Abe That's where you write your result
 
@NikiC are you getting bitter and cynical like the rest of us, as you get older? :p
 
Abe
8:18 PM
hm, it looks it is accessed before it was even defined
 
@NikiC uhm, it's SUCCESS/FAILURE
not quite a result zval
 
Abe
no he is right, success failure is the return
 
@Leigh Of course. Such is the natural progression of things.
 
Abe
static int popov_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2)
{
    zval op1_copy;
    int retval;

    if (result == op1) {
        ZVAL_COPY_VALUE(&op1_copy, op1);
        op1 = &op1_copy;
    }
@NikiC don't flatter yourself, "popov" is short for Php OPerator OVerloading xD
 
 
8:23 PM
@Abe You likely don't need that piece of code. GMP needs it because it modifies result while it still uses op1. You probably only modify result after you no longer need op1
That's assuming you want to implement $x op= $x as $x = $x op $y at all -- you might want to provide explicit overloading for compound ops instead
 
Abe
hum ok
 
@Abe Of course it is :P
 
Abe
:P
so no need to call dtor, nothing? all automatic?
 
hmm… I want to code some PHP, but I have no idea what to do… :s
 
@bwoebi async websocket client
 
8:30 PM
Enough C for at least one week (well, except something urgent pops up…)
@Leigh I thought you were working on it?
 
oh, for php, not in php
 
@Leigh no, in PHP.
 
yea but you'll make something people will want to use, I'll make something good enough for my purposes :)
 
@Leigh have you already started?
 
Abe
@bwoebi got downgraded to abe levels?
 
8:31 PM
@Abe hmm?
 
Abe
a big project or small stuff? :D
 
I got as far as the frame parser then I went to the shop and got some beers
 
@bwoebi enums?
 
@LeviMorrison I said I've done enough C … need a break of a week.
 
Oh, I mis-interpreted. I thought you wanted a project that would last for one week.
 
8:32 PM
I'll look at them next week.
 
@LeviMorrison me too, "enough C, for one week" vs "enough C for one week"
 
oh…
 
Abe
macros don't have return right
 
sorry for the confusion :-D
 
not your fault at all :D
 
8:33 PM
@Abe They just expand.
 
Abe
ok slowing understanding them
 
@Leigh well, then…
 
Abe
also seems like they are uppercase most of the times
 
@bwoebi mine is for a personal project, I will make a minimal compliance, fuck-standards, just stream me the data kind of client
or give up half way and use node
 
okay, got it… Already starting :-)
 
8:35 PM
@Abe That is convention.
 
@bwoebi You did the WS stuff for Aerys right? So you already know the protocol. I'm about halfway through the RFC,
Looks like 90% should be the same between client and server
 
@Leigh I did the last rewrite of the WS stuff, yep… And reimplemented the whole websocket protocol in Generator, yeah.
 
Abe
static int popov_do_operation_ex(zend_uchar opcode, zval *result, zval *leftOperand, zval *rightOperand)
{
    switch (opcode) {
        case ZEND_ADD:
            zval *result = NULL;
            zend_call_method_with_1_params(leftOperand, Z_OBJCE_P(leftOperand), NULL, "sum", &result, rightOperand);
            // ???
        default:
            return FAILURE;
    }
}
does that look right? also, do i need to just return SUCCESS; after that?
 
popov_do_operation_ex, lol :-D
 
Abe
popov = Php OPerator OVerloading :B
happened accidentally
 
8:40 PM
@Abe I'm not sure if C folks use this convention, but lhs and rhs are often used for left-hand side and right-hand side in C++.
It's much shorter and since it's a convention I don't feel bad about using it.
 
@LeviMorrison We call them op1 and op2 ...
 
Abe
i'm not sure what that does yet, i just guessed that the two zval's were the two operands, and opcode the operator
 
@Abe Btw, never mind what I said about not needing the code. You need it after all ^^
 
I prefer levi's names... lhs and rhs instantly have meaning
 
Abe
@NikiC i know, trying to make the code more readable for myself :D
@NikiC aw
what i'm not getting is if(result == op1) when result is not defined yet :\
 
8:46 PM
not sure if it still exists, but some functions had a macro at the top that defined things like result
 
Anyone familiar with reactphp ? why writing to a stream when there is no connection to the server does not produce an error ?
 
@Abe result in that func is a param, so it exists..
 
Abe
@Leigh yes but it's not defined
 
wut? `static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2) /* {{{ *`

if the pointer to result is the pointer to op1 ..
 
Abe
ah damn it's pointers
wait, thinking :B
 
8:49 PM
@Leigh Then so long as the read from op1 occurs before writing the result, it shouldn't be a problem?
 
@Danack I wasn't asking, just explaining why result was usable in a comparison to Abe :)
 
oh.
 
Abe
so what that if does is creating a backup of op1
no. omg i understand it! indiana jones my ass. wanna know what's real adventure? writing a C program knowing nothing about C
 
The interesting question is why only op1 is backed up
GMP will probably crash if you try to do a $a += $a or somethin
or not crash, just do something stupid
 
Abe
i see :o
 
9:03 PM
I think a test I just wrote actually helped me understand what I had to do and resulted in more decoupled code. \o/
 
Abe
9:13 PM
how do i check if a zval implements something?
 
@Abe instanceof_function
 
Abe
checks if leftOperand is instance of Augend, if it is calls sum, otherwise calls the default do_operation
 
@Abe The default is probably a NULL pointer
 
Abe
so i need to call it only if it's set?
 
9:55 PM
@Abe It will never be set in the std handlers
 
Abe
so "object of class foo could not be converted to int" new foo() + 10 is not the default handler, that happens in a later moment
so if the interface Augend is not implemented and an ADD op is performed, should it just return failure?
 
maybe
probably you will have to reimplement default behavior though. Just try it ^^
 
Abe
okay
 
Looks like type and range inference just landed
 
@NikiC nice
so, tomorrow Dmitry is going to look at my patch…
I'm honestly amazed by what Dmitry is doing there… and so fast.
 
10:07 PM
@bwoebi I hope you don't think he wrote those 8k lines of code in two days ;)
 
@NikiC I do, because he did.
 
@bwoebi He's importing existing code (with renames and file splitups)
Code he worked on for something like a year
 
Ah, yeah. He's importing code from the JIT project, yes. But still, a lot of the code is rewritten too.
 
Can we like... not have a JIT?
Am I alone on that point?
 
I'm not saying he's written them from scratch, but still amazed at the speed he's warming the code up again.
 
10:10 PM
I'd like the default PHP engine to be simple...
 
@LeviMorrison nobody is going to add a JIT.
 
@LeviMorrison You've lost that battle about five minutes ago
 
It's just Optimizer analysis
(at least until now)
 
The currently landing and upcoming optimization code is nothing but simple
 
I guess I mean specifically native code generation.
Optimization stuff is... maybe okay still.
 
10:11 PM
@LeviMorrison yeah, that's JIT.
 
Well, technically JIT is "just in time" and should be postfixed with something :D
 
Our SSA format is pretty unfriendly to modification :(
I need about 100 lines of code just to rename an SSA var
 
@NikiC You should read up on Swift's format.
Maybe friendlier and could be helpful to us.
I know nothing about our SSA format, though. Haven't looked at it at all. I imagine it uses phi nodes and is somewhat traditional.
 
@LeviMorrison Yeah, traditional format, just complicated by a bunch of things
E.g. we do not have the luxury of a single def per ssa op
 
But swift does away with phi nodes.
Uses basic blocks for everything.
However... I don't know if PHP's semantics would allow that since {} doesn't make a new "block" except for functions.
Also, as per an email I just read we appear to have 3 failing test cases for sessions on master. Is that correct?
 
10:17 PM
@LeviMorrison yes. Yasuo.
 
@LeviMorrison Yasuo made a commit. That should explain everything.
 
Ah.
If I manage to scrape some time together over the holidays I may investigate porting PHP to use CMake again.
 
@LeviMorrison what's the exact benefit?
 
Firstly we don't have separate configurations for Linux and Windows.
Secondly it supports other back-ends. Ninja is much faster at parallel builds than gmake, for example.
 
but we'll probably still have some differences?
 
10:23 PM
Thirdly it allows easy integration with tools like XCode, Visual Studio, CLion, etc.
@bwoebi You mean Windows vs Linux or..? What do you mean differences?
 
yes, win vs. Linux
 
It's impossible to say for sure.
There are projects that do not need an OS or platform specific code or hacks using CMake.
Whether it's possible for our needs is uncertain.
We may always have differences - I don't know yet.
Another benefit is that CMake scripts are much easier to write and edit than the autotools stuff in my opinion.
 
@NikiC great idea (string offset checks)
 
At what stage are these checks happening?
 
they were happening redundantly, that was the issue.
 
10:30 PM
@bwoebi I was wondering if changing all these errors would be okay
 
Wait... those were purely redundant?
As in you only removed code (aside from the message you changed)?
 
@NikiC Changing the msg is okay, but the msg isn't informative enough
@NikiC I feel like "indirect modification" is just too vague… pass by ref is a modification? well, internally yes, but to the user? no.
 
@bwoebi Any ideas?
It's a term we use for similar situations and which seemed technically accurate
I don't like the existing messages of "cannot use string offset as array", because you sort of can ... you just can do it only at a single level of indirection
 
I know, but it'll confuse new users
@NikiC eih, you can do also $str[0][0], but not $str[] or $str[0][]
it's just about the new-element case
 
@bwoebi You can do $str[0][0] but not $str[0][0] =
 
10:37 PM
yes
 
But you can do $str[0] =
 
Basically you cannot indirectly modify, add or dereference string offsets
 
Why would anyone do "foobar"[0][0]?
 
@LeviMorrison no idea, lol
 
11:27 PM
@LeviMorrison If it's a variable, because you want the first char of the first item and accept both, a string and an array of strings. :P
 

« first day (1886 days earlier)      last day (3061 days later) »