« first day (3413 days earlier)      last day (1521 days later) » 
00:00 - 15:0015:00 - 23:00

12:17 AM
@Ekin Now only if someone could tell me what /root stands for 🤔
 
1:12 AM
"root root"
 
 
1 hour later…
2:23 AM
o/
 
3:19 AM
\o
 
3:43 AM
\o/
 
4:02 AM
@Alesana I haven't heard from him either. Let me know if you hear anything.
 
 
1 hour later…
5:06 AM
WAAT? Docker for Windows doesn't work if you have the Razer Synapse driver management tool running. Because they both do mutexes wrong (in the same exact way). And get this... the reason is they both apparently copy/pasted code from StackOverflow that was wrong.
TIL
 
that's funny
 
It's good to know the kind of effect SO actually has on real world production software. If we get this stuff wrong... shit breaks yo!
 
 
2 hours later…
6:43 AM
morning
// auto currying
$imploder = implode ','; // fn(array $x) => implode(',', $x);
echo $imploder(['foo', 'bar']); // 'foo.bar'

// partial function
$htmlentities = htmlentities(?, ENT_HTML5); // fn(string $x) => htmlentities($x, ENT_HTML5);
echo $htmlentities('§'); // '§'
Would it be possible to implement it for PHP?
 
7:02 AM
With partial function and currying, it could also be possible to combine them:
// currying partial function
$substr = substr(?, ?, 3) 'fooooofooooo'; // fn (int $start) => (fn(string $string, int $start) => substr($string, $start, 3))('fooooofooooo', $start);
echo $substr(6); // 'foo'
Does that make sense?
All the above examples with curry and partial function result in Parse error: syntax error currently in PHP
It is much cleaner than solution with fn() => (fn() => something)()
Saw some libraries on Packagist which tries to do that in userland with some incompatibilities to Currying cause they don't transform a function into single argument function and allow to pass multiple arguments for the curried function, their usage looks little awkward and partial function creation requires to pass a positional array of defined args.
That requires some assumptions like function with optional arguments cannot be curried meaning it would require to be combined with partial function to get rid of optional params.
Ohh crap I made a mistake cause there are two implode signatures: implode(string $glue, array $pieces): string and implode(array $pieces): string
 
7:43 AM
Thinking more of partial functions to allow a smooth way of handling different order of args partial function could possibly allow passing positional placeholders like strstr(?1, ?0, true)
$substrBefore = strstr(?1, ?0, true);
// fn($needle, string $haystack) => strstr($haystack, $needle, true);
$substrBeforeAt = $substrBefore '@';
// fn(string $haystack) => $substrBefore('@', $haystack);
echo $substrBeforeAt('john.doe@example.com'); // john.doe
 
TBH … where is that fine line between conciseness and readability?
But I'm not opposed
 
IMO it's hard to read embedded fn() into fn()
And I haven't found an RFC like that in past
I can imagine only that it's not a trivial task to implement it
Can imagine some sort of optimisations when currying is used to reuse some stack frames with passed args to reuse them for next apply - but also not sure if I know what I'm talking about now, please be aware
If someone asks me why?
I think that functional programming in PHP could benefit of that a little more than now cause we mostly improve object-oriented paradigms
One thing I don't know is how could uncurrying be even possible and if it should ship with currying?
 
8:08 AM
@brzuchal it's trivial to implement it in a non-optimized way :-D
@brzuchal I sort of like the concept of having different syntaxes for curry and apply - curry without parens and apply with
 
@PeeHaa nope
 
@bwoebi Yes, they should have different syntaxes the one without parens is borrowed from F#
@bwoebi IMO that's the only way to provide auto-currying of functions which already exists and doesn't require any changes to function declarations like in Scala where function is declared with signature which divides each argument in separate parens, like def add2(a: Int) (b: Int) = a + b;
@bwoebi how about partial function? I used ? cause _ cannot be used cause of already valid function name used in gettext. Positional placeholders is something I haven't saw anywhere but it could possibly benefit
 
