The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2015-06-12

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:43 asarch joined #mojo
00:45 aggrolite joined #mojo
00:53 bin_005 joined #mojo
01:07 odc joined #mojo
01:21 woz joined #mojo
01:24 klapperl joined #mojo
02:03 powersurge joined #mojo
02:28 noganex_ joined #mojo
02:28 aggrolite joined #mojo
03:10 woz joined #mojo
03:56 irq joined #mojo
04:16 kaare joined #mojo
04:17 * jberger stumbles upon this again: https://github.com/mattdiamond/fuckitjs
04:18 Grinnz hahaha
04:18 Grinnz so, how to run your js like php?
04:20 Grinnz oh god there are issues open
04:20 Grinnz AND PULL REQUESTS
04:20 purl PULL REQUESTS are more work
04:27 jberger the PRs are funny :-)
04:30 * jberger comments on an issue
04:31 jberger its a good compliment to http://vanilla-js.com/
04:37 cstamas joined #mojo
04:59 woz joined #mojo
05:20 preaction sounds like: http://search.cpan.org/~ovid/Acme-Code-Police-2.18281/lib/Acme/Code/Police.pm
05:23 Grinnz oh my god lol
05:23 Grinnz the source
05:23 purl i think the source is going to be stored in the bytecode (in most cases)
05:25 arpadszasz joined #mojo
05:27 gryphon joined #mojo
06:22 lluad joined #mojo
06:31 dod joined #mojo
06:36 dod joined #mojo
06:49 woz joined #mojo
06:54 AndrewIsh joined #mojo
06:55 arpadszasz joined #mojo
06:57 irq joined #mojo
07:01 mattp_ joined #mojo
07:01 eseyman joined #mojo
07:11 arpadszasz joined #mojo
07:22 batman i think DebugDumperHelper looks very much like my https://metacpan.org/pod/Mojolicious::Plugin::Logf
07:22 batman just that mine does more...
07:23 ToApolytoXaos joined #mojo
07:49 mattastrophe joined #mojo
07:50 woz joined #mojo
07:51 bin_005 joined #mojo
07:54 trone joined #mojo
08:00 marcusr Yo dawg, I heard you liked debug plugins
08:01 batman so i put a debug plugin in your debug plugin
08:01 batman ?
08:01 batman :)
08:16 Vandal joined #mojo
08:36 cpan_mojo Mojo-SinaWeibo-1.0 by SJDY https://metacpan.org/release/SJDY/Mojo-SinaWeibo-1.0
08:46 woz joined #mojo
08:47 irq joined #mojo
08:53 cpan_mojo Mojo-SinaWeibo-1.1 by SJDY https://metacpan.org/release/SJDY/Mojo-SinaWeibo-1.1
08:57 sri oh, postfix deref goes non-experimental in 5.24, before signatures, that's unexpected
08:59 marcusr sri: Not really. postfix derefs is rjbs's baby
09:00 mst also, postfix derefs has a lot less potential for being varied
09:00 mst having had absolutely no idea who implemented postfix deref, I would've expected that to happen
09:01 mst marcusr: whatever drugs you're on ... maybe ask your dealer if he sold the same stuff to MLEHMANN
09:01 marcusr mst: I wish I had drugs.
09:01 marcusr unless coffee counts.
09:03 marcusr mst: anyways, please never compare me to mlehmann again, kthx.
09:03 Dandre joined #mojo
09:04 illywhacker joined #mojo
09:04 mst marcusr: that's why I went via the "bad drugs" joke
09:04 mst so it wasn't a direct comparison
09:05 mst it was meant to be funny :P
09:06 marcusr I mostly find anything involving him sad.
09:26 batman marcusr: +1
09:26 purl 1
09:32 mst marcusr: having invested quite a bit of time in attempts at providing things he asked for, which he then rejected
09:32 mst I want black humour out of it so it wasn't a complete waste
09:39 sh4 joined #mojo
09:48 sri new selectors! http://www.sitepoint.com/future-generation-css-selectors-level-4/
09:48 sri wasn't someone going to look into leading whitespace in selectors?
09:49 arthas joined #mojo
09:52 batman :matches is nice :)
09:52 sri for Mojo::DOM it's a bit meh
09:53 batman there's a lot of new cool selectors there :)
09:53 sri case insensitive selector and :has() are pretty big in general though
09:53 batman yeah, i agree
09:53 batman agree
09:53 sri :has() is complicated though, since it has leading combinators
09:53 Adurah Cool Content Selectors
09:53 sri :has(> div > p)
09:55 Adurah Wait, damn it. Content Super Selectors, there we go.
09:56 sri yay... here i wanted to read up on the specs... but the w3c server is having issues
10:01 mst sri: probably the general internet issues today
10:08 kaare joined #mojo
10:10 kaare_ joined #mojo
10:13 sri btw. whitespace before selectors seems easy to handle, just whitespace after is a bit tricky, since you have to avoid it getting treated as another combinator
10:14 sri anyway, the person that wanted to look into it seems to have vanished, and i don't think i care enough to do anything either ;p
10:27 dod joined #mojo
10:54 mattastrophe joined #mojo
10:57 neilhwatson joined #mojo
11:00 xdg joined #mojo
11:10 oetiker joined #mojo
11:21 arpadszasz joined #mojo
12:03 mattastrophe joined #mojo
13:13 ajr_ joined #mojo
13:34 jberger It was nicomen IIRC
13:35 jberger And I'm not at all surprised about postderef
13:36 nicomen it was me, I looked a bit on it, just trimming the first part in the "first" compute call might work, but it does introduce overhead
13:36 nicomen after it seems to work already?
13:37 nicomen Also, I haven't had time to look at all the css4 specs
13:41 jberger Hmmm, I'm not sure I like the dual use of :valid
13:41 zackiv31 joined #mojo
13:48 sri i think we should just not support whitespace around the selector
13:48 sri it's not worth any overhead
13:49 mst and it's ugly
13:49 mst and FFS just trim it already
13:50 jberger I'd lean that way too I guess
13:50 jberger Are people programmatically generating their selectors?
13:51 sri dammit, don't we have any exciting decisions to make anymore?
13:51 nicomen mst: yes, I solved it by removing the space in front, but I hate to have to remember that so that every time my team members end up with that bug I need to remind them of the tweak.
13:52 nicomen I guess the problem was not really being strict, but it changed between 5.84 to 6.11 and I didn't see anything about it
13:52 nicomen in the changelogs
13:53 sri the entire selector tokenizer got rewritten to fix a few bugs
13:53 nicomen it's not a biggie
13:54 jberger sri: you are welcome to help me think of interesting ways to use Kavorka signatures to do fun things
13:55 jberger I did release the plugin yesterday
13:55 sri wasn't kavorka super slow?
13:55 jberger Probably
13:55 jberger It's all objects
13:55 sri not interested
13:55 purl somebody said not interested was supposed to be the Do Not Want button, only it doesn't want to say so.
13:55 jberger But it feels like I could do more with the introspection
13:55 jberger Ok
13:56 sri i'd still like to see a core signatures module for old versions of perl though
13:56 jberger I did ask about experimental features during rjbs q&a just for you
13:57 jberger polyfill would be very nice tho
14:04 jberger Btw, his response was "I expect we will see at least one example of an experimental feature being promoted and one being removed"
14:04 jberger I'll venture a guess that the one to be removed is magic deref
14:10 sri :/
14:13 mst almost certainly; that turned out to be a horrible idea
14:19 sri (sad because signatures might not go non-experimental)
14:24 jberger sri: this is why I'm playing with kavorka signatures
14:25 jberger To see what future semantics we might want if we had introspective signature
14:29 jberger For example, should named vs positional arguments behave differently?
14:30 dvinciguerra joined #mojo
14:58 zackiv31 joined #mojo
14:59 batman jberger: It would be cool if it turned $self into $c in actions
14:59 jberger hmmmmm
14:59 batman Still not sure if I will go into kavorka
14:59 jberger I wonder if it can automatically do that?
15:00 batman How about action() instead of method()
15:00 jberger kavorka seems to be the one that people are migrating to
15:00 batman As in the keywords
15:00 jberger batman++ I
15:00 jberger I'll look into that
15:00 batman I wasn't expecting that. (People moving to kavorka)
15:01 batman What's the reasoning behind it?
15:01 batman As in how is it better than something else!
15:01 batman ?
15:01 batman Oh. The concert is beginning soon... *bbl*
15:01 jberger Method::Signatures uses D::D which is no longer recommended
15:01 jberger and Function::Parameters is somehow not in favor, I'm not sure why
15:05 Kogurr joined #mojo
15:16 Grinnz_ http://xkcd.com/ this is amazing
15:20 cfedde just in general or a specific one?
15:21 cfedde today's is cute.
15:21 Grinnz_ yeah, today's.
15:21 purl yeah, today's is funny
15:22 * cfedde pets purl
15:22 * purl pets cfedde back, harder
15:23 kaare joined #mojo
15:26 mattastrophe joined #mojo
15:28 McA joined #mojo
16:12 wingfold joined #mojo
16:16 PryMar56 joined #mojo
16:16 jberger I'm just so glad that convos has xkcd embedding now <3
16:23 wingfold_ joined #mojo
16:26 frudas joined #mojo
16:27 frudas hello
16:29 frudas i have little problem with json
16:29 frudas $data = {foo => 'test',doo => 'alalla'};          #work great
16:30 frudas and i get :            {"doo":"alalla","foo":"test"}
16:30 amon joined #mojo
16:31 frudas but how can i do this   {"doo":"alalla","foo":"test"}, {"doo":"alalla2","foo":"test2"}
16:31 frudas ?
16:31 frudas with $self->render( json => $data );
16:32 Grinnz_ put them in an array
16:32 frudas mmm simple but brilliant
16:32 Grinnz_ [{...}, {...}, ... ]
16:32 frudas thanks
16:32 frudas i will try
16:32 Grinnz_ a JSON document must be a single top-level item (unless you're parsing it with a streaming parser, which you probably aren't)
16:33 frudas yes i have different items
16:33 Grinnz_ you could also make the top level item another hashref, to access the inner hashrefs by name
16:33 frudas mojo is responding to my apk in json
16:34 frudas thankx  will think about it
16:38 frudas is not working or i didnt do it well
16:38 frudas :(
16:38 frudas my $data = {foo => 'test',doo => 'alalla'};
16:38 frudas my $data2 = {foo => 'test',doo => 'alalla'};
16:38 frudas my @sdata = ("$data","$data2");
16:38 frudas unquote(@sdata);
16:38 frudas $self->render( json => $data );
16:39 Grinnz_ uhh
16:39 Grinnz_ thats not how you put hashrefs in an array
16:39 frudas mojo respond with :  {"doo":"alalla","foo":"test"}
16:40 frudas mmm hash ref
16:40 frudas ok i will try
16:40 Grinnz_ my @sdata = ($data, $data2); $self->render(json => \@sdata)
16:41 jberger frudas: are you bulk inserting into elasticsearch?
16:42 jberger it has that kind of format
16:42 frudas wonderfull it works
16:42 frudas thanks
16:42 jberger oh ok, nm
16:42 frudas you are my hero
16:42 Grinnz_ you might want to take a look at perldoc perldata, and perldoc perlresftut
16:42 Grinnz_ perlreftut*
16:42 frudas thankx
16:42 Grinnz_ the JSON format just maps to array and hashrefs in perl
16:43 frudas :-):D^^
16:43 jberger sri: the more I think back on recent discussions, there is one thing that people seem to think they want
16:44 jberger the problem is I can't quite formulate it into a single feature
16:44 jberger but generally
16:44 jberger some kind of way to do Routing/REST API over persistent websocket
16:45 Grinnz_ yeah that is... a little cloudy :P
16:45 jberger of course Mojolicious has the primatives to build up something like that
16:52 dod joined #mojo
17:01 berov joined #mojo
17:18 McA joined #mojo
17:21 marcus jberger: I think batman want that too.
17:23 jberger I even have a case that I would use it for at work
17:24 jberger are there anything like standards for websocket interaction like that?
17:24 jberger certainly nothing proper standardized
17:26 sri REST over websockets is not a thing
17:26 marcus Personally I'd like to see the routing system be more generalized
17:26 marcus for my own selfish gains (marvin)
17:26 sri some frameworks seem to me moving towards channels though
17:27 sri as in, one /ws endpoint that receives websocket messages in a special format with channel information, which then get routed to subscribers
17:27 sri and a special mojo.js library that handles encoding/decoding
17:28 marcus sri: Did you look at socket.io 2.0?
17:28 marcus I worked with it a bit for meatchat ios client. seemed pretty decent.
17:29 sri http://www.phoenixframework.org/v0.13.1/docs/channels
17:29 sri marcus: no
17:29 marcus I meant 1.0, apparently.
17:30 marcus http://socket.io/ it has channels too
17:31 sri everything has channels
17:31 sri rails 5 too
17:31 jberger sri: yeah, I think that's kinda what I mean
17:31 sri that's the point
17:31 * jberger reads
17:32 wingfold joined #mojo
17:32 * mst kinda liked cometd/bayeux :(
17:33 sri how old school
17:35 mst they weren't old school when slightlyoff and I invented them
17:39 trone joined #mojo
17:40 marcusr spoken like an old fart.
17:40 marcusr :D
17:46 sri marcus: if you mean we should be using the socket.io js library, i don't think that's an option
17:46 mattastrophe joined #mojo
17:56 ajr_ joined #mojo
18:15 ashimema as I can't seem to find it in spec anywhere I thought I'd ask here..
18:15 ashimema are http authorization headers repeatable
18:16 ashimema wondering what the aproach is to handling cases where you may have for example an OAuth token from more than one provider.. or in fact if that even ever happens?
18:19 ashimema aha.. comma separated within the same header by the looks
18:20 ashimema RFC2616.. I got there eventually
18:23 irq joined #mojo
18:23 Mikey i have created something channel like for my app, it just routes based on the first "\w+" of the websocket message.. runs json + strings through Mojo::Validate and does a primitive dispatch to a ws controller i call a "command"
18:24 Mikey not very complicated but gets the job done.  if you guys decide to standardize i'd likely move toward whatever you come up with
18:25 sri think it's unlikely we'll do it
18:26 sri there's not even a plugin yet
18:26 Mikey i do applaud the flexibility of the Validate stuff.. just define rules and pass it a hashref
18:27 Mikey well when our lawyers finish negotiating contracts, my company is going to open source a lot of this stuff
18:27 Mikey so you guys can pick apart my code then
18:27 Mikey if you want
18:27 jberger yeah, as I said at the very top of the discussion, mojo gives us all the primatives to do this, so it can certainly be written on cpan first (as my new Kavorka plugin might eventually guide use of perl native signtatures if  they are eventually introspectable)
18:27 jberger Mikey++
18:29 Mikey yeah, and i think in my case, it melds well with my ZMQ integrations and all the stuff that goes along with that.  i've gone pretty deep into the internals in some places
18:30 Mikey but i try and steer the project towards decisions you guys make as often as possible
18:31 Mikey mojo's flexibility and resilience is my favorite feature.
18:35 preaction Mikey: are you hooking ZMQ into the IOLoop?
18:42 * jberger is watching YAPC talks that I missed
18:42 jberger currently stevan
18:42 purl currently stevan is probably basically doing handles => qr/.*/
18:42 jberger dammitstevan
18:56 Mikey preaction: yessir
19:05 disputin joined #mojo
19:12 preaction nice
19:16 * jberger really likes the new mop ideas
19:18 bin_005 joined #mojo
19:26 preaction is that being worked on still?
19:27 damaya joined #mojo
19:27 jberger preaction: https://www.youtube.com/watch?v=sJC725e8ysM
19:27 jberger https://github.com/stevan/p5-mop-again-seriously-wtf
19:27 pink_mist jberger++ #I was just about to ask for a link :P
19:28 jberger I personally wasn't a fan of all the crazy new stuff in the previous mop attempts (I'm still only trying to want to like p6 after all)
19:28 jberger this one feels more p5-y
19:28 jberger @DOES
19:28 jberger %HAS
19:28 jberger required methods are just predeclared subs
19:28 jberger sub must_implement_this;
19:29 * jberger is reading deeper now
19:29 jberger I really wish I had seen this talk live
19:29 jberger I was in the room over listening to Tim Bunce
19:30 jberger which was good too, but it didn't need discussing later
19:30 jberger I could have had time to discuss with stevan afterwards
19:36 bin_005 joined #mojo
19:40 jberger hahahaha
19:40 purl LOLCON 4 reached.
19:40 jberger https://3.bp.blogspot.com/-sHqn2_66YT4/Tu8oSqvnXmI/AAAAAAAAEyo/9vC0YdqdzuE/s640/hotdogtopi.jpg
19:46 kyshtynbai joined #mojo
19:47 kyshtynbai Tell me please guys. While using non-Lite apps, should I define a separate controller for each route? Indeed, I can actully write a single controller and lots of actions in it. But should I? Is there some kind of good practice in this mvc paradigm?
19:49 Grinnz_ a controller is often expected to service multiple related routes
19:49 Grinnz_ how you structure it is up to you
19:50 jberger kyshtynbai: I often have many actions in a single controller
19:51 jberger not lots perhaps, but several
19:51 kyshtynbai I see. Guess it's up to me )
19:52 Grinnz_ it's really just a namespace
19:52 Grinnz_ in the form of a class
19:53 jberger think about what actions might want to share some functionality, but perhaps that functionality isn't quite global enough to be helpers
19:53 Grinnz_ a definite reason for keeping actions in the same controller would be if they run the same code, but you can always just extract that code to a common class instead
19:53 jberger not all controller methods need to be actions
19:53 Grinnz_ so it's really just organization
19:55 kyshtynbai I actually write my helpers which are responsible for "logic" in a separate namespace like Model, they are indeed "global" enough
20:10 jberger sure
20:11 jberger I have several 'model.<<thing>>' helpers
21:13 wingfold joined #mojo
21:30 woz joined #mojo
21:49 aggrolite joined #mojo
22:29 mattastrophe joined #mojo
22:29 bin_005 joined #mojo
22:31 woz joined #mojo
23:26 PryMar56 joined #mojo
23:33 bin_005 joined #mojo
23:46 woz joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary