« first day (2319 days earlier)      last day (2632 days later) » 

4:00 PM
@Trowski A one way adapter shouldn't be too hard.
 
@bwoebi Business don't do that. Totally migrating a code base is a huge undertaking. It needs to be as easy as possible.
@kelunik Right, it's easy, I did it for Icicle for the loop. Adding in support for the promises would be trivial.
react/promise would only be a dev requirement.
 
@bwoebi Tell people to start writing useful 3rd party packages based on amp
 
@PeeHaa We need a really good documentation first.
 
embrace extend extinguish ftw \o/
@kelunik Well if people in here start writing packages / projects and people use that it's a nice intro to amp without having to need amp docs
 
Anonymous
@kelunik this. I think this is the main thing preventing it from being used in production. At least in my case
 
4:03 PM
Basically I'm proposing the "If we can't beat them, join them." We'll just build off what React has offering full compatibility, while giving people a much easier and more performant way of writing async code.
 
@PeeHaa We didn't even have documentation for our basic helper functions until some weeks ago.
 
@kelunik People in here (me?) don't need that because we can bug you all
 
@PeeHaa In here, yes.
 
Documentation is huge. We need something like what @sagebind put together on icicle.io/docs
 
yeah… here…
 
4:04 PM
> Well if people in here start writing packages / projects and people use that it's a nice intro to amp without having to need amp docs
in here
 
@Trowski We need a good structure and good content.
 
@kelunik And somebody willing and able to do it
 
I'd worry about getting things done and less about marketing.
 
@kelunik I really do not have time to put together docs right now… nor am I particularly good at it. Is this something you'd be able to work on?
 
Anonymous
@LeviMorrison this
 
4:06 PM
@Trowski I'm not really good at explaining things well either :D
 
I should also probably at least finish async twitter
bitches love twitter
 
Anonymous
asking one person to do documentation is probably unreasonable as well
 
@Trowski We should just build it into PHP 7.2 and be done with it. :P
 
@kelunik If any of the getting started portions from the Icicle docs are helpful, let's use them. Most of it should be applicable to Amp.
 
The PHPDoc team can handle that shit then. :D
 
4:09 PM
@kelunik Fuck you
:P
 
ahahahah
 
@kelunik I was thinking about this over the weekend… maybe we should look at putting async/await into 7.2 along with a select-based event loop.
@kelunik haha
 
Docker is for masochists who think its fine to run a 0.0.0.1-pre-alpha for a mission critical system
 
@Trowski It's also something I talked about with Clue yesterday, once it's being built into core we don't need a interop specification anymore.
 
Anonymous
4:10 PM
@Stephen can I have your autograph?
 
lol
 
@kelunik you mean the people who haven't got around to php.net/manual/en/arrayiterator.seek.php yet?
 
@Trowski How would async / await be handled on top level?
@PaulCrovella While it says it's not documented, everything that's on the page is already enough.
 
@kelunik Are you familiar with how it works in HHVM?
 
@Trowski Nope.
Maybe @Sara can shed some light there?
 
4:17 PM
@kelunik One possibility is that await would act like wait() if it was outside an async function.
 
Where do we even need async, don't we just need await?
 
@kelunik Probably backing up a whole stack, like generators.
 
If we don't do green threads, it should be pretty easy to bring it into PHP, no?
 
@kelunik green threads is not a big issue though
 
4:24 PM
Also
> As you can see, it ready almost like synchronous code
wat :)
 
@bwoebi But what's the thing you want with green threads? Coroutines are basically also green threads.
@PeeHaa fixed
 
@kelunik backing up a whole call stack and not each function individually as generator
 
<3
 
@bwoebi for proper stack traces, right?
 
That's a side-effect.
 
4:26 PM
What are the other benefits?
 
not having to await everything, but only what you choose to explicitly promisify (e.g. for use in combinators)
 
@bwoebi How's that going to work in user code?
 
Hi everyone. I'm using npm to install a javaScript plugin/repo from GitHub. It downloads into /node_modules/. I've been linking to the script files in my project but now it's time to commit and I don't think this is the correct way of working. Can anyone tell me the "proper" way of downloading the repo and using its files in a project?
 