8:30 AM
@brzuchal I propose $0, $1
(or just $ if we want a shorthand)
 
@bwoebi Ok, possible... how would you define for eg DateTime formatter? $->format($); would it even make sense?
 
@brzuchal this is just plain weird
at that point fn($date, $fmt) => $date->format($fmt) is much more expressive
 
@bwoebi Could agree cause anything what I could possibly think of is:
$dates = [new DateTime('now'), new DateTime('yesterday'), new DateTime('tomorrow')];
$formatter = $1->format($0);
$atomDateFormatter = $formatter DateTime::ATOM;
$atomDatesFormatter = array_map $atomDateFormatter;
$formatedDates = $atomDatesFormatter($dates);
But replacing $formatter with fn($format, $date) => $date->format($format); should work then
 
8:47 AM
One thing which limits functionality is that when currying parens cannot be used
$atomDatesFormatter = array_map ($formatter DateTime::ATOM);
Cause spaces are allowed after function name
 
9:02 AM
@NikiC The script that communicated Git commits to the list interpreted Fixes OSS-Fuzz #20782 wrong and created a link to bugs.php.net/bug.php?id=20782 ;)
 
@SebastianBergmann When reading your mail I just could think "oh man"
 
@SebastianBergmann heh. no idea where those mails are generated ^^
 
9:19 AM
there is an extension named wapplyzer which determines even the backend language of websites (like PHP, ASP etc) .. how does it detect?
 
@Shafizadeh probably using headers to detect and some common urls to detect for eg. WordPress
@Shafizadeh search for PHP in github.com/AliasIO/wappalyzer/blob/master/src/apps.json you'll get on what
 
@NikiC I tried to address your comments from yesterday: wiki.php.net/rfc/write_once_properties WDYT now?
 
9:38 AM
Thanks @brzuchal
 
@bwoebi And I spared you all the juicy details. :-/
 
@bwoebi @SebastianBergmann don't leave people hanging here
 
@NikiC In the karma repo, specifically Git\PostReceiveHook generates the email.
 
I am fascinated by the fact how many words I am able to write about a single line of code.
 
hahaha
 
9:42 AM
@salathe Thanks, looks like github.com/php/karma/blob/master/lib/Git/… is the magic regex
 
@SebastianBergmann Which line and which words?
 
@NikiC bingo
 
@NikiC I am working on an article (hence: lots of words) that I hope to publish soon.
It's the story behind the remote code execution vulnerability in PHPUnit.
Which got a lot of attention recently.
And almost got me into legal trouble back in 2017.
 
let me guess
 
That potential legal trouble is the motivation behind twitter.com/s_bergmann/status/1180802441945567232
 
9:47 AM
there was an eval() in some piece of code and someone reported that as a remote code execution """vulnerability"""
 
The problem here is that many standard solutions bundle a Composer-managed vendor folder with their releases and tell their users to upload everything to the document root of their shared host.
That porn spam problem on GitHub gets worse every day.
Well, not really. One spam ticket per day. But it annoys me more and more every day.
 
It's just funny that I fixed that without realizing the impact
 
You only fixed it for webserver contexts where CGI/FastCGI are not used.
 
@bwoebi would it make sense to chain currying? I mean create curried function with curried function?
$dateStrings = ['2020-02-19T10:47:58+01:00', '2020-02-18T00:00:00+01:00', '2020-02-20T00:00:00+01:00'];
$atomDatesConverter = array_map DateTime::createFromFormat DateTime::ATOM;
// fn(array ...$array) => array_map(fn(string $time) => DateTime::createFromFormat(DateTime::ATOM, $time), ...$array);
$convertedDates = $atomDatesConverter($dateStrings);
 
@brzuchal yes, obviously, just like normal functional languages do
 
9:58 AM
In above example DateTime::createFromFormat DateTime::ATOM is curried function which is passed to array_map and creating curried function
Cool
 
