Camelia, the Perl 6 bug

IRC log for #mojo, 2011-10-14

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

All times shown according to UTC.

Time Nick Message
00:31 blabos joined #mojo
00:31 blabos Hau!
00:32 blabos I'm using the method Mojolicious::Controller::respond_to()
00:33 blabos there is some expectation that it ceases to be experimental?
00:34 blabos any alternatives?
00:34 blabos :)
00:42 crab blabos: the alternative is of course to write an if ... elsif ... else ...
00:42 blabos :)
00:42 blabos ok
00:43 crab blabos: experimental features stop being experimental when enough people say "i'm using this, it's nice"
00:43 blabos I will assume the risk of using this experimental feature
00:46 blabos I'm providing a 'json version' for some routes
00:47 blabos but only for a small subset of them
00:48 j3nnn1 joined #mojo
00:48 crab makes sense.
00:48 purl makes sense is http://xrl.us/bjq3kq
00:52 mercutioviz joined #mojo
01:21 abra joined #mojo
01:46 mattastrophe joined #mojo
02:59 MojoGuest147 joined #mojo
02:59 MojoGuest147 From: http://news.ycombinator.com/item?id=1277067 (28 hits)
03:12 metaperl|2 joined #mojo
04:12 preflex_ joined #mojo
04:23 MojoGuest396 joined #mojo
04:32 MojoGuest28 joined #mojo
04:32 MojoGuest28 From: http://xantus.tumblr.com/page/2 (2 hits)
05:01 Vandal joined #mojo
05:52 perlrocks Twitter: "sinatra => mojolicious" (ja) --mustankatti http://twitter.com/mustankat​ti/status/124724176018878465
05:52 perlrocks Twitter: "Web application framework for Perl, Catalyst is a super heavyweight. Mojolicious:: Lite # yapcasia has been taken up" (ja) --ta2_o2p http://twitter.com/ta2_o2p​/status/124724204020039680
05:52 perlrocks Twitter: "Ruby の Sinatra に対して, Perl の Mojolicious:: Lite # yapcasia" (ms) --sasata299 http://twitter.com/sasata29​9/status/124724323599659008
05:54 sri blabos: respond_to is still experimental because i'm not sure yet about some details, like the 204 default
06:01 sri and yes, i'm waiting for more feedback, like crab said
06:03 crab respond_to is a slightly strange name
06:04 crab "respond to json" takes me a second to read correctly
06:04 perlrocks Twitter: "rvm in ruby, Sinatra, Heroku, PerlBrew in Perl, Mojolicious:: Lite, dotCould. Such information for beginners, but I find looking hard, very grateful. # Yapcasia" (ja) --hsksyusk http://twitter.com/hsksyusk​/status/124727335193812994
06:08 crab use_accepts_header_to_select_response_format() would be a much nicer name
06:08 * crab hides
06:08 * sri nods
06:08 sri i'll change it later
06:09 stephan48 when i need to gzip responses send to the client... whats the best way use MojoX::Encode::Gzip from 2010, mod_deflate from apache2, or something else?
06:11 sri does that sound like something a web application should do itself?
06:11 crab stephan: i just turn compression on in nginx, works nicely. (so yes, i'd recommend mod_deflate in your case)
06:12 crab stephan: broadly speaking, i try to set up the frontend server to cache static resources as much as possible, so once that happens, you want the compression at that level anyway
06:12 stephan48 k
06:13 stephan48 mod_deflate+fcgi didnt play that nice together back in the days i used catalyst, cause that i asked
06:13 crab wonder why.
06:13 stephan48 fcgi..
06:20 stephan48 thanks :) works as i expected
06:23 MojoGuest627 joined #mojo
06:23 MojoGuest627 From: http://news.ycombinator.com/item?id=1277067 (29 hits)
06:27 koban joined #mojo
06:43 MojoGuest348 joined #mojo
06:43 MojoGuest348 From: http://www.google.com/search?q=extjs+chatting+h​tml5&ie=utf-8&oe=utf-8&aq=t&rls​=org.mozilla:ko:official&client=firefox-a (1 hits)
06:44 MojoGuest348 ?
06:44 MojoGuest348 hi
06:44 MojoGuest348 left #mojo
06:45 MojoGuest593 joined #mojo
06:45 MojoGuest593 From: http://www.google.com/search?q=extjs+chatting+h​tml5&ie=utf-8&oe=utf-8&aq=t&rls​=org.mozilla:ko:official&client=firefox-a (2 hits)
06:45 MojoGuest593 ?
06:48 MojoGuest593 left #mojo
06:51 D4RK-PH0ENiX joined #mojo
06:54 d4rkie joined #mojo
06:58 arpadszasz joined #mojo
07:09 AmeliePoulain joined #mojo
07:11 sugar joined #mojo
07:13 arthas joined #mojo
07:18 wolf_ joined #mojo
07:20 perlrocks Twitter: "Why I chose to build a Plack framework instead of using Mojolicious: http://t.co/EYAlwHgr" (ru) --F_ili_n http://twitter.com/F_ili_n​/status/124746321553932288
07:21 sugar joined #mojo
07:39 noganex joined #mojo
07:48 perlrocks Twitter: "@mustankatti More like Sinatra => Mojolicious::Lite" --tempiretech http://twitter.com/tempirete​ch/status/124753554744418305
08:04 cosmincx joined #mojo
08:05 sri i think 2.0 is nearing completion
08:05 sri it needs more testing though
08:07 tempire muah!
08:12 perlrocks Twitter: "#mojolicious 2.0 is nearing completion, but needs more testing! http://t.co/lHwMK4WS #perl" --kraih http://twitter.com/kraih/status/124759392531922944
08:19 noganex joined #mojo
08:54 MojoGuest382 joined #mojo
09:27 batman joined #mojo
09:56 noganex_ joined #mojo
10:15 spleenjack joined #mojo
10:43 batman joined #mojo
10:56 batman joined #mojo
11:11 Foxcool joined #mojo
11:17 Foxcool joined #mojo
11:17 Foxcool_ joined #mojo
11:18 crab joined #mojo
11:25 arpadszasz joined #mojo
11:42 migo joined #mojo
11:43 sri woot
11:43 sri cpantesters is back http://www.cpantesters.org​/distro/M/Mojolicious.html
11:53 blabos joined #mojo
12:21 arpadszasz joined #mojo
12:32 Eugene joined #mojo
12:59 andrefs joined #mojo
13:16 alexsergeyev left #mojo
13:24 metaperl joined #mojo
13:29 bosphorus joined #mojo
13:42 sri http://shitthatsirisays.tumbl​r.com/post/11372870777/source # looks like i really need an iphone 4s :/
13:52 crab shit that sri says? i don't need a web site for that!
13:52 sri :)
13:58 edenc joined #mojo
14:11 GitHub178 joined #mojo
14:11 GitHub178 [mojo] kraih pushed 1 new commit to master: http://git.io/M9yQTw
14:11 GitHub178 [mojo/master] modernized some eval statements - Sebastian Riedel
14:11 GitHub178 left #mojo
14:22 GitHub185 joined #mojo
14:22 GitHub185 [mojo] kraih pushed 1 new commit to master: http://git.io/-P7Uuw
14:22 GitHub185 [mojo/master] updated Makefile.PL - Sebastian Riedel
14:22 GitHub185 left #mojo
14:24 Eugene hey guys. Does anybody know what "1;" is for in each level after every "use .." in the last sri's commit - https://github.com/kraih/mojo/commit/84​9003def43a42231255d7125eeea725b7dda604 ?
14:24 Eugene s/level/eval/
14:25 Eugene looks like I found it - http://search.cpan.org/dist/Perl-Criti​c/lib/Perl/Critic/Policy/ErrorHandling​/RequireCheckingReturnValueOfEval.pm
14:26 sri perl -E'say "true" if eval "use Mojo::Base"'
14:29 Eugene that's because there is another eval in mojo::base that fails?
14:31 sri no, the return value is always false
14:31 purl okay, sri.
14:32 Eugene I see, cheers
14:48 blabos joined #mojo
14:56 mercutioviz joined #mojo
14:56 koban left #mojo
15:20 amoore joined #mojo
15:21 sromanov joined #mojo
15:40 spleenjack joined #mojo
16:04 batman joined #mojo
16:17 mercutioviz joined #mojo
16:38 KayT3 joined #mojo
17:13 Eugene joined #mojo
17:41 perlrocks Twitter: "@kraih all my apps & tests are working with 2.0 #mojolicious" --freekey http://twitter.com/freekey​/status/124902691926315008
17:54 sromanov joined #mojo
18:15 Sjors hmm
18:15 Sjors I can't get chunked encoding to work
18:15 Sjors I call $self->render_later(), some $self->write_chunk() with sleep in between, and eventually $self->finish
18:16 Sjors when I telnet to the daemon, or run mojo_app get '/welcome', it waits for a while (sum of the sleeping times) and then spurts the whole response
18:16 Sjors in telnet I can see it does chunking well, but simply doesn't send the chunks the moment they come in
18:31 batman joined #mojo
18:42 andrefs joined #mojo
19:10 marcus joined #mojo
19:15 Sjors I can't get it working, whatever I try
19:15 Sjors >_>
19:15 Sjors when I browse through the source code, it seems write_chunk eventually only causes buffers to grow, along with some chunk encoding, but nothing to be sent immediately at that moment
19:17 marty Sjors:  Maybe this will help.   https://groups.google.com/forum/​#!topic/mojolicious/sJnGXDeSSgk
19:18 Sjors ah
19:18 Sjors the documentation doesn't say the subroutine is required...
19:24 sri because it is not
19:29 Sjors sri: but the behaviour is very different with or without the subroutine, right?
19:29 sri nope
19:30 sri behavior never changes
19:32 Sjors sri: I had great troubles finding a good example for chunked encoding, my first try looked like this:
19:32 Sjors $self->write_chunk("foo1\n");
19:32 Sjors sleep 5;
19:32 Sjors $self->write_chunk("foo2\n");
19:33 sri stop
19:33 sri no pasting into the channel please
19:33 Sjors sri: but that waits 5 seconds, then sends something like "4\nfoo1\n4\nfoo2\n"
19:33 sri of course that doesn't work
19:33 sri we use non-blocking io
19:34 Sjors sri: from the documentation, it seems like the way to do it:
19:34 Sjors http://mojolicio.us/perldoc/Moj​olicious/Controller#write_chunk
19:34 sri the only example there uses the callback
19:35 Sjors it wasn't clear to me that the first example was actually a synopsis
19:35 Sjors and the second example says it uses the callback, but doesn't explain that this is absolutely required for chunked writing
19:35 sri the first example is *always* the argument variations
19:36 sri because it is not required
19:36 Sjors normally this seems clear to me, but in this case, the documentation wasn't sufficient for me to know how to do it, and the many ways I tried until I got it working didn't turn out to be what I wanted, even though it got close
19:36 sri you just don't understand the semantics of non-blocking io
19:36 Sjors you know exactly how Mojolicious is written
19:37 Sjors but to me, "of course you need to use the callback", isn't that "of course"
19:37 Sjors as far as I'm concerned, write_chunk() might do synchronous I/O (it's not documented), or it might do asynchronous I/O during a sleep(), using some way anologously to threads
19:38 Sjors anyway, great that it's working now
19:39 sri that's just silly, perl doesn't have threads
19:40 Sjors to me, most of Mojo and Mojolicious is a black box, I don't want to have to think about what makes sense for an implementation
19:41 sri that's not gonna work, i assume everybody using advanced features knows exactly about all implications of non-blocking io
19:43 Sjors if use of write_chunk() only makes sense when used correctly, because of the asynchronous I/O implementation, then I think there should be more warnings like "you will most likely want to use the subroutines"
19:44 sri see, that's wrong
19:45 sri drain callback is uncommon
19:45 sri most people would use other event emitters to trigger chunk writes
19:46 sri non-blocking is hard
19:46 sri i wouldn't do anyone a favor by making it look easy
19:47 sri in fact, i maybe should make it look harder
19:50 Sjors for example, Mojo::IOLoop?
19:50 Sjors for me, it would be best if I could call $self->write_chunk("foo", [blocking => 1]); or so
19:51 sri any event emitter… timers, trigger, ev, anyevent...
19:51 sri blocking is not possible
19:52 Sjors maybe, if you think it's worth it, it would be cool to have some list of options in the Cookbook or FAQ of the Mojolicious POD
19:53 sri what options?
19:53 purl hmmm... options is planned for a future release of perl."
19:53 Sjors sri: writing chunks asynchronously with the drain callback, and the methods you said, timers, trigger, ev, anyevent
19:54 sri example with drain callback is already there, eberything else is way too broad
19:55 sri and introduction to event loops would be nice, but i'm not good enough to write it
19:55 sri *-d
20:02 sri writing chunks is really only the tip of the iceberg, by now we have dozens of similar or even more advanced real-time features that are really hard to explain to beginners
20:06 sri http://blog.kraih.com/mojolicious-​hack-of-the-day-html5-eventsource # a more common example for non-blocking writes
20:06 diegok Sjors: you should probably read EV docs. As sri have said, its not easy to do it well.
20:06 sri i don't even have a link to a good event loop introduction :/
20:07 mercutioviz hah, i've been looking for a "good" event loop introduction for years
20:07 sri the best i've come across so far are prolly the peepcode screencasts about eventmachine
20:08 sri but they cost money
20:08 mercutioviz such a document is about as common as Lindsay Lohan's dignity
20:08 sri haha
20:08 diegok sri: http://search.cpan.org/dist/An​yEvent/lib/AnyEvent/Intro.pod is not a bad option to start thinking about it..
20:09 diegok well, I think it was helpfull to me
20:09 * mercutioviz clicks the magic link
20:09 diegok sri: looking at code implementing this things is also useful :)
20:12 diegok Sjors: ^ :)
20:14 Eugene joined #mojo
20:17 mattastrophe joined #mojo
20:21 GitHub99 joined #mojo
20:21 GitHub99 [mojo] kraih pushed 1 new commit to master: http://git.io/Q0F-xQ
20:21 GitHub99 [mojo/master] mention that write methods are non-blocking - Sebastian Riedel
20:21 GitHub99 left #mojo
20:21 metaperl joined #mojo
20:23 sri that should be a sensible red flag
20:25 gbacon joined #mojo
20:26 perlrocks Twitter: "@Mojotruck chicken sandwich was mojolicious! Thanks for an awesome lunch. Enjoy the weekend." --PrincessDi457 http://twitter.com/PrincessDi​457/status/124944197009670144
20:30 Eugene joined #mojo
20:31 chansen_ joined #mojo
20:31 GitHub121 joined #mojo
20:31 GitHub121 [mojo] kraih pushed 1 new commit to master: http://git.io/zN8how
20:31 GitHub121 [mojo/master] mention non-blocking write behavior on all layers - Sebastian Riedel
20:31 GitHub121 left #mojo
20:41 GitHub34 joined #mojo
20:41 GitHub34 [mojo] kraih pushed 1 new commit to master: http://git.io/Iu_oLw
20:41 GitHub34 [mojo/master] no need to mention the kernel send buffer - Sebastian Riedel
20:41 GitHub34 left #mojo
21:44 perlite_ joined #mojo
21:47 sugar joined #mojo
22:09 tempire chromatic, unintentionally, I think, supports Mojolicious methodology in his latest post.
22:29 gbacon_ joined #mojo
22:48 Foxcool joined #mojo
23:21 gshank joined #mojo
23:34 Eugene joined #mojo
23:45 j3nnn1 joined #mojo

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