@kelunik nicely.
 
@kelunik Not sure… await probably is enough.
 
4:32 PM
@bwoebi I asked how.
@Dan There's a JS room for that question.
 
@kelunik It's a general questions, not really specific to jS?
 
@Dan Ah, so NPM and NodeJS are PHP?
 
@bwoebi Unlike Hack it might be nice to provide a function like when() on PHP's awaitables so not everything has to be awaited.
 
@Trowski possibly.
 
And users would make an awaitable with something like Deferred?
 
4:37 PM
@Trowski Yes.
 
@Trowski probably.
 
@bwoebi So how will "not explicitly promisify" look like?
 
@kelunik well, you await by default on things which do async things.
 
@kelunik Thanks for your help, much appreciated.
 
And if you use a modifier on it, e.g. async then you get a promise
 
4:40 PM
In that case we can make await outside of a function an error.
 
@kelunik in PHP everything is a function.
 
In the same way yield is an error outside a function.
 
How much work is needed to make it work?
/away for some time
 
How about an event loop… it isn't strictly needed to add async/await… but it's necessary to have one for them to be useful.
 
was it possible so split "foo=121; bar=43" into array ['foo' => 121, 'bar' => 43] using regexp?
or should I not bother googling?
:(
 
5:01 PM
@tereško Can any data contain ; ?
 
";" is not part of data but part of separator
I am trying to split a header
 
Oh I have a thing
moment
@tereško gist.github.com/DaveRandom/6089944 specifically for content-type negotiations, but it has a parser for that format which could be extracted
oh the parser is just preg_split based anyway gist.github.com/DaveRandom/…
 
already looking at it
 
5:16 PM
@bwoebi I like implicit await but there are things it can't do.
 
@LeviMorrison like?
 
$a = asyncCall1();
$b = asyncCall2();
It won't get both of those in flight at the same time.
 
that's what there would still be an asnyc keyword
 
^ that
 
to retrieve an explicit Promise
 
5:18 PM
I'm all for it if you can work it out and add some functions to demo it in real code.
 
@LeviMorrison I just need @JoeWatkins to continue working on greenlet
then I can nicely prototype that
 
Could you make it so that e.g. all(asyncCall1(), asyncCall2()) would be a language construct that implicitly did await all(async asyncCall1(), async asyncCall2()) @bwoebi?
 
Eh... I recommend focusing on a minimum viable product.
 
@DaveRandom yes, that'd work, but it'll be confusing if you need custom combinators for reasons, so better not.
 
That would be nice, @DaveRandom, but it's not really essential.
 
5:21 PM
I want All The Things and I want them yesterday.
:-P
@bwoebi Could be done with a level of magic that would probably be excessive
 
By the way focusing on the minimum viable product is partly why I haven't done anything with enums.
 
yeah, okay.
 
@PaulCrovella But it wont be me teaching the users that, it will be the client vendors who are straying from standards, or trying to be helpful, or in some other way mangling data.
 
I thought the minimum would be very, very light so as to be future extensible. But it turns out we have to decide whether it is going to be an object type now which affects what you can do with it later.
Union types also failed, which affects how I think about enums to some degree.
Unions types would fill the hole for what some languages do with their enums, leaving us open to use enums in a different way to cover more use cases as a whole language.
 
Can we get an iota to go with those enums? :)
 
5:29 PM
Depends on what sort of enums they are.
If they are rust like enums then definitely not ^_^
But if they are C like... then maybe.
 
I was thinking C / go (which has iota)
 
C like enums are the least powerful and useful, honestly.
But if we had union types then it wouldn't matter because those would fill a lot of the more powerful use cases.
 
rust enums are pretty powerful
 
Eh...
 
sorry, mean rust
looking at them now
 
5:31 PM
Oh, Rust
 
that associated data
 
I have to say that go's iota is pretty nice
(as @Leigh was saying.)
 
@bwoebi What purpose would the async keyword serve?
My assumption would be any function containing await would return a promise, much like a function containing yield returns a generator.
 