@brzuchal array_map DateTime::createFromFormat DateTime::ATOM is just shorthand for (array_map DateTime::createFromFormat) DateTime::ATOM
 
$convertedDates = (array_map DateTime::createFromFormat DateTime::ATOM)($dateStrings);
Should it be allowed like that?
 
what is wrong with you
 
i.e. you always curry one arg at a time
 
pleeeeeease don't do whitespace-based currying
 
10:00 AM
and multiple args are sugar
 
Yes, always one
 
@NikiC open for suggestions
 
@NikiC any suggestions, instead of...
@NikiC F# uses white space for eg.
 
White space is trivially ambiguous
foo +1 or foo + 1
 
not much left on my keyboard free to use
 
10:01 AM
You want array_map($callback, ...) or so
Or array_filter($$, $callback) or array_filter(?, $callback) or something
 
@NikiC No that's a partial function, not curried
 
@brzuchal where's the difference here?
 
@brzuchal Those are exactly the same thing
 
Partial function defines placeholders one or more when currying always produces function which accepts only once each time when curried
 
@brzuchal yes?
where does that make a difference?
 
10:09 AM
Also something on F# which I cannot find now
 
Yes, you read something, but you did not understand the relevance
The only part that is useful in PHP is partial function application
Currying only makes sense if either all functions are curried, or you specifically write curried functions, but it does not make sense as the language feature you are suggesting.
 
According to en.wikipedia.org/wiki/Currying it's not the same
> Currying is related to, but not the same as partial application. In practice, the programming technique of closures can be used to perform partial application and a kind of currying, by hiding arguments in an environment that travels with the curried function.
It is possible that I didn't understand something - tried my bests
@NikiC why currying doesn't make sense as a language feature for PHP?
 
@brzuchal Sorry, I shouldn't have said that they are the same. But the feature you are describing is partial function application, not currying.
I guess the currying variant would be curry($fn)($arg)($arg2)($arg3), which I'm pretty sure is not what you want
You just want to bind arguments
 
That's exactly what I wanted
but without explicit curry() call and with one argument at a time
 
...
The curry() part is the currying. If you do one argument at a time you're back to partial function application, no?
 
10:18 AM
Yes, but partial function can have more than one placeholder therefore I cannot feed it with first arg and pass over without creating partial application from it first, right?
 
@brzuchal You could do func($firstArg, ...)
It's just a matter of syntax
 
That's a partial application substr($, $, 3); if I get it as an input and wanna feed it with 'fooooofooooo' I have to create another partial function with new placeholder
 
@brzuchal $requiresOffsetNow = substr($, $, 3)("foo", ...);
we can discuss about having another syntax for the (, ...) part
if it turns out to be too clumsy
 
$substrBefore = strstr($1, $0, true); // partial-application
$substrBeforeAt = $substrBefore '@'; // curried
echo $substrBeforeAt('john.doe@example.com'); // john.doe
If I have a function which takes a $substrBefore and returns a $substrBeforeAt it should be then
...
 
$substrBeforeAt = $substrBefore('@', ...); is exactly equivalent
 
10:25 AM
$substrBeforeAt = $substrBefore('@', $);
$ or ... ?
 
currying is nothing else than partial application with an arbitrary amount of trailing parameters
@brzuchal the ellipsis means arbitrary amount of parameters; $ means a single param
 
ok
$dateStrings = ['2020-02-19T10:47:58+01:00', '2020-02-18T00:00:00+01:00', '2020-02-20T00:00:00+01:00'];
$atomDatesConverter = array_map(DateTime::createFromFormat(DateTime::ATOM, $), ...);
// fn(array ...$array) => array_map(fn(string $time) => DateTime::createFromFormat(DateTime::ATOM, $time), ...$array);
$convertedDates = $atomDatesConverter($dateStrings);
Like that ^^ ?
 
I think that code isn't particularly readable to the lesser gods...
 
