Camelia, the Perl 6 bug

IRC log for #mojo, 2013-05-17

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

All times shown according to UTC.

Time Nick Message
00:30 egopro joined #mojo
00:53 shmuel joined #mojo
01:00 moltar joined #mojo
01:01 sivoais joined #mojo
01:35 xaka joined #mojo
01:36 mikelieman left #mojo
01:41 d4rkie joined #mojo
01:57 Meiermann joined #mojo
02:05 D4RK-PH0ENiX joined #mojo
02:51 wruppert joined #mojo
02:59 d4rkie joined #mojo
03:04 preflex_ joined #mojo
03:09 ohoushyar left #mojo
03:16 rich42 joined #mojo
03:23 inokenty joined #mojo
03:38 xaka joined #mojo
03:43 sh4 joined #mojo
03:45 fildon_ joined #mojo
03:46 russum left #mojo
03:47 russum joined #mojo
03:47 russum left #mojo
04:16 good_news_everyone joined #mojo
04:16 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/GFoYhg
04:16 good_news_everyone mojo/master 7ac17f4 Sebastian Riedel: documentation tweaks
04:16 good_news_everyone left #mojo
04:20 jwang joined #mojo
04:31 ynonp joined #mojo
04:47 egopro joined #mojo
04:50 basiliscos joined #mojo
04:56 egopro joined #mojo
05:05 egopro_ joined #mojo
05:49 Britzel_ joined #mojo
06:15 dpetrov_ joined #mojo
06:24 rem_lex|pivo joined #mojo
06:35 Mike-PerlRecruiter_ joined #mojo
06:42 dod joined #mojo
07:03 yakudza joined #mojo
07:13 dod joined #mojo
07:37 ynonp joined #mojo
07:39 jzawodn joined #mojo
07:53 maxhq joined #mojo
07:54 Vandal joined #mojo
08:06 nicolaas joined #mojo
08:06 nicolaas hello
08:07 nicolaas congratulations to all of you for the V4 !
08:08 nicolaas i just updated but I have a problem with "include" I guess
08:09 nicolaas should I replace it with partial rendering ?
08:16 suy joined #mojo
08:17 nicolaas it's weird because the request to get this file returns "canceled"
08:18 nicolaas (well, doesn't returns, it's just cancelled)
08:23 fhelmber_ joined #mojo
08:26 nicolaas oh, okay, firefox gets the 500 status so i get the error
08:48 ynonp joined #mojo
09:42 suy joined #mojo
10:04 moltar joined #mojo
10:05 DaTa joined #mojo
10:15 cosmincx joined #mojo
10:20 bowtie joined #mojo
10:47 egopro joined #mojo
11:03 ynonp joined #mojo
11:12 suy joined #mojo
11:17 human39 joined #mojo
11:23 dinkypumpkin joined #mojo
11:24 dinkypumpkin left #mojo
11:30 maxhq joined #mojo
11:37 aghbas joined #mojo
11:37 aghbas joined #mojo
11:46 egopro joined #mojo
12:19 whitebook joined #mojo
12:23 mugenken joined #mojo
12:39 jberger joined #mojo
12:41 gryphon joined #mojo
12:46 rem_lex|pivo joined #mojo
12:46 egopro joined #mojo
12:46 suy joined #mojo
12:57 Dandre hello
12:58 Dandre can CGI.pm be used to render pages managed with mojo?
13:11 bluescreen joined #mojo
13:13 mire_ joined #mojo
13:18 whitebook joined #mojo
13:28 moltar joined #mojo
13:30 jberger Dandre, rather you would use a mojolicious based script in place of a CGI.pm script
13:31 jberger a mojolicious app can be used in a CGI environment directly
13:38 bc547 joined #mojo
13:39 whitebook joined #mojo
13:47 egopro joined #mojo
13:50 ver joined #mojo
13:58 marty joined #mojo
14:02 xaka joined #mojo
14:06 mire_ joined #mojo
14:07 cosmincx joined #mojo
14:19 egopro joined #mojo
14:37 nic joined #mojo
14:50 egopro joined #mojo
14:51 sri https://github.com/kraih/mojo/issues/491 # don't think there is much else to be done about this issue
14:52 jberger perhaps the OP will provide more info?
14:53 sri judging by his history, it's unlikely
15:02 * jberger always hopes for the best
15:03 jberger (but leave the issue closed for now :-P )
15:03 jberger http://mojolicious-introduction.herokuapp.com/
15:03 jberger \o/
15:04 jberger its my talk from Chicago.pm
15:04 jberger I finally put it somewhere
15:04 jberger (and yes I am filling in slide 2)
15:11 jberger sri: do you have an update number of lines of code and number of tests?
15:11 jberger I figure as long as I update the slides for 4.0 I may as well get the stats right
15:12 sri 8928 lines of code and 9711 tests
15:15 jberger thanks!
15:15 jberger back under 10000 again eh?
15:15 jberger I guess that happens when you remove a bunch of code
15:15 sri i've cleaned up some tests too
15:16 jberger but hey, now we get to celebrate 10k again in ~300 tests!
15:17 nic joined #mojo
15:21 bluescreen joined #mojo
15:22 egopro joined #mojo
15:25 Dandre jberger sorry I was busy
15:26 jberger no need to be sorry
15:27 nicolaas joined #mojo
15:27 Dandre ok the issue is that I have an application written to use CGI.pm only. I am evaluating to extend this application and use mojo for thes extensions. So I was considering to port existing script using CGI to mojo with minimal effort (at first)
15:29 nicolaas can a Controller (called by an http request) access the Websocket of the app ?
15:29 nicolaas Should I define a global Websocket object for my app and use it in any controller ?
15:30 btyler joined #mojo
15:31 nicolaas well I guess the transaction is http so the controller doesn't get a default global websocket object
15:32 nicolaas but how can I make the websocket routes deal with this websocket object ?
15:34 jberger Dandre, I don't know what you mean by extend
15:35 Mikey nicolaas: you need another way to communicate with the web socket, I use a FIFO and ZMQ to communicate with a given web socket anywhere in my cluster
15:35 Mikey you can use IPC or you can expose some kind of channel in your application's base class or something via a helper
15:36 nicolaas but how can Mojolicious "listen" to a fifo ?
15:37 Mikey inside your websocket loop
15:38 nicolaas server side ?
15:38 Mikey *nod*
15:39 Mikey so your server side loop is saying "do i have anything from my websocket?  do i have anything from source x?  do i have anything from source y?"
15:40 Mikey we use Mojo::IOLoop->singleton->reactor->io() ..
15:40 Mikey to watch a filehandle
15:40 Mikey it's actually a zeromq filehandle
15:40 nicolaas okay, so Mojo::IOLoop->singleton->reactor->io() it is
15:41 nicolaas thanks
15:41 Mikey np nicolaas, happy hacking
15:41 nicolaas Mikey: did you easily get how to manage many websocket transactions ? so I only push content to the right user at a time ?
15:42 Mikey i wouldn't say it was easy, but it was certainly predictable.
15:42 Mikey the hardest part was making the message bus scale horizontally
15:42 Mikey but zeromq handled that for us
15:43 sh4 joined #mojo
15:43 nicolaas so ZeroMQ is running as a daemon in another perl interpreter, right ?
15:44 Mikey yeah i fork a publisher process from my startup()
15:44 Mikey so i have my application context inside the zmq publisher as well
15:45 Mikey as well as my DBIx object, etc
15:45 dod joined #mojo
15:46 nicolaas damn' .. i'm a complete stranger to all of this things
15:46 Mikey i was too when i started
15:47 nicolaas can't a http transaction emit an event catched by the IO::Loop singleton ?
15:47 Mikey but the end result is worth it, i can say that much.
15:47 Mikey sure, but you need a way to get into the web socket you mean to.
15:48 Mikey for us we have a helper called "pub_write" which means "write this message to the publisher", this echos it out across the cluster so all nodes get the message
15:48 Mikey so no matter which node the user has a websocket connected to, they get the message
15:48 nicolaas yes, okay
15:49 Mikey sometimes a subsequent request to a controller uses pub_write(), sometimes it's something else
15:49 Mikey but we had to create that pipeworks to get the messages from a to b
15:51 Dandre (2013-05-17 17:34:54) jberger: Dandre, I don't know what you mean by extend
15:51 Dandre I mean add functionalities
15:53 egopro joined #mojo
15:53 nicolaas Mikey: sorry, but from the Mojo::IOLoop->singleton, that will listen & catch an event, how do you access the app websocket object ?
15:53 sri many folks use redis pub/sub instead of zeromq too
15:54 nicolaas sri: ok thanks .. as I use MongoDB, I also noticed there are some MQ tools using it
15:55 sri if you're using the official MongoDB driver, that's not gonna work
15:56 sri in fact, Mango is not ready for that yet either imo
15:56 mike_ joined #mojo
15:56 nicolaas sri: damn' ... actually, we have a working mongoMQ daemon, we plan to make it call http routes (with LWP) on our Mojolicious server
15:57 jberger Dandre, using two different web frameworks (because CGI.pm is essentially a framework) is usually quite difficult, using a mojo app as a second site, ie hosted at a different path could work
15:57 sri i don't see that working either, since you have no idea which process the http requests are going to reach
15:57 nicolaas sri: my real question is : from a http transaction, can I manage to use a websocket to push something to the client ?
15:57 jberger but its essentially a different app at that point
15:58 sri nicolaas: you need a message bus as soon as yo have more than one worker process
15:59 nicolaas sri: so my controller must use a filehandle sub / pub system to share stuff with the IO::Loop  ?
15:59 sri nicolaas: i don't understand what "sharing stuff with the ioloop" means
16:00 jberger nicolaas, the ioloop watches for events
16:01 nicolaas well, for example, I want to be able to do something as simple as an echo function : you make an http request to /EchoMachine/echo with a message, and I want the Mojolicious App Websocket to push it back to the client
16:01 Dandre ok thanks
16:02 sri nicolaas: how do you plan to deploy it and to what size do you need to scale?
16:02 nicolaas Mikey suggested to use a ZeroMQ solution, and use a IO::Loop singleton to listen to a filehandle a controller would write to (during an http transaction)
16:03 sri that's not quite what he said
16:03 nicolaas didn't he ?
16:03 nicolaas it's a small experience for now
16:03 sri you watch the zeromq handle for readable events so you know when a new message arrived you can read, but you can write to it at any time
16:04 nicolaas and that time would be : from an http request or from another daemon I want to run
16:04 sri anyway, that has nothing really to do with the ioloop
16:05 sri it's a pub/sub system based on zeromq
16:05 sri a message bus
16:05 nicolaas yes, but how would you make mojolicious subscribe to it ?
16:05 labrown joined #mojo
16:08 basic6 joined #mojo
16:08 nicolaas sri: got to go, hope you can tell me more later
16:09 nicolaas thanks anyway
16:09 sri afraid not, i know very little about zeromq
16:09 xaka joined #mojo
16:09 nicolaas sri: but how can mojolicious listen to any pub / sub system and push something to the client as a callback ?
16:10 jberger_ nicolaas, I recommend zeromq's documentation
16:10 jberger_ its very readable
16:10 sri https://metacpan.org/module/JHTHORSEN/Mojo​-Redis-0.9907/lib/Mojo/Redis.pm#subscribe
16:11 sri http://api.metacpan.org/source/JHTHORSEN​/Mojo-Redis-0.9907/t/subscription_live.t
16:11 nicolaas jberger_ sri  thanks
16:11 btyler mojo redis plugin++ -- I spent some time last weekend playing with it and it was really easy to use
16:11 btyler and redis is very conceptually simple
16:12 nicolaas btyler: okay
16:12 sri http://api.metacpan.org/source/JHTHOR​SEN/Mojo-Redis-0.9907/t/pubsub_live.t
16:13 nicolaas sri: the only thing i'm worried about is the IO Loop ... I don't get it : I want all of this happen in a Mojolicious app, not in a standalone loop
16:14 nicolaas I know I'm not aware enough with this concepts, but it's quite hard to get
16:14 sri it's a tough concept, if i was capable of explaining it properly i would have written a guide already
16:15 nicolaas oh I guess I can use this "$redis     = $redis->ioloop(Mojo::IOLoop->singleton);" in my startup method ?
16:15 sri i would be surprised if that wasn't the default
16:16 jberger_ nicolaas, actually it will do that for you, its a singleton :-)
16:16 nicolaas well, it wouldn't help me with the fact : I don't know how to use a websocket in a Mojolicious app out from a route ... can I access the "app websocket object" from my redis callback ?
16:16 nicolaas jberger okay :)
16:17 jberger_ websockets are necessarily evented, so you are going to have to come to grips with event loops
16:17 sri there is no "app websocket object"
16:17 nicolaas jberger_ grips ?
16:17 jberger_ the nice thing about Mojo::Redis is that it uses the same event loop as Mojolicious (by design) so that they play nicely together
16:17 jberger_ sorry, "learn about
16:17 jberger_ "
16:18 nicolaas okay
16:18 sri nicolaas: i would recommend starting with the much more simple cookbook recipes then
16:18 sri http://mojolicio.us/perldoc/Mojolic​ious/Guides/Cookbook#REAL-TIME_WEB
16:18 jberger_ also Mojo::IOLoop plays nicely with AnyEvent (when used correctly, see the guides) so there are lots of tools available to you from CPAN
16:18 sri to get a feel for non-blocking apps
16:19 jberger_ AnyEvent is a very popular event loop
16:19 nicolaas jberger_ sri: yes thanks, I'll give all of it a try this week end
16:19 jberger_ np
16:19 jberger_ :-)
16:20 nicolaas jberger_ indeed, often heard about it ... I have to get more into this before making something complicated, because it's still blurry for me
16:20 nicolaas thank you, have a nice week end
16:20 jberger_ you too
16:24 SmokeMachine joined #mojo
16:24 mire_ joined #mojo
16:25 egopro joined #mojo
16:33 jberger_ http://blogs.perl.org/users/joel_berger/2013/05/my​-mojolicious-introduction-now-updated-for-40.html
16:36 dod joined #mojo
16:43 whitebook joined #mojo
16:54 d4rkie joined #mojo
16:55 egopro joined #mojo
17:00 mib_0wndzi joined #mojo
17:01 mib_0wndzi left #mojo
17:11 whitebook joined #mojo
17:12 sh4 joined #mojo
17:13 rem_lex| joined #mojo
17:26 egopro joined #mojo
17:34 sri here's a fun mojolicious 4.0 hack
17:34 sri plackup -Mojo -e 'enable "InteractiveDebugger"; app->plugins->unsubscribe("around_dispatch"); a(sub { die  })->start'
17:41 btyler joined #mojo
17:53 sh3 joined #mojo
18:03 denisboyun_ joined #mojo
18:07 marty joined #mojo
18:12 * jberger is so spoiled by Mojolicious installation time
18:12 * jberger is installing Plack right now
18:26 abra joined #mojo
18:28 egopro joined #mojo
18:36 Mike-PerlRecruiter_ joined #mojo
18:36 whitebook joined #mojo
18:52 basiliscos joined #mojo
18:55 mire_ joined #mojo
18:55 * GTodd-PerlRecruitee <--- knows CamelCase
18:59 ynonp joined #mojo
18:59 egopro joined #mojo
19:03 * sri <--- knows beer
19:05 sri oh, a new github app http://gittyapp.com
19:05 sri looks pretty
19:05 tadzik pritty
19:23 denisboyun_ joined #mojo
19:30 egopro joined #mojo
19:31 berov joined #mojo
19:38 whitebook joined #mojo
19:42 njlg joined #mojo
19:44 ynonp joined #mojo
19:53 btyler joined #mojo
19:56 sh4 joined #mojo
20:01 egopro joined #mojo
20:14 perlite joined #mojo
20:18 sh3 joined #mojo
20:19 sh3 joined #mojo
20:21 delias joined #mojo
20:29 mattastrophe joined #mojo
20:32 egopro joined #mojo
20:33 tempire someone remind me what the problem with perl threads are
20:36 tempire oh right, just when comparing them to non-green threads
20:41 sri tempire: they are way way way expensive
20:42 sri full interpreter per thread and no shared memory, to the point where forked processes are a lot cheaper
20:43 sri sad thing is... i believe ithreads could actually be fixed
20:44 denisboyun_ joined #mojo
20:44 sri with the go concurrency pattern
20:45 sri add green threads to perl, and map them to a pool of ithreads
20:46 sri but there is prolly nobody around anymore who could do it
20:50 tianon all jumped ship to perl6?
20:51 whitebook joined #mojo
20:55 sri or just went inactive
20:56 sri i bet hybrid threads would fit very well into perl
20:57 tadzik @sri | add green threads to perl, and map them to a pool of ithreads
20:57 sri parrot has hybrid threads actually
20:57 tadzik sounds Go-like
20:57 sri it is
20:57 sri Go is making hybrid threads popular again :)
21:03 egopro joined #mojo
21:06 ynonp joined #mojo
21:20 tempire hmm
21:20 tempire so threads::shared is not as it seems?
21:20 tempire ah, locks
21:23 jberger_ I don't know anything about this stuff, but has anyone looked at the MCE module?
21:23 jberger_ http://p3rl.org/MCE
21:24 jberger_ the author has been pushing it in the Perl sciencey world
21:27 gryphon joined #mojo
21:32 sri jberger_: in the end it's just fork
21:32 jberger_ yeah, I assumed it wasn't anything magical
21:33 whitebook joined #mojo
21:34 egopro joined #mojo
21:53 sri hmm
21:53 sri t('Hello <%= shift %>')->('jberger') would be kind of a neat api for Mojo::Template
21:54 sri but who uses Mojo::Template like that
21:55 jberger it would be neat for ojo, but I don't know if it would get used much
21:56 jberger does Mojo::Template overload &{} ?
21:56 * jberger looks
21:56 sri i've also thought about moving x() into Mojo::DOM... but same question... who uses it like that
21:56 avenj I could in some places ... but I have a tendency to abuse Mojo::Template a lot ;-)
21:58 * jberger kinda likes the &{} overload idea
21:58 jberger and what does a shortcut hurt I guess?
21:58 sri jberger_: it needs a good use case though :)
21:59 jberger dunno
21:59 sri just mapping ->() to ->interpret() is a bad idea imo
21:59 jberger isn't that what your example does?
22:00 sri t('Hello {{= shift }}')->tag_start('{{')->tag_end('}}')->('jberger')
22:00 sri you would make this not work
22:01 sri i would make t() only create a new object and set ->template()
22:01 sri and ->() do all the hard work if necessary
22:01 jberger oh, well sure
22:01 jberger I never said make it directly `interpret` did I?
22:03 jberger hmmmm, what would t do about subclasses?
22:03 sri not work
22:04 sri same as bytestream, collection and json
22:05 sri it's just sub t { __PACKAGE__->new(template => shift) }
22:05 egopro joined #mojo
22:05 jberger https://github.com/jberger/Mojolicious-Plugin-​LaTeX/blob/master/lib/MojoX/Template/LaTeX.pm
22:06 sri ->() would work though
22:06 jberger I wouldn't think that subclassing bytestrean collection or json are likely (maybe json)
22:06 jberger but template could definitely be
22:06 sri you can make your own t function very easily
22:06 sri if you want to
22:06 jberger yeah, it could just be specified in the subclass, you're right
22:07 jberger the import routine could try to be clever though
22:08 sri you might have to define @EXPORT_OK again
22:08 sri but inheriting Exporter::import is fine
22:09 jberger anyway, I think it might be cute, but I'm not going to spearhead
22:11 sri yea, it's cute, but i don't think i have a use for it atm either
22:35 sh4 joined #mojo
22:36 egopro joined #mojo
23:07 egopro joined #mojo
23:27 Adura joined #mojo
23:38 egopro joined #mojo
23:45 salparadise joined #mojo

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