@Trowski well… to return said promise.
 
Hello everybody ..!
 
5:44 PM
async makes it run in another green thread; await will block for it to finish. Correct?
 
yes
 
@bwoebi Return the promise from what? How would async function { return await $promise; } differ from function { return await $promise; }?
 
Web browser wasn't loading new CSS changes that I had made. I added a comment, cussing out the web browser. It loaded the new CSS. (CSS is on a local test server, so no one would find it in the time that I had the comment in there)
 
@Trowski the function isn't async. the caller uses async. I.e. $promise = async myFunc(); vs. $value = myFunc();
 
@bwoebi So to do a combinator, I'd have to write code like
$promise1 = async myFunc1();
$promise2 = async myFunc2();
$array = await all([$promise1, $promise2]);
 
5:49 PM
yes
 
Well... I would just make all() variadic ^_^ but that's a nitpick.
 
That would work… just don't forget an async somewhere and block.
 
This sort of thing would be best served by macros.
 
That is a bit apart from typical async/await implementations, but it makes sense…
 
There are some things I'd really like macros for in PHP but I also understand why people would be averse to them.
 
5:54 PM
@Trowski so async would be a promisifier?
 
@FlorianMargaine That's what @bwoebi is suggesting.
 
that sounds like something you want to do in userland...
 
@bwoebi What happens if I wrote $promise = async funcWithoutAwait();
 
@Trowski Guess.
 
@LeviMorrison Well… it could return a resolved promise, or it could be an error.
 
5:56 PM
@Trowski the former
 
And which would be most in the PHP spirit? Obviously the former. We don't error when we can continue :D
 
Heh, true.
@bwoebi What about the event loop? I can see a lot of "What's the point of async/await without an event loop?"
 
@Trowski I haven't given it much thought yet. An event loop is just a simple event loop…
 
@bwoebi Built-in based on the interop spec? Left to user space?
 
@Trowski dunno, it should be probably a builtin native loop with a few functions, like loop_repeat(), loop_onWritable() etc.
and then provide an interface for extensions/usercode to implement the loop itself
 
6:04 PM
@bwoebi Sounds reasonable.
 
6:17 PM
Eh, why expose loop_repeat or anything at first?
Just provide the basic machinery for async/await.
 
@LeviMorrison Which then comes with the caveat that any code using async/await is probably going to be dependent on a specific user-land event loop, making interoperability between libs more difficult.
 
I fail to see how that would happen.
The scheduler has to exist in the engine for async/await. It can't be in user-land.
 
@LeviMorrison Of course, but there needs to be a way to poll streams or make timers.
 
No, there doesn't.
It might be nice to have but it's not essential.
 
To write async code… it's essential.
 
6:24 PM
Polling streams and making timers aren't required for the most common cases of async/await. Just go look at all the web stuff written in C#; it's all database and remote service calls.
 
Somewhere a socket is being polled.
If we abstract that away, fantastic. But that would require providing async streams, database drivers, etc.
If I'm totally missing something please enlighten me… @LeviMorrison or @bwoebi
 
6:39 PM
Would love to know if someone here has a more efficient solution to this than combinatorics: phplab.io/lab/Ocu7O
 
6:55 PM
what do you guys use for picking colors/color schemes?
like if I have a color and I want variations of it
there are dozens available, and there's one I used to use but I can't remember the name. I could input a hex code and it would give me variations of the color and color schemes that work with it
 
@Trowski async streams need polling again. /cc @LeviMorrison
But once we have async/await in that form, I'd just put the loop into core.
 
@Tiffany I am terrible at both naming things, and picking colors, but I would suggest looking at some bootstrap themes as they should have semi-reasonable naming conventions.
When you drop the polyfill and go with the fully native API https://t.co/bZUHZ52nhG
 
7:17 PM
@Trowski it'll just cause the code to block here. We can do that progressively.
 
7:31 PM
@Sherif This is essentially the subset sum problem. If the values in the set are small, there is an efficient DP solution for the problem.
 
@NikiC Isn't the subset sum problem involving only positive integers?
 
@Sherif no
 