function atomDatesConverter(): callable {
    return array_map(DateTime::createFromFormat(DateTime::ATOM, $), ...);
}
// equivalent
function atomDatesConverter(): callable {
    return fn(array ...$array) => array_map(fn(string $time) => DateTime::createFromFormat(DateTime::ATOM, $time), ...$array);
}
Better?
 
what does the stray dollar sign do ?
 
10:31 AM
@Code4R7 It's a placeholder - partial-application
 
ah, ok. Naturally, I prefer the first syntax if it's all the same
 
Yep, the same
 
although it does seem a bit complex for a function that only converts some dates.
 
@brzuchal any special reason why you prefer DateTime::createFromFormat() over new DateTimeImmutable()?
 
@heiglandreas Yes, short examples ;)
Oh, why static method instead of instantiation... I thought DateTime vs. DateTimeImmutable
 
10:35 AM
Well...

new DateTimeImmutable($time);
DateTime::createFromFormat(DateTime::ATOM, $time);
 
@heiglandreas I used static method as an example where I can feed it with ATOM format first and create a partial-applicaiton from it
 
I wrote a partial application handler yonks ago in native PHP, when binding the function instead of $$ I just passed it a new Bound() and then it returned an object with __call which only accepted <x> number of args and replaced the bound parameters with it before using the underlying callable
 
@MarkR Sure, there are some libs on Packagist also
 
The problem with it was, functions and methods are not first class citizens in the variable space
 
@heiglandreas you need to pass callable to array_map that's why used partial-application created from static method
 
10:38 AM
which has plagued PHP since... forever
 
I don't know if that makes sense to create a partial-application from new construct
 
Even if you didn't use new, it'd still be creating a new object internally.
 
@brzuchal Yeah! Makes sense!
 
@MarkR Yes, treat it for example purposes only
 
10:40 AM
@MarkR That's why I'm in the end usually use the new approach...
But in this case I see the reasoning now ;-) Thanks!
 
