Camelia, the Perl 6 bug

IRC log for #mojo, 2011-11-12

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

All times shown according to UTC.

Time Nick Message
00:00 sri people seem to be using it
00:00 sri and i have plans to remove the whole module at some point in the future
00:01 tempire hmm
00:01 tempire probably a good idea, then.
00:01 tempire sounds like a potential pickle, though.
00:01 sri main problem is that Mojo::IOLoop has grown into what it is today, and wasn't designed
00:02 tempire mojolicious is the hippest module in perl right now, so people are going to be drawn to it's loop system, given the growing popularity of events.
00:02 sri that scares me
00:03 tempire because you know the ugly under the surface, or because you don't want to be locked in
00:03 sri it's pretty under the surface
00:03 sri i've already rewritten all internals with pretty little event emitter
00:03 tempire oh right, just the compatibility layer
00:03 sri ye
00:04 tempire well the event emitter is better anyway.  much easier to understand.
00:04 sri it's the same problem as routes
00:04 tempire removing the synopsis sounds sensible, then.
00:04 sri i know i need to change routes in incompatible ways too
00:05 sri sadly there are no deprecation paths i see for both
00:06 tempire If you wanted to change the route api completely, that could be done for a major release
00:06 tempire especially if there was a compatibility layer
00:06 sri i don't see how that would work
00:07 MisterHatt did the list of available plugins disappear?
00:07 tempire MisterHatt: not sure what you're referring to, but there's always search.cpan.org
00:07 tempire http://search.cpan.org/search?query=moj​olicious%3A%3Aplugin%3A%3A&mode=all
00:08 sri route changes would be rather bold, like completely changing how formats work, and new syntax for quoting
00:08 tempire I figured as much…it would be just like moving from tt2 to tt3
00:08 tempire or python 2.7 to 3
00:08 sri same for Mojo::IOLoop, it would pretty much just disappear and get replaced with a new set of modules
00:08 MisterHatt tempire: there used to be a listing of the more stable plugins on the wiki, but yeah that works too
00:08 tempire you would just have to make it clear months in advance what was happening
00:09 tempire and keep the old release available to download, and the docs available as well.
00:10 tempire what route api changes do you have in mind?
00:10 sri those are not entirely clear yet
00:11 tempire are you thinking in terms of implementation, or syntax?
00:11 sri but i think i want to get rid of format magic
00:12 sri /:controller(/:action(/:id(.:format)))
00:12 sri for optional parts
00:12 tempire hmm
00:13 sri quoting maybe /:{controller}lalala/:action
00:13 tempire well.  hopefully that's a long way off.
00:14 tempire I want to get through all the basics in the mojocasts before they have to change.
00:14 sri at least a year or two i guess
00:14 tempire good.  that's forever as far as I'm concerned
00:15 sri maybe i'm also completely wrong and what we have now works out fine
00:15 * tempire doesn't acknowledge scheduling past next week as a possibiliy
00:17 sri tempire: it's funny ioloop confuses you though, considering you wrote all the TLS bits
00:19 tempire it was the testing that threw me for a loop, so to speak
00:19 tempire and the usage of singletons, and the fact that async was very fluid in the early days
00:20 sri well, that's mostly changed now
00:21 tempire it's much easier to understand now.
00:21 * tempire loves events
00:21 * tempire emits his own event
00:23 sri i'm actually not even sure how i would change ioloop :S
00:23 sri it's a workhorse...
00:30 sri hmm, not sure what i actually want
00:30 sri perhaps i should just start working on the mongodb driver ;p
00:30 sri (again)
00:30 marcus sri: go for it!
00:31 marcus sri: if you build it, I will make things with it, promise :)
00:34 sri IF I BUILD IT THEY WILL COME?
00:34 marcus YES
00:51 andrefs joined #mojo
00:51 jnap joined #mojo
00:56 foomator joined #mojo
01:01 * marty IS COMING!
01:04 marty sri: If you build the mongodb driver, I promise to report lots of bugs with solutions (if I can grok them)  :P
01:43 andrefs joined #mojo
02:45 SmokeMachine joined #mojo
02:47 mire_ joined #mojo
02:51 tempire if you build the mongodb thingy, I will pimp it with prettiness
02:52 tempire I've decided to stop posting mojocasts to hacker news, but the driver could be launched to hacker news with a mojocast at the same time.
02:52 tempire that would be nifty
03:07 gshank_ joined #mojo
05:11 MojoGuest944 joined #mojo
05:11 MojoGuest944 From: http://news.ycombinator.com/item?id=1277067 (98 hits)
05:12 MojoGuest868 joined #mojo
05:12 MojoGuest868 From: http://news.ycombinator.com/item?id=1277067 (99 hits)
05:12 MojoGuest985 joined #mojo
05:12 MojoGuest985 From: http://news.ycombinator.com/item?id=1277067 (100 hits)
05:29 gshank joined #mojo
05:58 gshank joined #mojo
06:02 Vandal joined #mojo
06:04 plu joined #mojo
07:48 batman joined #mojo
08:13 sugar joined #mojo
08:36 Foxcool joined #mojo
09:14 Eugene joined #mojo
09:20 MisterHatt is there any easy way to get general files in a webdir ignored by rather than dumping them in the static dir? I figure it'd work fine with reverse proxying rules in the webserver but in this particular case, it's fastcgi
09:29 trone_ joined #mojo
10:10 mire joined #mojo
10:36 andrefs joined #mojo
10:55 tholen_ joined #mojo
11:10 metaperl joined #mojo
11:36 xxtjaxx joined #mojo
11:38 xxtjaxx Hi! When I put something in the public folder I can let a client dowload it like http://$host:3000/FileIPutInPublicDirectory given that I work with the local test daemon.
11:44 d4rkie joined #mojo
11:46 andrefs joined #mojo
12:02 sherr_ joined #mojo
12:05 sherr__ joined #mojo
12:11 Psyche^ joined #mojo
12:43 yko joined #mojo
13:03 noganex joined #mojo
13:29 andrefs joined #mojo
13:40 MojoGuest767 joined #mojo
13:40 MojoGuest767 From: http://blog.kraih.com/perl-is-ready-for-html5 (24 hits)
13:40 MojoGuest767 left #mojo
14:21 SmokeMachine joined #mojo
14:25 andrefs joined #mojo
14:25 jimbo joined #mojo
14:40 abra joined #mojo
14:52 jimbo list *
14:54 memowe hello mojo! :)
15:20 mire joined #mojo
15:35 gshank joined #mojo
15:41 mire joined #mojo
16:07 MojoGuest314 joined #mojo
16:24 jimbo test
16:24 jimbo hi mojo
16:24 sri fail
16:32 crab i really need to explore html5 drag-and-drop (and see what sort of fallbacks i can implement for older browsers)
16:54 Patterner perl-is-still-IE-6-ready
17:21 mire joined #mojo
17:22 Eugene joined #mojo
17:30 gshank joined #mojo
17:51 SmokeMachine joined #mojo
18:14 mire joined #mojo
18:41 gabriel joined #mojo
18:58 Foxcool joined #mojo
19:17 SmokeMachine joined #mojo
20:07 mire_ joined #mojo
20:32 vel joined #mojo
20:44 Shaeto joined #mojo
20:45 Shaeto hi, have a question about binary data rendering (image). i have to render command output, so, i run external command line application, read input and render. is there something better than render_data ?
20:46 Shaeto don't want to read binary data to memory
20:46 Shaeto i mean full data
20:47 Shaeto mb mojo can allow me to send data directly from pipe
20:48 Shaeto ahh, seems $self->res->message->write can help me
20:58 mire_ joined #mojo
21:35 Shaeto hmm, no, ->message cant help me :)
21:53 sri tempire: the more i think about ioloop the less i actually want to change :S
21:54 sri the code is all good, think i only dislike the fact that it uses callbacks instead of events
21:54 sri which is kinda uncool
21:55 Shaeto ahh sri you are here :) could you give very small hint how to output inmemory binary data for example jpeg generated by gd
21:55 sri however, for its main use case (daemon/useragent) callbacks are a lot easier to manage… so i'm a little torn
21:56 sri Shaeto: sorry, i generally don't answer beginner questions anymore, since i've scared too many users away :(
21:56 Shaeto i read about render_data but don't want to read data to memory, actually data provider is pipe
21:56 Shaeto okay thanks
21:59 sri http://mojolicio.us/perldoc/Mojolicious/G​uides/Rendering#Chunked_transfer_encoding # i can give you a hint since nobody else seems to be awake, but that's it
22:01 sri back to ioloop… i'm also not sure about the stream api
22:01 Shaeto ehh :( yes thats answer tahnk you so much
22:02 sri on the main ioloop layer we have all callbacks, and when you dig deeper into streams you get events… not sure if that's maybe too complicated
22:05 sri don't mind me mumbling, it helps me think :)
22:11 tm joined #mojo
22:11 tempire it's good when you feed your dev thoughts into the channel
22:11 sri http://www.youtube.com/user/OreillyMed​ia#p/c/EF30FFC877957631/10/oebqlzblfyo # haha, sky ranting about everything
22:11 tempire it's like the presidential fireside chat, to let everyone know what's going on
22:14 tm hi all
22:16 * sri waves
22:16 tm :)
22:16 tempire ugh.  this guy's attitude is annoying.
22:17 sri that's the guy who wrote perl ithreads ;p
22:17 tm looking for some mojo wisdom - maybe you can help
22:18 tempire ™: just ask
22:18 sri i also played world of warcraft with him :D
22:19 tm ok, one is changing response headers - x-powered-by, server, etc... In non-lite app I can do with Mojo::Headers, but can they be (un)set without it?
22:19 tm for example, I'd happily remove x-powered-by entirely
22:19 sri aww :(
22:19 tm in Mojolicious::Lite I had no problem
22:20 tm I prefer to put info it's mojo app on the page, than in the headers - that's all
22:21 tm $self->res->headers->header('Server'=>'nc -l -p 80');   -- works in controller
22:22 tm but I can't remove header entirely :(
22:23 tm ok another question - I want some code to run always, on every hit (common part that populates stash)
22:24 tempire you can $headers->remove('this header')
22:24 GitHub7 joined #mojo
22:24 GitHub7 [mojo] kraih pushed 1 new commit to master: http://git.io/xzGV9Q
22:24 GitHub7 [mojo/master] fixed typo in hook description - Sebastian Riedel
22:24 GitHub7 left #mojo
22:24 tempire you can probably put that into an after_build_tx hook
22:24 tempire not sure if hooks are parallel or serial, though.
22:24 tm hmmmm
22:25 tm not after_static_dispatch as proposed in wiki?
22:25 sri CEREAL!
22:26 sri tempire: if you ever find a way to make hooks/events run parallel please let me know, that would be a game changer :)
22:26 tempire I was assuming you had moved those into some sort of event.
22:27 tempire ™: I'm using the http://cpansearch.perl.org/src/SRI/Mojolicio​us-2.26/lib/Mojolicious/Plugin/PoweredBy.pm implementation as my reference.
22:28 tm awesome!
22:28 tempire That's all the default headers do, loaded in mojolicious.pm
22:28 tempire https://github.com/kraih/mojo/bl​ob/master/lib/Mojolicious.pm#L86
22:28 sri tempire: what do you mean with parallel exactly?
22:28 tempire ™: be wary of the wiki.  there be monsters there.
22:29 tempire I meant concurrent actually; with each of the hooks being an event, having no order.
22:30 sri all events happen in a single process/thread, so only one thing can run at a time and all closures are executed sequential
22:31 sri there is no actual concurrency
22:32 sri when an event gets emitted it stops everything else that is currently happening
22:34 tempire You're right.  I've been thinking a lot about events and threads and stuff in the abstract sense.
22:34 tempire so when I think events now, my first thought is, "don't assume order"
22:34 sri that's what you get for playing with too many languages ;p
22:35 tempire it's true.
22:35 tempire actually now I'm on the khan academy kick.
22:35 sri i would love to run events in threads though
22:36 tempire I have to get through all the math courses before I can try my hand at writing a vm.
22:36 sri fun
22:36 tempire and somewhere in there I have to master haskell.
22:37 * sri wonders what JuJu is and why sky hates it so much
22:37 sri https://juju.ubuntu.com/ # hmmmm
22:38 * tempire wonders if he gets any sleep being so frustrated.
22:38 tempire he needs a coke and a smile.
22:38 tempire maybe a nyan cake.
22:38 * sri wouldn't mind some coke either
22:41 tempire I hate gear man now.
22:41 tempire is redis the way to go?
22:42 sri everybody says so
22:42 tempire I wish parrot would hurry up.  perl really needs a vm.
22:43 sri i think parrot is mostly ready
22:43 tempire I dropped into the channel a while back.  I didn't get that impression.
22:44 tempire something about being in the midst of a reimplementation of something important.
22:44 sri well, it gets rewritten every other week or so ;p
22:45 sri but otherwise i think it is ahead of rakudo in progress
22:47 smpb joined #mojo
22:51 Shaeto btw about $c->write_chunk, application returns correct data but with HTTP 400 code, don't know why i set 200 by $self->res->code(200) before write_chunk and ->finish
22:52 Shaeto content_type works fine
22:53 Shaeto i have printed $code in the _build_start_line and there is 400, thats very strange
23:06 mire_ joined #mojo
23:09 tm another interesting thing (for a newbie like me) - two Cotent-Type headers come back - one for sure from Charset plugin
23:10 tm second I guess from Mojo::Template
23:11 sri tm: that's certainly not the case
23:12 tm ok, here's what I get back
23:12 tm Server: Mojolicious (Perl)
23:12 tm Content-Length: 1681
23:12 tm Content-Type: text/html;charset=UTF-8
23:12 tm Content-Type: text/html; charset=UTF-8
23:12 tm note, one has space after ; and other doesn't
23:12 sri no pasting into the channel please
23:12 tm sorry
23:13 tm bottom one is from Charset plugin, changed there and it changed header
23:13 sri mojolicious sets a content type header at exactly one point, and even then checks if one already exists
23:14 sri it is 100% your code screwing up
23:14 tm I doubt it because I never told it anywhere to touch charsets
23:15 tm it is stock generated framework app (not lite)
23:15 tm one route only, generates page given as parameter in url - that's all
23:16 tm ok, let me have a look what is wrong there - I take your word re my screwup ;)
23:22 * tm is trying to comment out all code and see when one content-type header goes away
23:28 tm got something
23:28 tm render(text=>'...') - one header
23:28 tm render template - two headers
23:32 tm and we have a winner...
23:32 purl you have your choice of the first, second, or third door. Or.. the box.
23:32 tm :)
23:32 tm I think I won the lamest question prize lol
23:33 tm ok - seems like Mojo::Template reads content-type from meta from html template... and spits it out
23:33 tm commented it out in layout, one header disappeared
23:33 Shaeto left #mojo
23:34 sri sounds like right solution and wrong conclusion
23:36 tm wrong conclusion?
23:37 sri Mojo::Template analyzing actual html content sounds batshit crazy ;p
23:38 sri my best guess is that you didn't actually look at what goes over the wire and just blindly trusted some browser addon
23:39 * sri waits for "D'OH!"
23:39 tm GET -SUse <url>
23:39 tm add-ons?
23:43 sri exactly, i bet the "GET" script actually extracts http-equiv tags from html
23:44 sri not that i've ever used it
23:47 tm ok, let me check it then
23:47 tm I hope you are right :)
23:47 sri i usually am
23:47 sri ..unless i'm wrong
23:49 tm ok... where do I send beer? :)
23:49 tm tcpdump confirmed what you say - nice one
23:51 tm facepalm... all I can say
23:51 tm back to docs then
23:51 sri :)
23:52 * sri just checked the web developer browser addon, it only shows real headers
23:53 tm usually I stick to 'http live headers'
23:54 tm btw rewriting most of my projects from catalyst to mojolicious
23:55 tm love it :)

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