Camelia, the Perl 6 bug

IRC log for #mojo, 2013-06-19

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

All times shown according to UTC.

Time Nick Message
00:24 egopro joined #mojo
00:28 shmuel joined #mojo
00:43 asarch joined #mojo
00:46 libsysguy joined #mojo
00:47 libsysguy sri is auto-dereference support coming in Mango in the latest release?
00:48 * libsysguy is jw
00:49 sri auto-dereferencing support?
00:49 libsysguy like http://search.cpan.org/dist/MongoDBx​-AutoDeref/lib/MongoDBx/AutoDeref.pm
00:50 sri maybe later, it's not on the todo list atm
00:51 libsysguy okay cool
00:55 sri i'm open for suggestions how to do it though
01:09 cooper joined #mojo
01:11 libsysguy I was thinking about taking a crack at it
01:12 libsysguy and maybe handing you a pull request
01:12 good_news_everyone joined #mojo
01:12 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/46qnHg
01:12 good_news_everyone mojo/master d75c25a Sebastian Riedel: better around_action tests
01:12 good_news_everyone left #mojo
01:12 sri libsysguy: no pull requests yet please
01:12 * libsysguy holds off
01:13 sri i'm more interested in design ideas
01:13 libsysguy I haven't looked at the source for that module
01:13 libsysguy but I would assume something recursive
01:14 sri you might have a steep learning curve ahead of you then
01:14 libsysguy heh
01:14 sri it's mixed blocking/non-blocking code
01:16 sri not a bad time to learn the internals though, next version will be quite a bit more complicated
01:17 * libsysguy is now afraid
01:17 sri async is hard, lets go shopping
01:18 libsysguy async is hard
01:18 libsysguy one blocking move and you're all screwed
01:25 good_news_everyone joined #mojo
01:25 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/z1M1Xw
01:25 good_news_everyone mojo/master cb9802c Sebastian Riedel: more consistent hook examples
01:25 good_news_everyone left #mojo
01:26 good_news_everyone joined #mojo
01:26 good_news_everyone [mojo] kraih tagged v4.16 at 3de7bb7: http://git.io/yPa1AA
01:26 good_news_everyone left #mojo
01:28 hesperaux_ joined #mojo
01:37 zivester joined #mojo
01:47 whitebook joined #mojo
01:53 tba joined #mojo
01:57 Meiermann joined #mojo
01:59 egopro joined #mojo
02:02 d4rkie joined #mojo
02:06 KindTwo joined #mojo
02:48 asarch joined #mojo
02:52 inokenty joined #mojo
03:15 tempire ugh
03:15 tempire this full time job stuff is for the birds
03:15 * tempire wants to work on the mojo core
03:16 tempire maybe a part time job is the ticket
03:19 whitebook joined #mojo
03:29 * crab finally understands that local::lib =~ PERL5LIB=...
03:31 egopro joined #mojo
03:44 sri if only there were more perl companies that hired people to work on open source projects
03:46 gtodd crab: it is DAH bomb
03:47 gtodd sri: I have this tingly feeling ... that there will be again :)
03:59 abstract joined #mojo
04:04 dwierenga joined #mojo
04:27 Psyche^ joined #mojo
04:31 amirite joined #mojo
04:34 sri tempire: btw. got an opinion on around_action? :)
04:50 mattastrophe joined #mojo
04:51 D4RK-PH0ENiX joined #mojo
04:53 jzawodn we're starting to think seriously about finally tossing mod_perl and apache for some of our work.  if that happens, we'll be hiring to partly work on the open source non-blocking perl based server we choose
04:54 d4rkie joined #mojo
04:57 asarch joined #mojo
05:02 duncanthrax joined #mojo
05:31 tempire sri: interesting
05:32 tempire I trust you've thought about implementing some sort of promises dsl
05:32 sri jzawodn: heh, i've been wondering why craigslist doesn't do that more often :)
05:33 sri tempire: f*ck promises!
05:33 tempire !?
05:33 rihegher joined #mojo
05:33 sri tempire: what's the actual gain?
05:34 sri i've actually thought a lot about it and read tons of stuff
05:34 preaction jberger and i were discussing that Mojo::IOLoop::Delay->steps does pretty much what one wants to do with promises
05:35 tempire easier to follow code. having a chain of promises is dramatically easier to follow
05:35 sri yes, they address fundamentally very similar problems
05:35 sri i get upset when people buy into promises/futures without considering the tradeoffs
05:35 sri tempire: give me a real example
05:37 sri IO::Async for example is going down the drain by mixing paradigms
05:37 tempire if your backends consist of n APIs, your API essentially becomes blocking unless you set a chain of ->on/once events
05:38 tempire steps is fine, but passing values via timer is a bit clunky
05:38 jzawodn sri: we'll have some open-source related stuff to talk more about publically in a few more weeks :-)
05:38 sri tempire: afraid i don't follow, maybe one of us is misunderstanding something
05:39 sri promises don't change any of the semantics of non-blocking code, they just make things look slightly different
05:40 sri and add fulfilled/rejected branches
05:40 sri maybe you're thinking of promises+coroutines
05:40 tempire yeah, that's my point.  Setting a chain of ->done's, for example, is nicer than setting ->on statements, and then starting the chain of events at the bottom an action.
05:41 sri tempire: maybe you need to show pseudocode
05:41 sri old vs new
05:41 sri personally, i'm convinced promises without coroutines are pointless and just more verbose
05:42 d4rkie joined #mojo
05:44 sri promises don't make ->on go away, promises are an alternative to callbacks that get invoked once, nothing else
05:45 sri like $ua->get('...' => $promise); $promise->done(sub {...});
05:46 sri or more idomatic my $promise = $ua->get('...'); $promise->done(sub {...});
05:47 sri it doesn't do anything for the ->on events $ua may emit
05:48 sri we have 3 basic types of event generators, ->on events for objects that emit many events at different times, callbacks that get invoked more than once, and callbacks that get emitted once
05:48 sri they all look very similar and make for great api primitives
05:48 sri (it's the same as in node.js)
05:49 sri promises in their basic form (promises/a+) can only make the 3rd type look a little different
05:49 sri yes, i've thought about this *a lot* :D
05:50 Britzel_ joined #mojo
05:51 sri my problem with promises is that people want to push them down to the primitives layer, i like steps more because they are always unobtrusive
05:53 sri with coroutines everything changes
05:54 sri my $promise = $ua->get('...'); my $tx = $promise->wait;
05:54 sri because you can do stuff like that
05:54 sri ->wait can even throw exceptions for the rejected branch
05:55 sri tempire: a must read ;) http://www.futurealoof.com/​posts/broken-promises.html
05:57 sri holy monologue batman, i better stop now ;p
05:59 basiliscos joined #mojo
06:05 TitanOfOld joined #mojo
06:10 cfedde reformat it into a blog post.
06:25 mattastrophe joined #mojo
06:28 Vandal joined #mojo
06:32 Mike-PerlRecruiter_ joined #mojo
06:38 dod joined #mojo
06:40 suy joined #mojo
06:45 sri naah, i wanted to blog about avoiding callback hell with delays though
06:46 dod joined #mojo
06:47 sri promises are in fashion around perl now because they are in fashion around javascript
06:48 sri difference however is that javascript is getting generators (almost coroutines), which will make promises not suck
06:49 sri should perl core ever get coroutines/generators i'll change everything to promises, but i doubt that's going to happen
06:56 maxhq joined #mojo
07:02 dpetrov_ joined #mojo
07:07 nicolaas joined #mojo
07:10 sri btw. anyone using promise chains doesn't use perltidy, try it... will make your eyes bleed :)
07:14 Drossel joined #mojo
07:16 trone joined #mojo
07:26 Kulag joined #mojo
07:27 davido joined #mojo
07:32 abra joined #mojo
07:49 kwa I was reading about future and curry yesterday after mst's example of using them in conjunction with Mojo::UA. That shit made my eyes bleed.
07:49 egopro joined #mojo
07:50 kwa None of the examples seemed to clarify what it was they were doing. I don't swallow documentation like some people, which is why I like Mojo's example first, reasoning second format.
07:50 kwa sri: btw, there's no json_like in Test::More. Is that for a reason?
07:50 kwa Sorry, Test::Mojo.
07:53 davido kwa: Recommended reading: http://hop.perl.plover.com/
07:54 kwa Cheers davido.
07:54 davido Here's the "legitimately free" version: http://hop.perl.plover.com/#free
07:55 davido That will provide FMTYEWTK about currying and futures.
07:56 davido and now i must sleep. :)
07:58 rem_lex|pivo joined #mojo
08:00 egopro_ joined #mojo
08:05 Kulag joined #mojo
08:06 abstract_ joined #mojo
08:11 rihegher left #mojo
08:12 jzawodn joined #mojo
08:13 marcus_ I have no mouth, and I must snore!
08:34 Mike-PerlRecruiter_ joined #mojo
08:49 fhelmber_ joined #mojo
08:51 alnewkirk joined #mojo
09:01 mire_ joined #mojo
09:18 egopro joined #mojo
09:23 arthas joined #mojo
09:23 Dandre Hello,
09:23 Dandre Can I use a Mojolicious Plugin in another plugin?
09:24 marcus_ joined #mojo
09:24 batman joined #mojo
09:38 yakudza joined #mojo
09:38 jamesaxl joined #mojo
09:44 duncanthrax joined #mojo
09:44 egopro joined #mojo
09:46 pertze joined #mojo
09:50 gautier joined #mojo
09:51 egopro_ joined #mojo
09:58 Dandre in fact I am planning to use a storage abstraction layer for my application. So I plan to write one plugin dedicated to each backend. One of tem will be MongoDB and I was planning to use Mojolicious::Plugin::Mongodb and this plugin has to be registered from my plugin
09:58 Dandre is this pattern allowed in mojo?
10:03 jamesaxl Dandre: it will be a good idea, i am sure mojolicious developers will agree they are open
10:07 marty joined #mojo
10:11 nic Dandre: Might be worth looking at Mango before MongoDB
10:11 nic Mango isn't ready for production, but some say MongoDB will never be ready for production :)
10:13 Jonis Whats the best way to pick out values from a json query and return only selected fields? I've got a $resultset which is json and I basically want to filter out a few bits before passing it on.
10:14 Dandre nic ok I'll look at it
10:15 ryozi joined #mojo
10:19 nic Jonis: I convert to a perl object then manipulate then convert back
10:19 nic I haven't yet dealt with any huge json tho
10:23 Jonis ok, thanks.
10:23 Jonis New to perl and mojo, just in the past week. Bit of a steep learning curve at the moment :)
10:25 nic oh you lucky lucky lucky
10:26 nic so you haven't spent years ploughing through Twentieth Century perl -- I envy you :)
10:26 Jonis ;)
10:28 jamesaxl could you show me what is the default root that mojolicious apps use , because i want to upload file i have only some problem in path
10:29 nic jamesaxl: Is your main app script in a directory called 'scripts'?
10:30 nic s/scripts/script
10:30 jamesaxl nic: the script in the directory called dwim
10:30 nic jamesaxl: A Lite app or a full app?
10:30 jamesaxl nic: it is a full app
10:31 nic I recommend putting it into a dir called 'script'
10:31 nic Actually, the best thing to do is run "mojo generate app Dummy"
10:31 nic and then look at what it generates "find dummy" and then copy that for your own app
10:32 nic Mojolicious does actually let you put stuff whereever you want, but that's a complication I recommend avoiding
10:32 jamesaxl nic: thank you very much dude
10:32 nic np
10:46 batman joined #mojo
10:46 marcus_ joined #mojo
10:48 sri kwa: curry is actually pretty nice
10:50 amirite joined #mojo
10:50 sri kwa: because json_like doesn't make sense
10:51 kwa It seems that way. I couldn't find an example relevant to me which is why I couldn't quite get it.
10:51 kwa sri: How so? I found a reason for it while testing my RESTful software.
10:52 kwa Ah wait, I get you.
10:52 sri it's just a nice way to write $foo->curry::bar('baz') instead of weaken $foo; sub { $foo->bar('baz') }
10:53 kwa I had the need to test a resource key with a regular expression though.
10:55 kwa Ahh, it might have been its combination with future and mojo ua then. What's the benefit of passing $ua->get($url, $future->curry::done); ?
10:55 sri less ugly code
11:08 kwa Re: Test::Mojo. I had a need to test the url returned in the document. E.g., ->json_like('/companies/0/links/greetings' => qr,/companies/greetings\.json,); # or whatever
11:08 kwa Settled on a json_has though. :)
11:15 sri Bender: trust marcus
11:15 Bender OK, sri
11:19 maxhq joined #mojo
11:21 marcus_ joined #mojo
11:21 batman joined #mojo
11:25 marcus_ \m/
11:26 marcus_ batman++ # Fixed wirc
11:26 batman :)
11:26 batman marcus_++ # merging like there-is-a-presentation tomorrow
11:29 Jonis is it possible to use url_for in a js script that's being served by mojo? or do you need to do .js.ep for that to work?
11:35 libsysguy joined #mojo
11:44 trone joined #mojo
11:48 marcus_ sri: I'm having some trouble updating a bit of code from mojo 3 to mojo 4: https://gist.github.com/marcusramberg/5813679 - I know that ->write has been removed from Mojo::Message, but I'm not sure how to get this back on track.
11:48 whitebook joined #mojo
11:48 marcus_ sri: tried changing to using $tx->client_write, but it didn't seem happy.
11:54 marcus_ I also find that changelog entry a bit unhelpful, since it doesn't say what to use instead. :-/ Like, we could say removed is_multipart in favor of content->is_multipart
12:00 marcus_ I see content->write is the right thing to do as well.
12:01 depesz hi
12:01 depesz I have a ->bridge() will callback, and, "attached" to this bridge, I have ->get( '/whatever/:name' );
12:01 depesz what is the proper way to get value of :name in callback in the bridge?
12:02 depesz I see I could get it from $app->match->stack->[-1]->{'name'}
12:02 depesz but it somehow doesn't look sane.
12:04 libsysguy depesz this may be a naive answer but doesn't the value of name get poked into the stash?
12:05 libsysguy so you can access it with $app->stash->{name}
12:05 depesz well, i'm trying to make the bridge callback as simple as possible
12:06 depesz so, i might have another bridged ->get (/xxx/:name/:other)
12:06 kwa depesz: Yeah, that's how you get it.
12:06 depesz and I'd like to avoid having to enumerate all possible "params" that I might use in all possible bridged requests
12:06 kwa I think the bridge used to have captures, but that was removed in around 4.
12:07 depesz yeah, but I don't want to bridge to have captures, but for it to catch captures from ->get/->post that are connected to it.
12:07 * libsysguy sits and awaits the day I run into this issue
12:07 depesz well, the bridge is there for acl.
12:08 depesz whether user has access to given path depends not only on which controller it handles but also on what captures there are.
12:08 depesz as user "a" can have access to /whatever/xxx, but not /whatever/yyy, and user b might have access to both.
12:08 depesz so, maybe there is better approach at the acl thing
12:09 nic This sounds like a job for...
12:09 depesz i just though about it as pretty natural - i define one, shared acl, which checks in database who has access to which parts of which routes, and allows accordingly
12:09 nic Super Authorization
12:10 kwa Your problem seems to have spiralled into a bigger issue than the original.
12:10 depesz that's a project that I'm using to learn mojo on, so i'm not attached to any particular solution. I'd just prefer not to duplicate code.
12:10 nic (Is there a unicode character for a caped superhero?)
12:10 kwa nic: There's gotta be.
12:11 depesz kwa: sorry.
12:11 kwa nic: If there's a snowman, there's a superhero.
12:11 depesz should I provide more context to my problem?
12:11 nic :)
12:11 depesz "caped snowman"
12:11 kwa depesz: I follow you, I think.
12:11 depesz great.
12:11 kwa I am doing something similar, where I have an $auth bridge.
12:12 nic I think, therefore I am.  Hence 'I follow you' => 'I am'
12:12 depesz kwa: any idea on how to *sanely* get all captures to given request, but not from the request itself, but a bridge?
12:13 kwa depesz: I believe it's from the matched stack, as you pasted.
12:14 kwa Oh, actually. You're referring to captures which aren't part of the bridge.
12:14 depesz yes.
12:14 depesz moemnt. let me show you some psuedo code which shows the problem
12:16 kwa OK, coz I'm struggling to think what you're using the captures are part of authentication for.
12:16 * kwa realises that sentence makes no sense
12:17 depesz http://depesz.privatepaste.com/5645d93fd7
12:17 depesz this should explain
12:22 kwa I'm trying to think if that's the best way to arrange the urls.
12:23 kwa # /:account/domains/:domain, /:account/data
12:25 kwa Anyway, I believe the bridge will get access to the captures. I have my $auth = $r->bridge->to('bridge#authenticate'); then $auth->route('/companies/:compan​ies_id')->to('companies#list'); which the bridge can inspect the stack to get :companies_id.
12:27 depesz kwa: yeah, i know i can get it from stack.
12:27 depesz it's just that it doesn't look "nice"
12:27 depesz this ->[-1] thing
12:27 depesz as for "best way to arrange urls"
12:27 depesz i'm open for suggestsins - this is web interface to email system (not webmail, administrative interface)
12:28 kwa heh, well that's all that's available.
12:28 depesz so, the domain-* accounts get data for given domain. and there are multiple users which can run this - depending on which domain it is, and which domains given user has access to.
12:29 kwa As I mentioned, in 4.0 - Removed captures attribute from Mojolicious::Routes::Match.
12:29 depesz kwa: ok, so $app->match->stack->[-1], right? that's all I can hope for?
12:29 kwa Pretty much.
12:29 abra joined #mojo
12:29 depesz ok. if it's *the* way, then it's the way I'll use.
12:31 kwa depesz: To give you a bit of assurance, when I had a problem with respond_to in my bridge, sri used that method of retrieving the captures from the stack.
12:31 depesz that makes it as official as one can hope for :)
12:32 kwa I don't know the technical reason, however. He just asked me what I used captures for. :)
12:42 iankent qq, whats the 'proper' way to do constructors with Mojo::Base, or is it just as simple as create new and call mojo::base->new from that?
12:48 depesz iankent: i would say that "use base 'Mojo::Base';" is enough.
12:48 depesz ah. you want your own constructor, sorry, missed that
12:51 d4rkie joined #mojo
12:59 nic iankent: yep, ->SUPER::new(@_)
13:04 nicolaas_ joined #mojo
13:04 iankent thanks both, thought i'd tried that already but apparently not :)
13:06 Jonis Whats the default location of plugins in a full app?
13:13 depesz Jonis: I use $self->plugins->namespaces( [ "App::Plugin", @{ $self->plugins->namespaces } ] );
13:13 depesz Jonis: and then I put it in lib/App/Plugin/
13:26 nikita joined #mojo
13:27 nikita hi, have anyone used mojolicious with zeromq?
13:28 whitebook joined #mojo
13:29 Jonis depesz: thanks :)
13:34 Mikey nikita: i have!
13:34 jamesaxl_ joined #mojo
13:51 nic Jonis: Plugins can be under any point in your @INC path
13:52 mire_ joined #mojo
13:53 nic nikita: If you search the irc log I'm sure you'll find mention of zeromq (I just can't remember who was talking about it)
13:53 nic :P  (just seen Mikey's reply :) )
14:04 ColonelPanic001 joined #mojo
14:31 nikita nic: i'm reading it right now
14:59 yakudza joined #mojo
15:02 mattastrophe joined #mojo
15:11 Dandre sri: hello,
15:12 Dandre do you have a planned date for mango release?
15:13 Dandre I mean production ready release
15:16 Britzel_ joined #mojo
15:17 tianon he's currently working on rewriting the core, so probably not for a while ;)
15:21 moltar joined #mojo
15:25 xxtjaxx joined #mojo
15:33 lammel2 joined #mojo
15:34 sh4 joined #mojo
15:36 xaka joined #mojo
15:41 asarch joined #mojo
15:46 mire_ joined #mojo
15:49 btyler joined #mojo
16:03 basiliscos joined #mojo
16:05 mattastrophe joined #mojo
16:07 Dandre ok but could it be available by next september or october?
16:20 tianon I would guess that'd be a no, especially for production - sri is still looking very much at overall driver design (and as far as he's told us, playing with different things locally without committing them to some pretty branches), so right now a ton of stuff is very much subject to change on a whim
16:24 whitebook joined #mojo
16:29 Dandre ok
16:50 libsysguy joined #mojo
16:56 basiliscos joined #mojo
17:08 Kulag joined #mojo
17:12 mire_ joined #mojo
17:27 good_news_everyone joined #mojo
17:27 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/SIKNVw
17:27 good_news_everyone mojo/master 47a4dbe Sebastian Riedel: fixed streaming recipe in cookbook
17:27 good_news_everyone left #mojo
17:33 sri Dandre: no
17:35 sri kwa: ->captures was just a copy of ->stack->[-1], otherwise absolutely nothing changed since 0.9 or so
17:44 mire_ joined #mojo
17:53 bluescreen joined #mojo
17:56 mattastrophe joined #mojo
18:01 depesz sri: ok, so using ->stack->[-1] is *the* way to get captures?
18:02 sri captures that don't belong to the current action
18:02 depesz in case like here: http://depesz.privatepaste.com/5645d93fd7
18:03 btyler joined #mojo
18:29 dpetrov_ joined #mojo
18:31 Mike-PerlRecruiter_ joined #mojo
18:32 abra_ joined #mojo
18:35 mire_ joined #mojo
18:35 xxtjaxx How could you create a timer on mojolicious side sending websocket messages to the client.
18:36 xxtjaxx I'm thinking Mojo::IOLoop but it seems not very clear to me.
18:40 libsysguy joined #mojo
19:03 Drossel joined #mojo
19:16 jamesaxl joined #mojo
19:22 dod joined #mojo
20:02 whitebook joined #mojo
20:13 davido joined #mojo
20:22 hesperaux__ joined #mojo
20:30 SmokeMachine joined #mojo
20:53 zekame left #mojo
21:26 tba qq, does anything in mojolicious affect default perl behaviour in module loading, imports or file handling? I get very strange errors from spamassassin module which I can't replicate outside of mojolicious :/
21:32 cfedde do you have a small example that demonstrates the problem?
21:33 lukep joined #mojo
21:33 tba just trying to put one together
21:35 tba im not too worried, i was planning on calling spamd anyway, was just hoping for a shortcut - and honestly I don't think it'll be mojolicious, just running out of ideas :p
21:36 tba but it seems replicating it isn't as simple as just instantiating spamassassin :(
21:36 cfedde ouch!
21:37 tba its odd, im basically getting bareword not allowed while strict subs in use, in almost every spamassassin module, even though the 'use Errno/Fcntl's are there, and it works if I use spamassassin alone
21:38 tba (on O_WRONLY consts etc)
21:47 tba well i've concluded its not mojolicious, so thats good :) finally replicated it outside of my mojolicious app! just another pile of modules to work through :p
21:48 jamesaxl_ joined #mojo
22:27 whitebook joined #mojo
22:34 mire_ joined #mojo
22:35 russum joined #mojo
22:57 sri marcus_: btw. you're supposed to point those things out *before* a release
23:01 cooper joined #mojo
23:03 hesperaux joined #mojo
23:03 Averna joined #mojo
23:04 hesperaux_ joined #mojo
23:36 hesperaux__ joined #mojo
23:50 btyler joined #mojo
23:55 jnbek joined #mojo

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