Writing a test for phpunit generators, not sure where I should create a test generator. Does anyone have any pointers?
I can see the TestIterators and stuff in _files so I'm not confident I should be creating them in the actual test, but somewhere else.
 
The standard sum-to-zero formulation of subset sum would be somewhat meaningless with positive integers ;)
And in any case, you can always normalize
 
@bwoebi I like your proposed model for exactly this reason.
 
7:36 PM
@NikiC Forgive me, but I'm not seeing how they're related. I know that I can find the non-zero sum in a single pass, but I don't know how to find all subsets whose sum is also a subset of the set using DP here.
Do you have any hints/examples I can look into?
 
@Danack I was going for a grayscale type color. I'm building a simple calculator to demonstrate my knowledge of Javascript since I don't have anything worthwhile that's recent.
 
@Sherif "subset of the set" is a weird formulation of "element in the set" in this case
 
Sure, perhaps not the best choice of words given the sum will always be just one member.
@NikiC this would the solution I came up with phplab.io/lab/gXA8E
I'm pretty sure it's not the most optimal, but I can't think of a better approach.
Of course, I could make the elements keys to prevent O(n) lookup, but meh. You get the point.
 
@Sherif Don't want to implement this right now, but what I mean in basically doing en.wikipedia.org/wiki/… with s=max(set), which will also automatically solve it for all smaller s. Of course need to additionally keep track for set reconstruction and handle the negative case as well (but that's symmetric)
This only works if d=max(set)-min(set) is reasonably small and you have ~d*size(set) memory to spare
 
@NikiC Thanks, I'll look into it and see if I can come up with the DP implementation.
Hmm
 
8:08 PM
Is this encoding familiar to anyone in a url query string url.com/action.php?t=GadCQiGw+ro54EwhrBU+FEpQxIzXPNoDdOrESHp5VVQ=_==QZ0JXQ
I'm trying to decode it
I extracted a private key from their android app and this is the resulting URL so I'm trying to find the encryption type
 
base64
 
8:23 PM
!!rfcs
 
that's less than before
 
yup, just closed b'this thing'
 
awww
 
:'( i really thought it would make it tbh but i guess the "it doesn't hurt" argument won
 
8:27 PM
@NikiC decoding it shows unreadable characters �BB!���9�L!�>JP�<�t��HzyUTgBW any idea where to go from here ?
 
Is voting against wiki.php.net/rfc/list_reference_assignment just because "I never want to debug code that does that" a valid reason?
 
Passing a generator after ->next() has been called will attempt to be rewound by iterator_count(), but I imagine after starting to run a generator there's no other way to get the count.
Is it worth getting the remaining count instead by iterating through a generator until it ends?
 
@Danack I think "because references" is a sufficient reason to vote against that
Of course, "because consistency" is also a sufficient reason to vote in favor of it
Overall it cancels out :P
 
!!voting list_reference_assignment
 