I have a bash command. It's a one liner. It checks the current go version and prints whether or not it is at a minimum value. Works flawlessly when I run it in terminal.
if [ $(ver 1.11.0) -lt $(ver $(go version | awk '{print $3}' | sed s/go//g)) ]; then echo "Go is installed"; else >&2 echo "Go version lower than 1.13 or not found"; fi
When I put this under a makefile target, it always prints the first one. What gives?
 
@brzuchal I do! Sadly very often people copy stuff from examples on the internet and use them as-is.... StackOverflow development.... :grin:
 
@heiglandreas Agree
@NikiC @bwoebi If I would like to feed array_merge in few steps without additionaly creating partial function over and over currying would help, right?
 
now that we have typed properties, shsould json_decode be able to "decode" to a specific type. obviously would not "propagate" types across the declaration of an array.
i love go's unmarshalling, but they have "annotations" to control the process.
 
Not sure what you mean by json_decode to a specific type, the type itself is part of the JSON spec, no?
 
10:46 AM
i mean class Foo { public Bar $bar; } class Bar { public int $baz; } + {"bar": {"baz": 1}} + json_decode($payload, Foo::class);
return value of json_decode instanceof Foo
 
// with currying
$feed = array_merge ['foo'];
$feed = $feed ['bar'];
$feed = $feed ['baz'];
$feed(); // array_merge(['foo'], ['bar'], ['baz']);
// with partial_application
$feed = array_merge(['foo'], ...);
$feed = $feed(['bar'], ...);
$feed = $feed(['baz'], ...); // <-- here is the place where I need to know that it's the last feeding
$feed(); // array_merge(['foo'], ['bar'], ['baz']);
 
cmb
@beberlei too dangerous?
 
I solved it, I'm a retard. Thanks rubber duckies!
 
@cmb why? If the class is explicitly mentioned
 
cmb
ah, whitelisting would be okay
 
10:49 AM
@bwoebi with above example I need to know when to stop feeding using partial-application concept, right? Cause I need to know when stop creating partials of partials
 
@brzuchal well, if you do not pass ", ...", then it's an invocation
 
Actually no I didn't, same error still :(
 
@bwoebi and if I do then need to call $feed([]) with empty array at the end, right?
 
@cmb yes it would be based on a whitelist same as unserialize, at least the starting point is known, then all other types are inferred from there
 
@brzuchal so $feed(['baz']) and $feed = $feed(['baz'], ...); $feed(); are giving you the same result
@brzuchal no, why? you just add no extra params
 
10:52 AM
so if I understand correctly, currying is done using the ... -syntax, meaning one line of code does not behave like normal, instead its functioning depends on the next line(s) ?
 
I assume that using userland reflection would be too slow for your use-case @beberlei?
 
@MarkR there is already symfony/serializer and jms/serializer, but they do json_decode + then traverse the whole document. If a solution existed that only needs to traverse the document once it would be nicer, especially since this kidn of code benefits from C vs PHP
i need to revive annotations before doing this i believe :)
 
Not sure I follow by traversing once, why would it need to traverse more than once?
 
json_decode already traverses the whole payload/document
 
cmb
@NikiC, re github.com/php/php-src/commit/…: wouldn't that need to take into account the input byte order as well as the float/double byte order of the decoding machine? See bugs.php.net/bug.php?id=79279
 
10:58 AM
@bwoebi I'm just trying to see if those concepts differ or should differ
 
@cmb that commit should not change anything about byte order interpretation, it only fixes alignment violations
Byte order is probably wrong though, yeah
 
@beberlei a native incremental JSON decoder is a sorely needed thing
 
I don't have any BE hardware to test tho
 
cmb
@NikiC me neither, but it seems that issue is more complex than just taking into account the byte order of the machine. Apparently, IEEE 754 representation can differ.
 
@bwoebi given that $feed = array_merge(['foo'], ...); invoking $feed(); should accept that you no longer pass any extra args, right? It'll work for array_merge([array $...]) but for eg. array_diff(array $array1, array $array2 [, array $... ]) requires at least two arguments
 
11:04 AM
@brzuchal yes, then obviously that call will fail with an exception
 
And partial-application for array_diff would look the same array_diff($, ...)
 
yeah
 
This would be ambigous the use of ...IMO should require at least one argument at that placeholder
Where currying IMO should create lamba each time accepting one argument untill required arguments are fulfilled
I don't like to question everything just am stubborn untill there are no arguments to discuss
 
o/
 
11:09 AM
\o
 
o/
 
cmb
\o
 
@bwoebi given above I think that ... should be allowed to be used in place where only optional arguments may appear, meaning $partial = array_diff($, $, ...) and $partial = array_merge(...) could be possible
 
@brzuchal sure it should
"..." just means 0 or more args
 
Ok, I'll start drafting some RFC.
 
11:15 AM
and array_diff($, $, ...) == array_diff($, ...) == array_diff(...)
 
I really hoped this could be two different things
@bwoebi php.net/manual/en/function.array-diff.php requires at least two args so I think array_diff($, $, ...) is the only option there
 
@brzuchal well, the constraint is merged
... means zero or more, array_diff requires two or more, so the constraint is 2 or more
 
so it requires at least two $ placeholders, right?
 
@bwoebi I didn't get your point
Which one do you disagree with?
 
> Pro (dev-perspecitve): The bar for including changes in editions is lower, because there is no requirement that all code eventually updates to them. This allows including changes that legacy programmers are categorically opposed to.
 
11:18 AM
There's been a decent amount of RFC drafting for this already. Let me find the link.
 
@bwoebi Okay, what do you disagree with there?
I think it's a point of fact. And to be clear, "dev-perspective" here means "internals-perspective"
What I mean there is that if editions are not supported forever, then we will have to push harder to make changes in editions, against the PHP internals legacy inertia
Do you disagree with that?
 
@NikiC That it lowers the bar. People being on legacy editions don't really want to have to stay on the oldest edition just because the newest edition changes something they don't like.
 
@bwoebi Ah, I get what you mean now
 
If we had individual declare options, then I'd agree
 
@bwoebi That sounds like a general "editions" vs "fine-grained declares" problem though
 
11:21 AM
but we don't want that either :-
 
that
So what do we want? :P
 
editions obviously, with temporary support :-P
 
For the "but ma php 3.2 compatibility!!!" people to piss off? >_>
 
@bwoebi But if we can't do something like "strict operators" in an edition, what's the point?
Okay, I guess we can still do other stuff :P
 
@NikiC we can do it, but then it'll affect all strict types users
 
11:23 AM
Which brings me back to the idea that we can keep edition + strict_types separate, and strict_types gets "stricter" on new editions
 
@NikiC I'm fine with that
 
@LeviMorrison I was looking at RFC list today and couldn't find it, will take a look
 
@LeviMorrison That was pretty nice
 
Was it already discussed?
 
11:27 AM
IIRC the main uncertainty there was that trailing ? and ... are basically the same
@brzuchal I don't think it was discussed on list
Just in here
 
 
1 hour later…
12:57 PM
@NikiC so it would be better if extra arguments require a $ placeholder and trailing arguments could use ... explicitly if required, yes? and there would be no uncertainty any more?
 
1:17 PM
Woot, just've implemented userland solution to make volatile variables that can survive request boundary ) Now I can escape from #sharenothing castle of PHP. Next step is to keep objects between requests.. #shareeverything #excited
This is half a step towards to native userland extensions...
 
O rly
Being able to cache outside of needing to serialize would be a game-changer, it's part of what made swoole so incredibly powerful for me
 
Yes, this should give your access to persistent objects and values
 
I'd be interested in taking a look at that at some point... so long as it's not under that dodgy license :D
 
Ugh ))
I want to protect only core library, but any derivative projects can have premium license for free
and distributed under MIT or whatever else
 
