Camelia, the Perl 6 bug

IRC log for #mojo, 2013-04-07

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

All times shown according to UTC.

Time Nick Message
00:04 memowe joined #mojo
00:10 egopro joined #mojo
00:13 denisboyun joined #mojo
00:26 basiliscos joined #mojo
00:31 basiliscos joined #mojo
00:34 zacts joined #mojo
00:35 drift joined #mojo
00:50 TitanOfOld joined #mojo
00:59 ka2u joined #mojo
01:04 whitebook joined #mojo
01:13 egopro joined #mojo
01:31 egopro joined #mojo
01:36 sri looks like all mojolicious problems are solved for now, lets if i can spend some more time on mango again :)
01:56 Meiermann joined #mojo
01:58 lammel2 left #mojo
02:01 StylusEater buu: figured it all out
02:15 buu StylusEater: Yay =]
02:15 StylusEater buu: might be useful to write up a wiki doc on this
02:15 StylusEater buu: I'll see what I can do
02:16 buu I'm sure documentation is always helpful
02:16 StylusEater buu: sleep calls .. later
02:37 whitebook joined #mojo
02:53 preflex_ joined #mojo
03:09 crab joined #mojo
03:22 egopro joined #mojo
03:26 mattastrophe joined #mojo
03:31 asarch joined #mojo
03:50 mattastrophe joined #mojo
04:09 sri jberger: btw. just noticed something re your idea for $delay->begin to return an object, there are ref $cb eq 'CODE' checks all over the place, you couldn't get past that
04:10 jberger hmmm
04:10 jberger yeah, thats a toughie
04:11 * sri is still thinking about ways to polish delays :)
04:11 * jberger cheers on sri
04:22 basiliscos joined #mojo
05:05 basiliscos joined #mojo
05:09 ObseLeTe joined #mojo
05:09 whitebook joined #mojo
05:15 d4rkie joined #mojo
05:25 ObseLeTe joined #mojo
05:35 komodo1 joined #mojo
05:38 kumogami joined #mojo
05:48 Britzel_ joined #mojo
05:56 basic6 joined #mojo
06:03 egopro joined #mojo
06:04 egopro_ joined #mojo
06:39 egopro joined #mojo
06:46 Vandal joined #mojo
07:01 sh4 joined #mojo
07:01 Vandal joined #mojo
07:07 davido joined #mojo
07:15 kitt_vl joined #mojo
07:29 dotan joined #mojo
07:36 mattastrophe joined #mojo
07:40 egopro joined #mojo
07:54 jzawodn joined #mojo
08:00 mattastrophe joined #mojo
08:08 egopro joined #mojo
08:11 kitt_vl joined #mojo
08:57 duncanthrax joined #mojo
08:59 Britzel joined #mojo
09:00 denisboyun joined #mojo
09:07 dod joined #mojo
09:22 dod joined #mojo
09:33 heytrav joined #mojo
09:49 coff joined #mojo
10:06 kitt_vl joined #mojo
10:32 egopro joined #mojo
10:33 egopro_ joined #mojo
10:39 Britzel_ joined #mojo
10:45 bowtie joined #mojo
11:25 egopro joined #mojo
11:31 egopro_ joined #mojo
11:32 egopro joined #mojo
11:59 mire joined #mojo
12:07 dexteruk|2 joined #mojo
12:07 dexteruk|2 Hi All, newbie here... So please be kind :-)
12:08 dexteruk|2 I have been told your all mighty freindly here :-D
12:11 dexteruk|2 using morbo to run a little applicaiton but it seems to not be able to find the javascript file i created its in the same directory but it tells me the file is not found
12:12 dexteruk|2 im calling the js in the __DATA__ <script type="text/javascript" src="ws.js"></script>
12:12 Britzel_ it looks in/below the 'public' directory.
12:16 dexteruk|2 Britzel_: thanks, now i feel blond :-D
12:17 Britzel_ dexteruk|2: Don't :) You said that you were a newbie.
12:17 Britzel_ My #1 genral hint for Mojo: Read the docs. It's nearly everything in there. Sometimes a little but hidden, or not immediately obvious, but's most of it is there.
12:20 dexteruk|2 Britzel_: Yes, Perl has recently become my number 1 language, and now i just discovered Mojolicious and my mind is bursting with possibilites..  Im not the greatest programmer but i love learning new things.  And i was looking at developing a websocket appliacation to push messages from all my servers so i can see events as they happen
12:22 dexteruk|2 i think its always easier to learn new things when you have a target to reach, and you learn much more when you have to overcome problems
12:24 dexteruk|2 so how long have you been using Mojo?
12:24 Britzel_ about 1 yr
12:24 Britzel_ perl for 12 or so.
12:24 Britzel_ before mojo: cgi-bin, mod_perl and Catalyst.
12:25 dexteruk|2 Wow, im actually a sysadmin and not a programmer, thats why i ended up having a look at perl.. And i fell in love with it
12:25 dexteruk|2 20 years of linux sysadmin under my belt
12:25 Britzel_ Yeah, it's really a good language. For many things...
12:26 dexteruk|2 there is just so much stuff already there and cpan makes it so easy to reach
12:28 dexteruk|2 I was thinking of rewriting my Restful API's using Mojo... From what i can see is that most of companies out there are using Ruby or Python for API's I just dont understand why the likes of Perl/Mojo have not had a better adoption.  Or maybe they have they just dont care to advitise :-D
12:31 dexteruk|2 What do you think?
12:31 whitebook joined #mojo
12:34 StylusEater dexteruk|2: I've wondered the same thing... a lot of folks I know at work think Perl isn't "sexy."
12:36 Britzel_ dexteruk|2: I am probably much too little of a SW professional to give my advice on such items like that.  All I can say is that writing RESTful APis  with Mojo is dead simple. if it's worthwhile rewriting you old apps - dunno, your call. :)
12:40 dexteruk|2 StylusEater: Since i have adopted perl, things have been so simple and it saves me time, so to me perl is very very sexy, stable, quick and uses well next to nothing when it comes to resources
12:41 dexteruk|2 and you can use it for almost anything.. From command line apps thought to fully loaded websites
12:41 dexteruk|2 how cool is that
12:41 StylusEater it's awesome
12:42 StylusEater I think Perl rocks.
12:42 dexteruk|2 Im like a kid thats been let loose in a candy store :-D
12:43 StylusEater :-)
12:43 StylusEater my biggest hurdle with mojo so far is determining whether the doc was written for Lite or full Mojo
12:43 StylusEater most of the time there seems to be a comment above the line(s) I'm reading indicating such but not always
12:43 dexteruk|2 from what i can tell there is not much difference
12:43 dexteruk|2 lite is a single file
12:44 StylusEater the way various options are used/called ... there is
12:44 StylusEater like loading plugins or helpers
12:44 Britzel_ StylusEater: Exactly my problem (doc applies to lite/full).
12:45 StylusEater it took me a good amount of time yesterday to debug a custom plugin problem ... mainly because of that
12:46 dexteruk|2 from the videos i have been watching i was lead the idea that there wasnt much diffence between the two :-(
12:46 StylusEater there is
12:46 Britzel_ There isn't. Still it introduces a lot of confusion for me.
12:46 Britzel_ lol
12:46 StylusEater don't get me wrong... I love mojo.
12:46 dexteruk|2 just diffent structures depending on your application
12:47 StylusEater haha
12:47 StylusEater is ... isn't ... is ... isn't
12:47 StylusEater :-)
12:47 Britzel_ of course there are differences, but most what#s said  about one applies to the other as well.
12:47 dexteruk|2 full apps for bigger teams of programmers and lite for a single file application that is quicker to develope but harder to follow if it turns into a big app
12:48 dexteruk|2 so which is easier?
12:49 dexteruk|2 is it better to start with full mojo app
12:49 Britzel_ I find all this 'lite' stuff simply confusing. I understand where sr_i came from (Catalyst), and what he wanted to  achieve. But still I think it should be more separated, doc wise.
12:49 StylusEater timtowtdi
12:49 Britzel_ I started right with a full mojo app, because I knew a lite app wouldn't do in my case. That lead me to the error not reading about lite in the beginning.
12:50 StylusEater err ... timtowdti ... haha
12:50 StylusEater you can always write a lite app then generate the full one when it gets difficult to manage
12:50 StylusEater another awesome feature
12:50 dexteruk|2 :-)
12:57 j3nnn1 joined #mojo
12:59 egopro_ joined #mojo
13:05 lammel2 joined #mojo
13:09 asarch joined #mojo
13:14 rihegher joined #mojo
13:14 rihegher left #mojo
13:39 sri the documentation tells you what to start with http://mojolicio.us/perldoc#TUTORIAL
13:42 mire joined #mojo
13:43 Adura joined #mojo
13:55 j3nnn1 left #mojo
13:58 whitebook joined #mojo
14:06 fhelmber_ joined #mojo
14:09 wingfold joined #mojo
14:13 two_tired joined #mojo
14:23 jberger o/
14:23 jberger there really isn't much different between lite and full
14:24 jberger the aparent difference is that lite is "functional" while full is OO, but under the hood thats not true
14:25 whitebook joined #mojo
14:25 jberger in lite the "functions" are just wrappers for app and controller methods
14:25 jberger and router methods
14:25 HtbaaPi_ joined #mojo
14:26 jberger in truth the only thing thats really different between the two is how the "under" function works versus the method form
14:27 jberger and yeah, Perl/Mojo makes me feel like a kid in a candy store too
14:28 jberger anyway, to do any major project I always will end up at "full"
14:29 jberger sometimes I start as a "lite" app and then follow GROWING which works nicely
14:29 gryphon joined #mojo
14:29 jberger but mostly I use "lite" for minimal examples when I need to how something is (or isn't) working
14:30 jberger its much nicer to be able to have something self contained rather than having to paste an entire directory structure
14:30 jberger and thats why you see it in the docs so much
14:30 zivester joined #mojo
14:37 Akron joined #mojo
14:38 Akron jberger: That's funny. I used to start full apps and now I nearly always try to make everything in a lite app - putting everything else in plugins.
14:38 jberger Akron, I guess you could do that
14:39 Akron Watching this coming up over and over again I guess "Where do I put my static files" seems to be a good candidate for the FAQ.
14:39 jberger I don't factor things into plugins unless I intend to reuse that logic in multiple apps
14:39 jberger timtowtdi++
14:39 jberger Akron, where is the first prominent mention of static file locations?
14:40 Akron jberger: Yes. Most of the time it starts with app->helper() in the app and after a while I think "Hm - let's make this more general ..."
14:40 Akron jberger: You mean in the docs?
14:40 jberger yeah
14:41 Akron lite doc.
14:41 Akron Do you think putting that in the FAQ would encourage users to skip the lite doc?
14:42 jberger thats my fear
14:42 jberger you don't want to end up with all the doc repeated in the FAQ
14:43 Akron Maybe I take the acronym "FAQ" too literally. ;)
14:43 jberger hehe
14:44 jberger I will say, https://metacpan.org/module/M​ojolicious::Lite#Static-files doesn't tell you how to manipulate the static paths
14:44 jberger I would say if we wanted to put static files in the FAQ it might be to have a place to talk about that too
14:45 jberger IIRC manipulating the static paths is only documented in the Guides in the context of making installable plugins
14:45 jberger which is a very different topic if you're just a newbie looking for how to do that
14:46 Akron Ah ... maybe. I also think, people starting to work through the lite app doc just use it like a tutorial - and so they never try to create a new folder - that's why they forget about "public".
14:53 jberger sri: I was thinking last night about ref $val eq 'CODE' checks
14:53 jberger and it strikes me that that not only excludes a class which overloads @{}
14:53 jberger but it also excludes blessed coderefs
14:54 jberger so I made this: https://gist.github.com/jberger/5330790
14:54 jberger which might be a candidate for Mojo::Util
14:54 sri jberger: i think it's too late for that
14:56 jberger sri: I could understand "thats not the desired behavior" but I don't understand "too late". what do you mean? just too much work to change it all
14:57 sri there are 3rd party modules now
14:58 sri i can also see it break backcompat
14:58 jberger I doubt this would break too many of them, not many things do overload @{} and not to many classes use a coderef
14:59 sri strongly disagree
14:59 sri you have no idea what people pass as URL to $ua->get(...) for example
15:00 sri or way more tricky, all the Mango methods
15:00 jberger true, but I would expect that if I passed a blessed coderef in the callback slot at least, that it would be used as a callback
15:01 sri umm, there is no callback slot
15:01 sri you might want to look at how it is implemented
15:01 jberger the last argument
15:01 jberger if $_[-1] eq CODE
15:01 sri the URL can be the last argument
15:02 sri not to mention custom generators
15:02 jberger but none of that breaks with `if looks_like_coderef($_[-1])`
15:02 sri of course it does
15:04 sri if i have a custom generator i pass an object to that overloads &{}, it breaks
15:04 * sri assumes jberger meant &{}
15:05 jberger damn, yes I did
15:06 jberger ok, I can see the custom generator problem
15:06 sri and that's only the start, now look at Mangi
15:06 sri *Mango
15:08 jberger serializing and storing an object which overloads &{} ?
15:08 sri there are dozens of methods that all behave differently
15:08 Akron (sri accidentally just leaked the name for Mango::Lite)
15:09 jberger hahaha
15:09 sri ;p
15:09 sri http://grep.cpan.me/?q=%26%7B%7D
15:09 sri it's used quite a bit
15:10 jberger well its too bad, I can see lots of uses for using an object for the callback
15:11 jberger not as many for using a blessed coderef
15:11 sri $object->to_closure
15:11 sri not like it makes anything impossible
15:11 jberger but you're never going to use that for ->begin :-)
15:12 sri how would an object make ->begin better?
15:13 jberger now that begin(0) is a thing, it wouldn't for now
15:14 sri we are arguing about something that doesn't even have a good use case yet ;p
15:14 jberger but I can see there being other behaviors one might want to tweak
15:14 jberger you brought it up :-)
15:14 sri actually, you did :)
15:15 jberger http://irclog.perlgeek.de/​mojo/2013-04-07#i_6673505
15:16 jberger either way, the discussion has been productive, at least for me
15:18 Akron People blessing code refs scare me.
15:21 jberger Akron, if you're careful you can use it to make objects with truly private data
15:23 coff joined #mojo
15:24 * sri hopes the simplified delays are easier to grok
15:24 Akron jberger: I don't allow my objects to post their party photos to FB, so I don't care. ;)
15:24 mattastrophe joined #mojo
15:25 sri at least the two use cases support each other in documentation now
15:26 sri (as in the synchronize example shows that there's a closure returned http://mojolicio.us/perldoc​/Mojo/IOLoop/Delay#SYNOPSIS)
15:26 Akron jberger: Why shouldn't I use closures with get/set to reach that goal? Even in Damians book the only example for blessed code refs is a pretty printer as far as I remember.
15:28 jberger in trying to show what stevan wanted for p5mop, I made this: https://gist.github.com/jberger/4975132
15:30 jberger see his example: https://github.com/stevan/p5-mop/blob/ma​ster/t/000-examples/001-basic-example.t
15:30 jberger sri: delay looks really nice as is now
15:31 jberger I can see myself using it in non-Mojolicious contexts if needed
15:31 Akron That's really interesting, thank you.
15:33 * Akron didn't even know about mro.
15:33 sri the biggest problem for delays might be that the concept has no good name :S
15:33 sri promises and futures are easy to google
15:33 jberger Akron, in the end Perl only has two ways to store data, the stash and pads. Stevan's problem is that the stash is tied to package etc, so there is no real privacy
15:33 sri async control-flow thingy not so much
15:33 jberger which only leaves pad
15:34 jberger sri: make up a name
15:34 sri delays :)
15:34 jberger haha
15:34 jberger unicorn? pony?
15:34 jberger I WANT A PONY
15:36 sri pony pony pony pony pony pony pony pony pony pony pony pony pony pony pony pony pony pony pony pony pony pony pony
15:39 jberger sri: what was the js project that you mimic with delays?
15:39 Akron steps.js
15:40 jberger https://github.com/creationix/step
15:40 jberger ?
15:40 Akron Yes (oh - step.js)
15:42 jberger how about something traffic related? trafficcop or stoplight or something
15:42 mattastrophe joined #mojo
15:48 sri https://github.com/caolan/async # this one seems to be the most popular version
15:49 sri this one seems to be the most popular implementation of promises/a atm https://github.com/kriskowal/q
15:53 * sri still thinks promises will be on the way out again later this year
15:56 sri only way i see them succeed would be with generators... we'll see what happens once they reach v8 and node.js
15:56 jberger always hard to tell with fads
15:57 jberger I hear enough about them lately that might they not exist forever just because they reach some critical mass in this fast upswing
15:57 sri well, in scala it's not a fad, but they deal very differently with concurrency
15:58 sri (threads, actors and all)
16:01 sri in python they've always used deferreds/promises with twisted, it makes sense for tulip.js with coroutines
16:02 sri with javascript it's really hard to say, jquery promises are so minimal they might just as well not exist, and for node.js i don't see it get popular without support in core
16:05 sri in the end, i think promises are a choice made by the language designers :)
16:06 jberger I don't know enough about the internals
16:06 jberger I can believe what you're saying though
16:06 sri http://www.python.org/dev/peps/pep-3156/ # all about it in python
16:16 jberger ok, well its been fun, I gotta get back to typing
16:17 jberger o/
16:47 d4rkie joined #mojo
16:55 basiliscos joined #mojo
17:27 sri tempire: the little logo at the bottom is broken on mojocasts.com!
17:30 sri Bender: trust memowe
17:30 Bender OK, sri
17:30 sri Bender: trust charsbar__
17:30 Bender OK, sri
17:44 tempire sri: fixed
17:49 whitebook joined #mojo
17:51 sri \o/
18:21 sh3 joined #mojo
18:53 marty joined #mojo
19:08 heytrav joined #mojo
19:14 rem_lex| joined #mojo
19:14 good_news_everyone joined #mojo
19:14 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/o_0jbA
19:14 good_news_everyone mojo/master 70080e1 Sebastian Riedel: better description for static file handling in the tutorial
19:14 good_news_everyone left #mojo
19:15 sri i know the problem from earlier was about ignoring the tutorial completely for full apps, but a better description was long overdue
19:20 good_news_everyone joined #mojo
19:20 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/IkmtuQ
19:20 good_news_everyone mojo/master b778fac Sebastian Riedel: mention that static files have a higher precedence than routes
19:20 good_news_everyone left #mojo
19:20 sri http://mojolicio.us/perldoc/M​ojolicious/Lite#Static_files
19:29 good_news_everyone joined #mojo
19:29 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/sJPm_A
19:29 good_news_everyone mojo/master 47f40cd Sebastian Riedel: a few more tutorial tweaks
19:29 good_news_everyone left #mojo
19:31 sri hmm, wonder if static files and external templates should even be higher up in the tutorial
19:33 sri i guess it's essential information that should be at the top
19:42 good_news_everyone joined #mojo
19:42 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/LKsX0w
19:42 good_news_everyone mojo/master 51be24d Sebastian Riedel: documentation tweaks
19:42 good_news_everyone left #mojo
19:44 coff joined #mojo
20:21 sri oh, arrested development will be back in may, guess i should finally watch season 3 :o
20:39 cfedde joined #mojo
20:43 whitebook joined #mojo
21:00 cfedde joined #mojo
21:05 basiliscos joined #mojo
21:21 cfedde joined #mojo
21:24 whitebook joined #mojo
21:25 basiliscos joined #mojo
21:34 lukep joined #mojo
21:48 denisboyun joined #mojo
21:59 whitebook joined #mojo
22:16 ka2u joined #mojo
22:16 Averna joined #mojo
22:29 Mad_Dud joined #mojo
23:02 mrphilov joined #mojo
23:06 mrphilov I'm trying to do a $self->render(json => %{$hashRef}) and it doesn't work. I get server timeout. I've even tried re-encoding the hashRef as a regular hash (see http://pastebin.com/0NcK1yhU) and I still can't get it to work. From the PasteBin, the commented-out code generates real-looking JSON (but text-encoded of course), whereas the simpler uncommented code always just times out. Clues for me?
23:09 avenj feed it a reference, like json => \%myhash
23:09 denisboyun joined #mojo
23:10 mrphilov If I do that, the output is ""REF(0x100cdf9d8)""
23:10 mrphilov Er, lies from me. Ignore for a while
23:11 mrphilov (Ignore me)
23:12 mrphilov avenj: Okay, that's the idea. Though oddly I can't pass it directly my $ref hashRef. I'll try to grok this, and thanks, you've gotten me over my hump at least.
23:14 mrphilov Ah, no, I was mis-remembering. I was dereferencing my $hashRef and trying to json => \$hashRef, which prints the REF(…). So indeed doing json => $hashRef works, too.
23:16 avenj yeah, \$ref is actually a reference to a reference
23:16 hrupp_ joined #mojo
23:18 mrphilov /headdesk - Indeed, it is.
23:56 cfedde joined #mojo
23:58 ka2u joined #mojo

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