Camelia, the Perl 6 bug

IRC log for #mojo, 2013-09-07

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

All times shown according to UTC.

Time Nick Message
00:00 jberger_ joined #mojo
00:09 jberger joined #mojo
00:27 xaka joined #mojo
00:30 Liam`` joined #mojo
00:53 asarch joined #mojo
01:13 jberger_ joined #mojo
01:22 basic6 joined #mojo
01:39 btyler joined #mojo
02:01 russum joined #mojo
02:27 sixBB joined #mojo
02:57 russum left #mojo
03:11 jberger joined #mojo
03:26 preflex_ joined #mojo
03:41 jberger_ joined #mojo
04:33 dqw joined #mojo
05:00 asarch joined #mojo
06:24 mire joined #mojo
06:28 Vandal joined #mojo
06:38 Vandal joined #mojo
06:46 ladnaV joined #mojo
06:51 d4rkie joined #mojo
07:09 dotandimet joined #mojo
07:10 xaka joined #mojo
07:21 dotandimet1 joined #mojo
07:29 Vandal joined #mojo
07:38 dod joined #mojo
07:44 dod joined #mojo
08:22 trone joined #mojo
08:36 denisboyun joined #mojo
08:39 dotandimet joined #mojo
08:50 basiliscos joined #mojo
08:57 KindOne joined #mojo
09:36 arpadszasz joined #mojo
10:29 bowtie_ joined #mojo
10:35 arpadszasz joined #mojo
10:54 dqw joined #mojo
11:00 KindOne joined #mojo
11:06 yakudza joined #mojo
11:16 KindTwo joined #mojo
11:30 KindOne joined #mojo
11:33 hummeleBop joined #mojo
11:34 denis_boyun joined #mojo
12:03 espent joined #mojo
12:14 dqw joined #mojo
12:43 asarch joined #mojo
12:56 sh4 joined #mojo
13:18 btyler joined #mojo
13:29 KindOne joined #mojo
13:40 dqw joined #mojo
14:45 dod joined #mojo
14:46 dod joined #mojo
14:55 jberger joined #mojo
15:04 sixBB joined #mojo
15:39 russum joined #mojo
15:45 russum left #mojo
15:57 batman what is the module called that i can use to print the code a callback ref is called?
15:59 batman B::Deparse i guess... didn't work exactly as i wanted...
16:03 dod joined #mojo
16:37 whatitdo joined #mojo
16:37 jberger batman, if B::Deparse was even close to what you wanted (meaning, if I'm understanding you correctly), its the only thing that will do what you are looking for (that I'm aware of)
16:38 batman right.
16:38 batman it didn't do that, but i think there's something else that is messed up
16:38 batman i think i'm trying to solve my problem with the wrong tool
16:38 batman so...now i'm solving another problem :)
16:39 jberger if you think you need to deparse, IMO your problem is somewhere else :-)
16:39 batman haha
16:39 batman true that
16:39 * batman puts on some musick
16:40 batman -k
16:40 * jberger learns vim
16:40 batman let me know if you got any questions
16:40 batman what's your current editor?
16:40 jberger I've been using gedit :-o
16:40 sri :o
16:40 batman oh.
16:41 batman notepad on steroids :P
16:41 jberger yeah
16:41 batman jberger: ever considered sublime?
16:41 jberger it at least has syntax highlighting
16:41 batman haha
16:41 sri you might also like sublime text
16:41 jberger I did look at that a while back (on the recommendation of sri IIRC)
16:41 sri batman: heh
16:42 jberger I have one reason why vim became my target, its available on my work machine (which is a pain to install things on)
16:42 batman i'm in limbo world: http://screencloud.net/img/screenshots​/9ece7974d7ab6634bff8ca43b14f2f43.png
16:43 batman got my terminal making me do vim from time to time ;)
16:43 batman making = i still like it actually
16:43 sri well, if you like the vim way then it's awesome
16:43 jberger the only "full featured" editor I've ever really used is eclipse, which has a really nice LaTeX plugin
16:44 batman sublime got a gazillion latex plugins. haven't used them myself though
16:45 batman jberger: https://tutsplus.com/course/impr​ove-workflow-in-sublime-text-2/ <-- nice tuts for sublime
16:45 batman im
16:45 batman imo
16:45 sri reminds me that i wanted to read that new vim book
16:45 jberger I'm not likely to need them or any other LaTeX editor for a while :'(
16:45 batman ok... i have no idea... haven't ever used latex :/
16:45 sri http://www.amazon.com/Practical-Vim-Thou​ght-Pragmatic-Programmers/dp/1934356980
16:46 sri only 5 star ratings :)
16:46 jberger yanick recommended http://pragprog.com/book/dnvim/practical-vim
16:46 jberger but I'm open to any and all
16:46 batman jberger: the reason i could switch to sublime was that it had vim support
16:47 batman ...at least good enough vim support
16:47 jberger oh, same book :-)
16:47 batman whenever i'm in an editor, my fingers reach for hjkl...
17:19 btyler jberger: I imagine you've been inundated with 'oh read this article to get going with vim!' links, but this is the one that helped me get vim feeling useful without too much struggle: http://stevelosh.com/blog/2​010/09/coming-home-to-vim/
17:19 jberger btyler, thanks, yeah I've got plenty to read, but I'll add it to the list
17:38 mire joined #mojo
17:45 xaka joined #mojo
17:51 d4rkie joined #mojo
18:29 good_news_everyone joined #mojo
18:29 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/XEO0tg
18:29 good_news_everyone mojo/master 873ea09 Sebastian Riedel: more links
18:29 good_news_everyone left #mojo
18:47 denis_boyun joined #mojo
18:59 * sri still wonders if $delay->wait should die on errors in steps
19:00 sri it might actually get in the way if you want to make things portable
19:04 sri http://pastie.org/8306519 # here's an example
19:05 sri ->wait would die, resulting in the exception page, instead of the json
19:06 sri batman: did you consider that when you proposed that it should die?
19:08 whatitdo joined #mojo
19:08 sri jberger: maybe you can take a look too
19:08 * sri pokes marcus too
19:21 sri you'd have to wrap it in an eval {} to make it portable again
19:22 sri eval { $delay->wait } unless Mojo::IOLoop->is_running;
19:22 sri marcus, jberger, tempire, crab, batman: is that what we want?
19:28 jberger I don't understand, why does wait die?
19:28 sri https://github.com/kraih/mojo/blob/​master/lib/Mojo/IOLoop/Delay.pm#L30
19:32 jberger perhaps wait shouldn't subscribe to the error event if there is an error event subscriber?
19:33 sri and how would ->wait ever stop then?
19:33 jberger "your error handler might want to stop the ioloop"
19:33 sri ewww
19:34 jberger yeah, not sure I like it either
19:34 * jberger thinks some more
19:34 sri and what would wait return then?
19:34 jberger is there any way to ensure that wait's error handler is called last?
19:35 sri no, why does it matter?
19:35 jberger brb
19:43 sri anyway, i don't think any of that is important
19:43 sri what matters is what the intended behavior for ->wait should be
19:45 jberger no, I got it
19:46 jberger wait shouldn't die $err but return Mojo::Exception($err)
19:46 sri use case?
19:46 jberger can you die inside the error event?
19:47 jberger thats probably a no-no right?
19:47 dsteinbrunner joined #mojo
19:47 sri you can, but it propagates up the stack
19:47 sri horrible portability problems
19:47 jberger right
19:47 sri the point of ->wait was to make stuff portable
19:48 jberger so give the user a chance to detect an error coming out of wait by wrapping it in a known class
19:48 sri you add "$delay->wait unless Mojo::IOLoop->is_running" and your delay using helper works in every environment
19:48 sri you have the error event to detect errors
19:49 sri it could also just return an empty list/undef
19:49 jberger yes, you detect and do something, but you can't (really) die
19:49 sri actually, i'm not following your way of thought
19:49 sri delays are mostly async, which means you just can't die
19:50 sri ->wait is just a wrapper to make it portable, it really shouldn't change how you use delays
19:50 jberger return defined $err ? Mojo::Exception->new($err) : wantarray ? @args : $args[0];
19:50 jberger for line 30 of ::Delay
19:50 sri imo that's horrible, since it requires special logic if you're blocking
19:51 sri now you have exception logic for non-blocking, and separate logic for blocking
19:51 jberger if you get back an exception object then you had an exception, seems fine for me
19:51 sri and how does that look in code?
19:51 jberger you were just going to throw it away with eval { ->wait } unless ...
19:52 sri unless (Mojo::IOLoop->is_running) { my $foo = $delay->wait; if ($foo->isa(...)) { ... } else { ... } }
19:52 sri that's *a lot* of boilerplate
19:52 sri and doesn't even cover the non-blocking case
19:52 sri jberger: NOOOOO!
19:53 jberger ok, hold on
19:53 sri i wasn't going to throw it away, i was going to handle it portably in the error event
19:53 sri http://pastie.org/8306519 # this is how i do it, portably
19:53 jberger what did the portable logic do on an error before delay trapped the errors
19:53 sri that paste works blocking and non-blocking
19:54 sri the ->wait return value is irrelevant if you want to make it portable
19:55 jberger so the problem is, in blocking mode you want this to die with the error (in the main stack) and if you are nonblocking then don't die?
19:55 sri ok, another try
19:55 sri http://pastie.org/8306603 # this is how portable looks now
19:55 sri i don't want it to die, it's just what it does now
19:56 jberger so why not have wait return something that looks like an error, but doesn't die
19:56 sri what's the use case?
19:56 jberger then you have the opportunity to rethrow if you want, but the portable logic stays the same
19:56 sri make a paste
19:57 sri just hack up mine, i want to see what use case it makes better
19:57 jberger your non-eval paste is still the same in my case, let me work up the other case
20:00 jberger you only call wait, expecting a return or else death, in non-portable blocking code correct?
20:01 sri yes
20:01 sri perhaps giving ->wait a return value at all was a mistake
20:02 jberger http://pastie.org/8306625
20:02 jan joined #mojo
20:02 jberger in this way, you push the extra burden into the rare case of non-portable blocking code
20:02 jberger all other code stays as was
20:03 sri "my $res = $delay->wait" and have it die on failure is less code
20:03 jberger but it changes the behavior in the more common case
20:04 sri would you really want to see code like "die $res if eval { $res->isa('Mojo::Exception') };" in the documentation?
20:05 jberger Mojo::Loader does essentially the same thing
20:05 asarch joined #mojo
20:06 sri no isa checks, and that is its main use case
20:06 sri also no eval
20:06 sri just true/false/ref
20:06 jberger but now its better to have all of the portable examples suddenly have an extra eval {} in them?
20:07 sri no, which is why i'm in favor of option 3
20:07 sri don't die, don't return errors
20:07 jberger thats fine by me I guess, except then how DO you die of an error in your delay code
20:08 jberger if that is what you want
20:08 sri my $err; $delay->on(error => sub { $err = pop }); die $err if $err;
20:09 jberger personally I prefer mine, but that is probably fine too
20:09 jberger s/probably/
20:09 sri think i'd rather get rid of ->wait return values than document eval/isa hacks :)
20:11 jberger btw, you could still do your method with my code :-)
20:12 sri btw. we do not document any examples with steps and ->wait returning something
20:13 sri https://github.com/kraih/mojo/blob​/master/lib/Mojo/UserAgent.pm#L515
20:14 sri all are variations of that one
20:15 sri i don't actually think steps + ->wait returning something makes sense as a use case
20:15 sri you can always do the same in the final step
20:17 jberger I think the wait return value makes a lot of sense in a non-portable blocking scenario, I don't think that they should go away over this
20:17 sri i disagree, they make no sense with steps
20:18 sri (if that's what you meant)
20:18 jberger why is that any different?
20:18 sri in a pure blocking scenario, i think there won't be steps
20:19 sri see the Mojo::UserAgent example i linked to
20:19 sri doing concurrent requests, that's how i see it getting used
20:19 sri steps are for portability
20:20 sri if you know you block anyway, you can keep it flat and use multiple delays like that
20:20 jberger IHMO step are for simplicity in callback hell situations, who cares what the rest of the process is doing
20:21 sri that's the point, if you can block, there is no callback hell
20:21 sri all you need is a few ->begin's and a ->wait
20:21 sri steps would just be more verbosity to achieve the same
20:22 jberger yes you are probably right, but why not, if for nothing else, then for lack of cognitive dissonance with delay
20:23 jberger my opinion, wait should return undef on errors if that suits you, but I see no reason to remove the return value of wait just because
20:24 sri oh, i wasn't arguing for that :)
20:24 sri the use case in Mojo::UserAgent is very valid
20:25 jberger "<sri> i don't actually think steps + ->wait returning something makes sense as a use case"
20:25 sri i was arguing for returning undef on error because steps+return value is a bad use case
20:25 sri right
20:26 sri the Mojo::UserAgent use case has no steps
20:26 sri just ->wait with return values
20:26 jberger it wouldn't be the first time you had removed something that hadn't originally been at odds :-) I was just getting out ahead of that
20:26 sri ;p
20:27 jberger ok, I'm fine with returning undef on errors
20:27 jberger seems more sane than dying
20:27 sri it's documented and tested, couldn't change that case even if i wanted to
20:27 jberger and if you don't want isa hacks, then this is where we are
20:28 sri only use case i see for steps + wait (in general) is portability, so this is the way to go
20:28 * jberger feels sad that he accidentally whipped out gedit when the time crunch was on to make a pastie :-/ # bad new vimmer
20:29 sri AND I THOUGHT VIM WAS SUPPOSED TO MAKE YOU MORE PRODUCTIVE
20:29 jberger I'm sure it will (one I get comfortable navigating in it) :-P
20:30 * jberger needs to learn tabs or something soon
20:31 sri https://github.com/kien/ctrlp.vim # i like this one for buffer navigation
20:35 perlite joined #mojo
20:36 good_news_everyone joined #mojo
20:36 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/hANqbQ
20:36 good_news_everyone mojo/master af43379 Sebastian Riedel: fixed portability bug in Mojo::IOLoop::Delay
20:36 good_news_everyone left #mojo
20:37 good_news_everyone joined #mojo
20:37 good_news_everyone [mojo] kraih tagged v4.33 at 289e6eb: http://git.io/_1zcJw
20:37 good_news_everyone left #mojo
20:42 jberger I see that one in some lists of recommended vim plugins
20:42 jberger I hadn't gotten to all of them yet
20:42 hesperaux joined #mojo
20:43 sri it's the only plugin i need, besides mojo.vim
20:43 jberger mojo.vim? do tell
20:44 sri http://www.vim.org/scripts​/script.php?script_id=3168
20:44 jberger <3 VAM
20:46 dotandimet joined #mojo
20:47 jberger mojo.vim++
20:47 jberger nice!
20:47 rem_lex| joined #mojo
20:47 sri oh, and i need my theme of course!
20:48 sri http://twitpic.com/8dzse4/full # used to be my vim setup
20:49 * jberger steps out for a bit
20:54 jberger__ joined #mojo
20:54 good_news_everyone joined #mojo
20:54 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/lSCdUw
20:54 good_news_everyone mojo/master f0577eb Sebastian Riedel: documentation tweak
20:54 good_news_everyone left #mojo
22:17 zacts joined #mojo
22:56 jberger_ joined #mojo
23:34 dvinciguerra joined #mojo
23:51 dvinciguerra_ joined #mojo

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