Not sure how that would work if you need the core library to create derivatives.
 
1:23 PM
for example, imuutable objects library includes premium license github.com/lisachenko/immutable-object/blob/master/…
I don't know much about Patreon, maybe it can be another solution to work on this project with some kind of support
And now it is like a black PR )) But still it is a PR - look at this crazy license, he is crazy!
 
Perhaps, all I can say for sure is I would be straight up fired if I ever included anything that included an RPL license in any work I did.
Even if something else claimed to change those licence terms
 
What you could recommend me to use instead of RPL and MIT? )
 
What are your objectives for it?
 
To give it for free for open-source and to have income for commercial use
I don't know any good ways to have something back from my projects when they are used in commercial needs.
 
for libraries its incredibly hard to make direct money from the code
 
1:34 PM
set up a patreon or something
 
This should be platform for userland extensions, maybe even a market ))
 
@Danack is or was working on something to make it easier for people to pay open source authors...? or something like that...?
 
You'd need to dual licence it with a non-commercial attribution vs commercial one. But like beberlei mentioned, it'll be very difficult.
 
@lisachenko Probably the closest standard license is GPL?
 
@lisachenko should, maybe? you need some kind of proof.
 
1:36 PM
Yes, I know it isn't easy question. And I receive a lot of negative comments ) When developers are complaining about license type...
@beberlei It is still in active development, I have to create platform first...
@NikiC I will check it one more time carefully, maybe it is what I need indeed...
 
@cspray: Could you take a look at github.com/labrador-kennel/http-cors/pull/…. If you don't want to maintain it anymore, would you like to transfer ownership to @amphp?
 
i have thought for weeks and months how I could earn my living working on Doctrine :-) except do consulting and training nothing really works well
 
Consulting and training is where it's at.... make yourself money by making other people even more money.
 
It's pity, but it's true...
And there are projects like Vertica, RapidMiner that cost $100K and more and companies use them...
...sigh
 
