Camelia, the Perl 6 bug

IRC log for #mojo, 2013-04-05

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

All times shown according to UTC.

Time Nick Message
00:02 borkur Entering '<script src="file.js"></script>' in the template has the same effect as "%= javascript 'file.js'".
00:03 Akron joined #mojo
00:06 d4rkie joined #mojo
00:07 Akron borkur: And the problem is, your file can't be found?
00:09 borkur Solved. Created folder 'public/js' and put my js files there. Added "%= javascript 'js/file.js'" to the template.
00:13 Akron For example. You can also add these files to data templates.
00:31 Akron joined #mojo
00:38 ispy_ joined #mojo
00:38 mattastrophe joined #mojo
00:39 mattastrophe_ joined #mojo
00:44 shmuel joined #mojo
00:48 jberger joined #mojo
00:51 Akron sri: Your timing fixes mean, that my delay-stuff should be fine now - although it's not perfect, as their can happen stuff in between that may break the chain?
00:56 jpn joined #mojo
00:58 sri hmm, i think i might have a solution for the problem from earlier
01:00 Akron I guess it's not a nice problem to think about for hours. ;)
01:02 ispy_ joined #mojo
01:07 good_news_everyone joined #mojo
01:07 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/iaCgxA
01:07 good_news_everyone mojo/master 3afd358 Sebastian Riedel: fixed another timing bug in Mojo::IOLoop::Delay
01:07 good_news_everyone left #mojo
01:07 sri the idea is actually from step.js, turns out it actually did solve the problem
01:07 sri sooo
01:08 sri marcus, judofyr, tempire, crab, jberger, Akron: are we sure it should work that way?
01:09 sri https://github.com/kraih/mojo/​blob/master/t/mojo/delay.t#L81
01:09 sri the affected test case
01:14 Akron sri: I don't get https://github.com/kraih/mojo/commit/3afd3​58b26812eba2d59bd956907aeb61725f7bd#L1R59 (the unless)
01:15 sri oops
01:16 Akron So - the timer ensures the begin of the next step if the counter is not null. I have to figure out the differences ... that's hard.
01:17 sri yea, i just count the number of ->begin calls
01:18 sri so i know something happened that should trigger the next step
01:18 sri even if the non-blocking API in question was stupid and invoked the callback right away
01:19 sri still not sure if Mojo::IOLoop->next_tick(sub {}) should be an alternative to Mojo::IOLoop->timer(0 => sub {})
01:20 sri i seem to be using zero timer more and more often to defer execution
01:20 sri *s
01:25 Akron ->next_tick doesn't look that good.
01:26 ka2u joined #mojo
01:26 sri can also be ->defer
01:26 sri next_tick looks good next to one_tick though
01:27 jberger sri: the test case looks good
01:27 jberger can't say I'm 100% sure what the code is doing, but I trust you :-)
01:28 jberger the test seems to do what I would expect (and better, what is documented)
01:28 sri perl -Ilib -Mojo -E 'Mojo::IOLoop->delay(sub { Mojo::IOLoop->timer(0 => shift->begin) }, sub { shift->begin->() }, sub { say "BOOM!" })->wait;'
01:28 Akron ->defer looks good. I prefer long, complicated method names for complicated, dangerous stuff. Nice, fluffy methods should be save and warm.
01:28 sri it makes that code go BOOM ;p
01:29 Akron I agree with jberger.
01:31 jberger BOOM!
01:32 Akron Pretty dwim now.
01:32 Akron sri++
01:34 * jberger is failing to find a youtube video of John Madden saying boom
01:39 jb360 joined #mojo
01:45 good_news_everyone joined #mojo
01:45 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Cj3eyg
01:45 good_news_everyone mojo/master cd04cd8 Sebastian Riedel: better timing tests for delays
01:45 good_news_everyone left #mojo
01:56 Meiermann joined #mojo
01:57 egopro joined #mojo
02:01 jb360 sri: In Struts2 I have the ability to create and layer multiple filters that wrap a request, just like the around_dispatch.  My question is can I create multiple around_dispatch hooks?
02:06 zacts joined #mojo
02:07 jpn left #mojo
02:16 ispy_ joined #mojo
02:19 basiliscos joined #mojo
02:22 KindTwo joined #mojo
02:28 hesperaux joined #mojo
02:37 egopro joined #mojo
02:45 egopro_ joined #mojo
02:56 preflex_ joined #mojo
02:59 egopro joined #mojo
03:00 Averna joined #mojo
03:00 good_news_everyone joined #mojo
03:00 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/CPhPCQ
03:00 good_news_everyone mojo/master df75f0c Sebastian Riedel: small optimizations
03:00 good_news_everyone left #mojo
03:05 egopro_ joined #mojo
03:29 D4RK-PH0ENiX joined #mojo
03:39 egopro joined #mojo
03:40 xaka joined #mojo
03:45 d4rkie joined #mojo
03:46 egopro joined #mojo
03:49 sh4 joined #mojo
04:23 asarch joined #mojo
04:26 zacts joined #mojo
05:08 davido joined #mojo
05:16 sh4|2 joined #mojo
05:40 ver joined #mojo
05:41 ka2u joined #mojo
05:50 coff joined #mojo
06:13 dpetrov_ joined #mojo
06:16 mattastrophe joined #mojo
06:30 mattastrophe joined #mojo
06:43 arthas joined #mojo
06:44 dod joined #mojo
06:48 dod joined #mojo
06:50 Vandal joined #mojo
07:04 hesperaux joined #mojo
07:22 dod joined #mojo
07:25 suy joined #mojo
07:41 judofyr joined #mojo
07:49 marcus joined #mojo
07:49 batman joined #mojo
07:53 jzawodn joined #mojo
08:02 ka2u joined #mojo
08:11 fhelmber_ joined #mojo
08:21 maxhq joined #mojo
08:32 basiliscos joined #mojo
08:33 zacts joined #mojo
08:38 jpn joined #mojo
09:00 rem_lex| joined #mojo
09:01 D4RK-PH0ENiX joined #mojo
09:30 d4rkie joined #mojo
09:45 egopro joined #mojo
10:20 egopro joined #mojo
10:34 mire joined #mojo
10:39 Britzel joined #mojo
10:48 bowtie joined #mojo
11:01 Vandal joined #mojo
11:21 egopro joined #mojo
11:22 zacts joined #mojo
11:54 moltar joined #mojo
12:08 marcus joined #mojo
12:09 batman joined #mojo
12:12 coff joined #mojo
12:22 egopro joined #mojo
12:35 jb360 joined #mojo
12:49 Kripton joined #mojo
12:50 mire joined #mojo
12:54 jfuller joined #mojo
12:59 marcus Hmm
13:00 marcus Quiet today
13:00 jfuller Greatings folks. I have a question regarding OAuth2. I have a couple api's built with mojolicious that I would like to add an OAuth2 provider on. Yesterday, when I starting looking to see what is available, mst recommended CatalystX::OAuth2, which appears to be a good implementation that I am planning on using with my catalyst sites. However, this won't work with my mojolicious sites, so I...
13:00 jfuller ...am trying to figure out if it would make the most sense to port CatalystX::OAuth2, or try to graft on pieces of OAuth::Lite2. Any recommendations?
13:01 marcus Jfuller: I have started on an implementation, but not gotten very far yet.  I
13:01 marcus I think catalystx::OAUth is a bit more complicated than necessary.
13:03 jfuller marcus: That is entirely possible. I am debating just putting together a barebones implementation based on this spec: https://github.com/Mashape/mash​ape-oauth/blob/master/FLOWS.md
13:20 bluescreen joined #mojo
13:22 egopro joined #mojo
13:23 sri i guess that means everybody is happy with delays now
13:23 judofyr happy happy happy
13:23 judofyr sri: did you deprecate anything?
13:25 sri https://github.com/kraih/mojo/compare/71f​6603e8b888906d2aa7354fbe07ac6486b66c3...d​f75f0c9cce2016379a7177215a088865c96d09d
13:27 judofyr sri: did you fix all the ->begin->() problems too?
13:27 sri the oneliner you wanted to go BOOM yesterday, does go BOOM now
13:27 sri yes
13:28 sri step.js had an ok solution already, i just used that
13:29 sri https://github.com/kraih/mojo/blo​b/master/lib/Mojo/IOLoop/Delay.pm
13:29 sri it looks a bit messy with the deprecations, but should be fine without them
13:31 judofyr sri: a step without any ->begin still triggers finish?
13:31 sri https://github.com/kraih/mojo/​blob/master/t/mojo/delay.t#L81
13:31 sri the test case
13:31 sri yes
13:31 judofyr ah, right
13:32 judofyr I think either behavior is fine in that case
13:32 judofyr I guess early return could be useful
13:32 sri we need to trigger finish since ->wait only stops when it get emitted
13:33 judofyr and it's trivial to add a $delay->begin->() to force it to jump to the next step
13:33 * sri nods
13:34 judofyr sri: I'm just thinking about code like: $self->get($id, $delay->begin) if $id;
13:34 judofyr it might seem odd that it just stops executing the rest of the steps if $id is falsy
13:34 sri there is also code like Foo->whatever($delay->begin) that invokes the callback right away (for errors maybe)
13:35 judofyr yeah, but that is working fine now
13:35 sri yea
13:35 sri i don't think it's odd
13:35 sri i explained it pretty clear in the docs
13:36 sri https://github.com/kraih/mojo/blob/m​aster/lib/Mojo/IOLoop/Delay.pm#L163
13:36 judofyr intuitively it feels odd, but I can see the use cases
13:37 sri it's an important use case imo
13:37 judofyr and it's an edge-case anyway
13:37 sri it's what started this whole discussion :)
13:37 judofyr :)
13:38 judofyr sri: thought about introducing future/promise in Mojo 4? :D
13:39 sri futures/promises are not so great without coroutines imo
13:39 judofyr I find them marginally better than delay
13:39 judofyr but yeah, the cool stuff comes with coro
13:57 Meiermann joined #mojo
14:04 gryphon joined #mojo
14:14 gtodd sri: coroutines .. that sounds interesting is it a perl6 thing or ... well, is perl6 a blocker for Mojolicious 4 ? :-)
14:14 sri see Coro on CPAN
14:15 sh4 joined #mojo
14:15 gtodd ok thanks .... I remember reading perl6 will "have coroutines" ... so waited patiently for it to show up in perl5
14:15 sri perl6 will have real threads, it's a whole new world
14:16 sri i would just go with actors there and not look back
14:22 sri damn, this looks extremely useful https://metacpan.org/module/IO::FDPass
14:24 gtodd hmm everyone likes node.js ... but perl6 will haz many cool things too
14:25 sri comparing node.js to perl6 is silly
14:26 sri one is an unfinished general purpose programming language and the other an event loop that can be scripted with javascript
14:29 judofyr a whole new world!
14:30 jhthorsen joined #mojo
14:34 mugenken joined #mojo
14:38 denisboyun joined #mojo
14:41 labrown joined #mojo
14:43 sh4|2 joined #mojo
14:53 ispy_ joined #mojo
14:53 mire joined #mojo
14:53 egopro joined #mojo
14:54 MeierM joined #mojo
14:54 d4rkie joined #mojo
14:54 d4rkie joined #mojo
14:58 sri gtodd: anyone could build a proper perl binding for libuv and we would have the exact same features as node.js in perl
14:59 xaka joined #mojo
15:01 jhthorsen sri: even garbage collection..?
15:02 sri no it does not magically turn perl into javascript -.-
15:02 jhthorsen ;)
15:03 sri but that reminds me
15:04 sri maybe Mojo::Base should import weaken and blessed automatically, considering how much we use and encourage evented apps
15:04 jhthorsen +1 on weaken
15:05 batman yeah! +1 from me as well
15:05 * jhthorsen is batman :)
15:14 inokenty joined #mojo
15:14 alester joined #mojo
15:24 egopro joined #mojo
15:37 btyler joined #mojo
15:38 kbenson joined #mojo
15:39 diegok +1 on weaken :)
15:41 kbenson has anyone seen framework roundup techempower.com has been doing? http://www.techempower.com/blog​/2013/04/05/frameworks-round-2/
15:43 kbenson They take pull requests to add new frameworks.  I've been wanting to add mojolicious since part 1 last week, but haven't had any time, so I figured I'd mention it here in case someone can get to it before me
15:52 rihegher joined #mojo
15:53 Akron joined #mojo
15:55 egopro joined #mojo
15:55 suy "In this test, the server's response is a single trivial newly instantiated in-memory object serialized to JSON"
15:56 suy ???
15:59 suy kbenson: They seem to compare frameworks with odd tests in the most trivial form. What's the point of such tests?
15:59 suy serializing a hello world JSON, wut? :-o
16:09 whitebook joined #mojo
16:11 kbenson suy: I think their assumption is that a lot of work that frameworks is to send messages back and forth from a front-end, so they are testing message passing capability
16:12 kbenson There's plenty wrong, but that's the case with all benchmarks.
16:13 kbenson The link to the first round at the top of this round may explain some of their methodology better
16:13 xaka joined #mojo
16:14 kbenson Specifically, from their "expected questions" section of the first round:  ' "Why doesn't your test include more substantial algorithmic work, or building an HTML response with a server-side template?" Great suggestion. We hope to in the future! '
16:16 kbenson So I guess what they are testing right now is how much the framework itself limits the scalability.  That's a valid question, but it's importance changes with your needs.
16:16 bobkare joined #mojo
16:16 bluescreen_ joined #mojo
16:21 sri argh... performance != scalability
16:21 sri erlang is terribly slow, but scales insanely well
16:23 sri anyway, if you pick your web framework based on performance, this is what you end up with https://github.com/kraih/mojo/bl​ob/master/examples/microhttpd.pl
16:24 sri have fun!
16:24 inokenty =)
16:27 kbenson sri: Is that a "I'm not interested in this, these guys are stupid" or just "The methodology is flawed, but hey, why not?"
16:27 sri neither, just saying how it is
16:28 sri i mean, look at the table, the further you go down the higher level the frameworks are an the more features you get, who would have thought! :)
16:28 sri it's stating the obvious
16:28 kbenson yeah, and that's fairly obvious
16:29 kbenson but still, pretty graphs with pretty colors are fun to look at. :)
16:30 sri the only point would be to compare the code, to see how things are done in different languages
16:30 sri not a benchmark
16:30 mugenken_ joined #mojo
16:30 kbenson yeah.  But I'm not discounting that as a later possibility, since they are automating most/all of this.
16:31 sri and i'm pretty sure the list does not cover any best practices, netty for a simple web app, seriously?
16:31 kbenson It would be interesting later if it evolved to show how to do a few higher level things (implement a few simple sample apps), and compared across them.  Kinda like the language shootout (which is probably a bad comparison, as that's flawed as well.  Or maybe that makes it a good comparison...)
16:32 sri so it's a pretty low quality comparison for code
16:33 kbenson I agree, but I'm an optimist by nature, and hope they can pull somethign more useful off later. :)
16:33 rihegher left #mojo
16:33 sri i've seen a dozen such comparisons in the last few years, they all just vanish again
16:33 sri and every time i point out the same things ;p
16:34 kbenson I imagine it must get frustrating ;)
16:35 sri not anymore, got used to it
16:36 kbenson I've had an idea for a site that might prove more useful for stuff like this (and language comparisons in general) by not focusing on performance alone (or much at all), but idioms, and how to accomplish a concept in a language, to give really easy comparisons for simple things.
16:36 kbenson No tuits.  Never enough...
16:37 sri that doesn't really work, you can't compare haskell and ruby
16:38 sri oh, at this point i usually mention that frameworks are about optimizing for programmer performance, so a real benchmark would compare how quickly you can build the same app in different languages
16:39 dod joined #mojo
16:39 kbenson You can't say "Iterate over a list of strings and transform by reversing the strings"? or other simple, illustrative ideas?
16:39 kbenson okay, I'm going into tangential overload.  I have about 4-5 things I would really love to go into depth on right now...
16:40 sri benchmark the programmer performance of a perl -Mojo oneliner against netty! ;p
16:40 kbenson but in short, yes, I entirely agree that frameworks are for letting you accomplish your task with the least conceptual and implemtation friction
16:42 kbenson which is why I wasn't really asking to see Mojolicious on that list so I could point at performance, but just so *hopefully* if some better (i.e. I care about them more) metrics came out it would be represented in some small amount
16:44 sri https://github.com/TechEmpower/Framewo​rkBenchmarks/blob/master/netty/src/mai​n/java/hello/HelloServerHandler.java # hahaha
16:45 kbenson Yeah, and I would LOVE to see that (code length, etc) compared to something like Mojolicious
16:45 sri but that reminds me, i kinda like how netty does protocol abstraction, i'm sure there's a lot of inspiration if anyone wants to work on https://github.com/kraih/mojo/issues/423
16:45 kbenson but you are right, it doesn't compare that at all right now
16:57 egopro joined #mojo
17:05 rhaen I am not sure if should you the Win32::Registry as model for Mojolicious for storing binary data.
17:05 rhaen Should we?
17:05 labrown joined #mojo
17:06 rhaen (just kidding) - hello channel!
17:06 gtodd left #mojo
17:06 gtodd joined #mojo
17:06 gtodd left #mojo
17:20 heytrav joined #mojo
17:54 heytrav joined #mojo
17:57 Akron Hi rhaen!
17:58 egopro joined #mojo
17:59 Akron sri: Will there soon be a 3.93 on cpan (delay improved)?
18:01 sri yea
18:01 sri still thinking about weaken import for Mojo::Base and Mojo::IOLoop->defer()
18:02 Akron I'm pro weaken.
18:02 Akron I'm unsure regarding blessed.
18:03 Akron Thanks.
18:09 beyondcreed joined #mojo
18:29 egopro joined #mojo
18:29 lammel2 joined #mojo
18:36 jberger_ joined #mojo
18:36 jberger_ o/
18:37 jberger_ I can't be on a lot this week, last week of typing on my thesis, but I will read the backlog in my breathers
18:37 jberger_ I'm generally +1 on weaken, and probably blessed too
18:37 jberger_ then again, this is rather fun: https://metacpan.org/module/curry
18:38 denisboyun joined #mojo
18:40 mire joined #mojo
18:41 sh3 joined #mojo
18:42 * sri agrees
18:51 jberger_ god this last week has been miserable: https://github.com/jberger?tab=​contributions&amp;period=weekly
19:00 egopro joined #mojo
19:05 sri jberger_: the fact that very few people actually understand what curry does could be problematic though, especially for examples
19:07 jberger_ of course
19:07 sri mojolicious uses weaken 44 times :o
19:08 jberger_ and it is only of value if your callback only needs to call one method
19:08 jberger_ it wasn't a real suggestion
19:08 jberger_ just a sidenote
19:09 jberger_ WEAKEN ALL TEH THINGS
19:09 sri we have a cookbook example "weaken $tx; $tx->req->content->on(upgrade => sub { $tx->emit('request') });"
19:10 sri it would be nice if it could become "$tx->req->content->on(upgrade => $tx->weak::closure::emit('request'));"
19:10 jberger_ :D
19:10 sri but i just don't see people understand that :/
19:11 jberger_ indeed
19:11 sri mst++ # it's a fun idea
19:13 sri $tx->in::closure::emit('request')
19:13 mst sri: $tx->curry::weak::emit('request') might already do that
19:13 sri mst: it does
19:13 mst sri: see also the way I use start:: and then:: in Object::Remote
19:14 sri i just don't see people grok that ;)
19:14 mst I've found future based APIs seem to work a lot better for people
19:16 sri mst: which kind?
19:18 mst $client->start::connect($device)->then:​:send($command)->then::await($regexp);
19:18 mst equivalent to
19:18 mst $client->async_connect($device, sub { $_[0]->send($command, sub { $_[0]->await(qr/.../, sub { ... }
19:18 sri ah, Promises/A style
19:21 sri http://wiki.commonjs.org/wiki/Promises/A # the latest hipness judging by my twitter stream
19:22 jberger_ my twitter feed recently featured this: http://vanilla-js.com/ # hehe
19:22 sri but i agree, might be worth researching in that direction
19:22 mst right, and IO::Async is moving substantially towards that
19:23 * sri wonders who will be the first to steal the "then" namespace
19:24 zacts joined #mojo
19:25 jberger_ cpanm then ... Fetching http://www.cpan.org/authors/id/M/MS/M​STROUT/Object-Remote-0.003002.tar.gz ... OK
19:26 sri oh, Object::Remote already kinda hijacked it... and more
19:26 sri (╯°□°)╯︵ ┻━┻
19:27 jberger_ <<sri always curses in unicode>>
19:29 ispy_ joined #mojo
19:30 sri perhaps the next step will be prefixes ;p
19:30 sri $client->mojo_async::connect()->mojo_then::send()
19:31 egopro joined #mojo
19:31 sri although, i can imagine us taking the "mojo" namespace for promises
19:32 jberger_ mojo::async::connect
19:32 * sri nods
19:32 sri one AUTOLOAD to rule them all
19:32 jberger_ One does not simply trick the dispatcher
19:42 sri i'm not sold on promises yet though
19:51 sri looks like Mojo::IOLoop->defer() has no support and weaken export by Mojo::Base has some support
19:53 jberger_ sri: I didn't vote on defer, because I haven't needed it
19:53 sri it's just syntax sugar
19:53 jberger_ however I think that its much more self-explainitory than timer( 0 => sub{})
19:54 sri Mojo::IOLoop->defer(sub {...}) would be equal to Mojo::IOLoop->timer(0 => sub {...})
19:54 jberger_ I would find that more readable, should I, say, be reading someone elses code
19:54 mst ->defer is equivalent to $loop->later in IO::Async
19:54 mst very useful, but very different thing
19:54 sri and .nextTick() in node.js :)
19:55 mst sri: I wasn't until I used them for Object::Remote and then I was addicted
19:55 mst they made total sense for the wire protocol part
19:55 mst I don't have a way to return a value
19:55 mst I just send a future that'll get ->done()d when the far side finishes
19:55 mire joined #mojo
19:56 sri i could see them become popular the way you implemented them
19:58 sri on the other hand, i already get a headache thinking about how to explain them in docs :)
19:59 mst right, Promises/A in javascript is kinda 'insufficient damn sugar'
20:02 egopro joined #mojo
20:09 njlg joined #mojo
20:13 BeDa joined #mojo
20:16 sh4 joined #mojo
20:30 zacts joined #mojo
20:33 egopro joined #mojo
20:42 ispy_ joined #mojo
20:53 pundit joined #mojo
21:00 sh3 joined #mojo
21:02 basiliscos joined #mojo
21:03 egopro joined #mojo
21:09 basiliscos joined #mojo
21:13 basiliscos joined #mojo
21:27 basiliscos joined #mojo
21:36 basiliscos joined #mojo
21:44 good_news_everyone joined #mojo
21:44 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/MDJbGg
21:44 good_news_everyone mojo/master 4286984 Sebastian Riedel: a few more delay tests
21:44 good_news_everyone left #mojo
21:45 good_news_everyone joined #mojo
21:45 good_news_everyone [mojo] kraih tagged v3.93 at 7680b4d: http://git.io/LTigEw
21:45 good_news_everyone left #mojo
21:47 zacts joined #mojo
21:50 good_news_everyone joined #mojo
21:50 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Wnkp7g
21:50 good_news_everyone mojo/master c3afdee Sebastian Riedel: removed deprecated start method from Mojolicious::Commands
21:50 good_news_everyone left #mojo
21:51 sri hopefully we are done with delays for now
22:05 egopro joined #mojo
22:05 whitebook joined #mojo
22:07 whitebook joined #mojo
22:26 mattastrophe joined #mojo
22:34 mattastrophe joined #mojo
22:36 egopro joined #mojo
22:52 jberger_ joined #mojo
23:05 basiliscos joined #mojo
23:07 egopro joined #mojo
23:16 jberger left #mojo
23:16 jberger joined #mojo
23:16 ispy_ joined #mojo
23:16 hrupp_ joined #mojo
23:16 basiliscos joined #mojo
23:21 ka2u joined #mojo
23:22 basiliscos joined #mojo
23:36 lammel2 left #mojo
23:38 egopro joined #mojo
23:39 lammel2 joined #mojo

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