• list() Reference Assignments - Yes (12: 70%), No (5: 29%) (https://wiki.php.net/rfc/list_reference_assignment#doodle__form__list_reference_assignments)
‌ ◦ Yes: bishop, fmk, galvao, kguest, leigh, lstrojny, mariano, pollita, sammyk, stas, svpernova09, zeev
‌ ◦ No: daverandom, hywan, joey, levim, ocramius
 
8:32 PM
!!voting binary_string_deprecation
 
• Binary String Deprecation - Yes (19: 59%), No (13: 40%) (https://wiki.php.net/rfc/binary_string_deprecation#doodle__form__binary_string_deprecation)
‌ ◦ Yes: bishop, bwoebi, danack, daverandom, kelunik, kguest, krakjoe, leigh, lstrojny, marcio, mariano, nikic, ocramius, peehaa, sebastian, thekid, tpunt, trowski, yunosh
‌ ◦ No: ajf, davey, eliw, galvao, hywan, joey, mbeccati, pollita, salathe, sammyk, stas, svpernova09, zeev
 
!!issue !!rfc voting totals up to 99% when it doesn't divide cleanly. - chat.stackoverflow.com/transcript/message/35752206#35752206
 
9:04 PM
@bwoebi @kelunik Branch adding support for React promises to Amp: github.com/amphp/amp/compare/react-compatibility
The only often run check will be when resolving a promise: github.com/amphp/amp/blob/…
 
well.
 
If I had 6 words for example: one, two, three, four, five and six, how would I use PHP to find out how many different combinations I could have with three of them, so for exampe: four, five, one or three, two, one or six, five, two e.g
 
Of course an associated loop adaptor would be required.
@TheCodesee There is a simple formula for that:
!!wiki combination
 
In mathematics, a combination is a way of selecting items from a collection, such that (unlike permutations) the order of selection does not matter. In smaller cases it is possible to count the number of combinations. For example, given three fruits, say an apple, an orange and a pear, there are three combinations of two that can be drawn from this set: an apple and a pear; an apple and an orange; or a pear and an orange. More formally, a k-combination of a set S is a subset of k distinct elements of S. If the set has n elements, the number of k-combinations is equal to the binomial coefficient...
 
In your case: 6!/3!(6-3)!
If order is important, see permutations.
 
9:10 PM
thanks ill take a look
 
@bwoebi ?
 
It's only small, but I did a thing :D
 
@Trowski I'm a little bit annoyed about the situation
 
@bwoebi As am I. Let's see where it goes and consider merging that down the road. I did it mostly to ensure I didn't run into an unexpected problem (performance or otherwise), but it was as simple as I thought it would be.
 
fine
 
9:26 PM
@Sean Asserting count with a generator is a little odd, but what you did makes sense.
 
ThW
65 people say they will attend my usergroup talk tomorrow, I am getting a little nervous. :-|
 
@Trowski Thanks! I agree it is rather strange, but at least the option is there.
@ThW Ooo, whatcha talking about?
 
ThW
PHP extension programming
Zend/PHP Api by example
 
Unix room seems relatively dead, gonna post my question here :p
Can anybody help me make a simple bash script that wgets URL with different get parameters?
Basically make a script that would something like
for(i = 0; i < 1000; i++) {
wget "example.com?param1=i"
}
 
Nice! You've done this talk before, right?
747
Q: How do I iterate over a range of numbers defined by variables in Bash?

eschercycleHow do I iterate over a range of numbers in Bash when the range is given by a variable? I know I can do this (called "sequence expression" in the Bash documentation): for i in {1..5}; do echo $i; done Which gives: 1 2 3 4 5 Yet, how can I replace either of the range endpoin...

 
9:41 PM
and something like:
URL="example.com?param1=${i}"
wget $URL
 
Thank you both
However, is there any simple way to use base 16 for i?
 
j=$( printf "%i" $i ) perhaps
Converts your iterator to base16, but it will still loop around the number of times given (in base 10)
 
Wes
o/
 
\o
 
ThW
@Sean No, first time.
 
9:59 PM
@sweg_yolo_69 example
 
OK so, I know my questions escalate a bit quickly, but what linux distro should I get for doing basic programs like this
 
ThW
@Sean got 98 slides (and expect to use maybe 50)
 
I tried implementing the script on a local VPS, but the interface was too bad
I use windows as my main OS, don't really plan to switch
I plan to use it mainly for the command line tools/bash
 
I like debian, but ubuntu is decent too
have you looked at vagrant?
 
@ThW That's a lot, though it seems like a complex subject from the outside looking in. Sounds like fun!
 
10:06 PM
I was also thinking about debian and ubuntu. I haven't looked at vagrant, though I would prefer to have "the real deal"
 
vagrant builds you a VM in a very quick and easy way, the VM uses ubuntu
 
I think I'll just go with debain and install it on a VM
 
there's no real reason to do it yourself compared to vagrant, unless you're wanting the experience of setting debian up yourself
otherwise vagrant is better
saves a lot of time
 
@sweg_yolo_69 If you don't want to switch from Windows and just want the command line tools, have you considered cygwin?
 
what is cygwin? I've heard of it before, maybe used it once from instructions, but I have no idea what it is
 
10:10 PM
It's a bash emulator for windows
 
ahhhh
 
before we switched to macs at work, we were on windows laptops, and I used cygwin quite happily for years
 
@Dereleased I have Cygwin installed by Git or some other program. I tried it before wanting a separate linux distro
It's most likely that I don't know how to use it/ it isn't set up properly because it doesn't have wget
 
@sweg_yolo_69 Normally you install cygwin with an installer .EXE file. If you run that again, it acts like a visual package manager
 
Well I didn't install it manually, it was installed by some other program
Git or something similar if I remember correctly
 
10:13 PM
I've got no dog in this fight. If you want to try to use cygwin for this, I'll try to help you get it working. If you're not interested, by all means spin up a VM =)
 
I'm thinking... Should I go full on script kiddie and get a kali linux VM if I'm getting a VM at all
 
ThW
@Sean It is. I started learning it to create bindings for the WiringPi library (GPIO on the RaspberryPi). It is easier then I expected, but difficult to find current information about it.
So I put my experiments into a github repo and now slides.
 
@ThW Want to muck around with that. Got a Pi, but haven't really touched the pins on it. I picked up the arduino quite quickly but from what I've heard the pi is a little more complex :p
So your talk involves hooking up Pi's GPIO as a PHP extension?
Wait, was the Pi at PHPNW yours? The one with the ticker :P
 
ThW
10:31 PM
I had some running ElePHPants on the PHPNW unconf
 
Yeah, I remember them! :D
 
ThW
Actually the PI is easier. Using Arduino from PHP involves Firmata, so you need Async I/O. The PI can be done using file operations.
On the other side what you can do with the PI pins is a lot less then what is possible with Arduino. Here is no analog input and pwm is not enough for a single RGB led.
 
@Dereleased I went with a solution similar to yours
 
ThW
I try to abstract that in a PHP object with Carica Chip, but you know time and tasks :-)
 
Turns out that a developer version of windows 10 has some Unix tools
So it's basically like a first-party Cygwin from windows
And from my limited requirements, it fits the job perfectly
 
ThW
10:44 PM
Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables (in ELF format) natively on Windows 10. Microsoft and Canonical partnered together to enable a genuine Ubuntu 14.04 "Trusty Tahr" image to be downloaded and extracted to the user's local machine, and for the tools and utilities contained within that image to run natively on top of the WSL. WSL provides a Linux-compatible kernel interface developed by Microsoft (containing no Linux kernel code), with user-mode binaries from Ubuntu running on top of it – a Bash shell and command language, with native Linux...
 
@ThW Yep, that's what i was talking about
 
10:59 PM
@Leigh the problem typically doesn't come from client vendors, it's an issue of equivalent grapheme construction across devices and input methods - they're not mangling data or straying from standards, there are simply multiple ways to represent the same grapheme in unicode. The user doesn't know the difference and the client just passes along what they're getting.
 
Wes
11:32 PM
@NikiC in an open addressing hash table with linear probing, if i remove an element i set its bucket to null, thus possibly creating a hole. should i get rid of that empty bucket by moving other elements with the same hash into it?
 
@Wes for ordinary open addressing tables you usually don't do that
It's fine to delay that until rehashing
For Robin Hood tables you do use backshift deletion
 
Wes
so basically get() operation has to traverse all buckets, unless key is found? i planned to short circuit at the first null occurrence
but i have no idea of what i'm doing
 
@Wes It is customary to distinguish between empty buckets and tombstones for that reason
i.e. you continue searching if you see a tombstone, but stop at empty
 
Wes
i see
 
while for insertion purposes you can use both empty and tombstone
 
Wes
11:37 PM
thanks, lemme try it
@Sean can we haz rewindable generators, pls? :B
 
those are called iterators
 
Anonymous
@PeeHaa spoke to one of your mates today.
 
@JayIsTooCommon I have mates now?
 
Wes
i have no idea if that could work, but i do find annoying having to
new NewInsteadOfRewindIterator($generatorFactory); :B
that thing just reruns the generator's function upon rewind
yo jay peehoo
 
11:53 PM
yo
 

« first day (2319 days earlier)      last day (2632 days later) »