to me it feels you are turning open core around, what you envision is things on top zengine that people want to use (shared memory objects). wouldn't it be better to charge for those compared to the core itself, where a potential user maybe doesn't even know what its possible to do with it
 
1:44 PM
Those are all huge managed services no?
 
If money is a bottleneck, you can always apply at a tech company or start your own company to sell your products and services to clients. Downside of the latter: you need to get and maintain your clients.
Giving away software 'for free as in free speech', adding a clause that people should pay you something back in return when they make money of it too, does not really work if you or your group is too small to fight for your rights (in the courthall).
 
Financial/licensing questions are so complicated )) Even PHP source code is easier to understand ))
 
Hire a good lawyer :-)
and if you're going to start charging, an accountant too, as you'll be doing international transactions most likely
 
But, Taylor has succeeded with paid services... And he even had noticed my library...
 
I'm not familiar with the name, who's Taylor?
 
1:49 PM
laravel
 
yes but its paid services on top of a free library (laravel)
 
Creator of Laravel
 
ah okay thanks
 
@beberlei So, I should have open core with paid extensions instead...
 
likes and shares are not equivalent to "would buy it for money", only people actually buying are. i tried for years to do projects, tideways is maybe attempt 8-10 that then actually worked
 
1:51 PM
And we don't have a concept of paid composer packet...
 
private packagist allows you to do just that
 
Looks good...
 
this has been my only professional experience with a paid PHP product machform.com/pricing
(used it in my last job, it's a nice form builder)
one-time license fee, but it could be an annual fee if continued support was desired
 
Speaking of making money as a consultant.... ayup @Ocramius did you decide to charge $1000/hr for VBA?
 
Aren't going prices for consulting between € 90/120 per hour ?
owh, I see, VBA :) I'd rather die first.
 
1:57 PM
I wish I got anything close to 120eu / hr
 
@MarkR change your rates :P
 
Doubt the main company I work for could afford to pay me 200k a year.
 
nah, just give yourself a slight pay raise
increase it by five pounds or so
or do a percentage raise
 
I'm happy enough, it's a stable contract, will renegotiate in a few years no doubt.
 
o/
Hola friends!
 
2:06 PM
o/
 
I turned it around: first I worked at a large international software company for a nice wage. Then bought the stuff I needed like a house and a PC. Now I'm writing an application for free.
 
2:17 PM
I mean... what's a license anyway when the world is controlled by an orange guy...
 
@StatikStasis Hello amigo
 
Me amiga!
 
ya pasemos
si quieres practicar en espanol entonces responder la pregunta "que haces hoy"?
 
@NikiC @JoeWatkins if object zval is allocated in persistent memory with properties and reference count is greater than 1 and no references in EG(object_store) to that zval, would it be sufficient to keep such zval forever until restart?
 
I probably made mistakes
 
2:28 PM
@JoeWatkins que haces hoy?
 
yeah sorry, apparently I adopt bad habits
and can't spell
@lisachenko no
 
@JoeWatkins What should be done more?
 
@lisachenko uuuuh object in persistent memory?
 
no such things as a persistent zval with a complex type, it's destructor will be called
 
@JoeWatkins But destructor will be called only if it is in EG(object_store)?
 
2:30 PM
you pass it into the engine though ?
 
Yes, but it is just a zval somewhere in memory, its refcount is increased manually to prevent GC
 
I'm not sure it needs to be in the object store to have it's destructor called, I defer to niki for the details ... but there is no such things as a persistent object and when I've handed one into the engine before it doesn't handle it, regardless of refcount ...
 
Difference in persistent is malloc/emalloc I guess...
 
something doesn't have to be in the object store to enter into a gc buffer if you handed it to userland
and the gc will eventually ignore the refcount to free the thing if it's in a gc buffer
 
one is controlled by Zend and one is traditional memory allocation that is used by extensions and FFI with persistent=true flag
 
2:33 PM
yes, my answer is it's not reasonably possible and unsupported ... nikita might have more to say ...
 
@JoeWatkins Ok, thank you, I will check where object can be collected in GC buffer. Maybe @NikiC could help me with that...
 
@lisachenko If you increase the refcount it should be fine
Assuming you don't do threading
 
@NikiC perfect, thanks
 
But it also means you're going to leak everything
 
@NikiC I'm going to reuse my immutable objects here, so objects will be initialized, but safe to read across several processes or workers
 
2:35 PM
And what happens if someone assigns a property on your persistent object?
 
I've tried that and it didn't work
 
@JoeWatkins The combination of refcount increase and not in object store seems like it should work to me. GC shouldn't interfere
 
@NikiC All properties should be instance of Immutable class, otherwise error will be raised. All initialization will be done in ctor...
 
yeah me too, which is why I tried it ... then backed away when it crashed the engine because it's clearly not a supported thing
I didn't even get as far as calling a method or handling properties
 
Let me try this )
 
2:38 PM
@JoeWatkins eh, you're probably right :)
Certainly very much not supported
 
Interesting question is what happens to pointer object->ce. Can it change in runtime? Or it should be the same for each request?
 
it should not change at runtime, surprising things will happen if you change the class of an object at runtime and the original class is cached in any rt
 
@JoeWatkins no, I dont want to go this way, it is definitely key to segfault )
 
you can obviously go to extreme lengths to make sure that isn't the case, or you might be sure of that in some other way ... but the engine doesn't expect an objects class to change is the answer ...
 
It is normal requirement, so nothing unexpected here.
It looks that I can escape from "share nothing" model for objects soon. Only need to reimplement zend_object_std_init by hands...
 
2:44 PM
crazy
and I doubt very much if you can escape completely from it ... there'll always be one last way to a fault
how are rt's mapped for methods on a persistent object ?
 
@JoeWatkins assuming that class in runtime memory too, then all meta information about methods, properties, class itself will be available in persistent memory and should be the same between requests, so no need to update pointers to concrete CE entry.
it will behave like super-global object, with additional handlers for immutable properties
 
are persistent objects allocated in shared mapped memory (mmap) ?
without that in a prefork mode, you cannot share objects between processes
 
they can be allocated there as well
If I want them to be shared fully
but let me try first, need to experiment with simple objects first in one process )
 
when you move the object to mapped memory (which you must do), and you insist on sharing runtime caches (not sure that's even possible) because you only have one copy, you will come up against a million race conditions you cannot solve, because many vms will be concurrently doing null checks on the rt in a bunch of different opcodes
 
For now it is working for simple scalars like integers, etc. Not atomic of course, but this can be used later for requests counters, in-memory cache between requests, etc
 
2:51 PM
this can't really work, it's unsupported
 
@JoeWatkins Is rt cache contains pointers relative to object itself? Or pointers relative to class_entry?
 
absolute class entry addresses, cached by the vm on lookup_class and related
 
So, it should be ok then, because class entry will be the same, only objects are stored in another part of memory
 
I always love your conversations :P
> this can't really work, it's unsupported
 
2:56 PM
))
 
> So, it should be ok then
\o/
:-)
Also ohai all
 
I just like to create impossible things )
The more "no/impossible/this won't work" I get, the more energy my brain produces to solve this puzzle
Kind of sudoku ))
And Joe helps me a lot giving some hints
 
puzzles only fit together one way, it doesn't matter how much brain time you dedicate to solving a puzzle if you insist on cramming the bits together in a hap hazard way, you will never complete the puzzle that way, just end up with lots of broken bits of puzzle ...
 
Eugh quoting failed
 
or a picture that makes absolutely no sense, depending on the quality of the manufacturing process ... anyway, I'm getting sidetracked by puzzles ... my point is that some things actually won't work, they really won't
 
00:00 - 15:0015:00 - 23:00

« first day (3413 days earlier)      last day (1521 days later) »