The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2015-07-12

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

All times shown according to UTC.

Time Nick Message
00:20 absolut_todd joined #mojo
00:49 lluad joined #mojo
01:08 batman jberger: vacation, and you didn't drop by Oslo..?
01:08 batman ;)
01:09 batman Hope you had a great time :)
01:28 frederico joined #mojo
01:53 mattastrophe joined #mojo
02:01 jb360 joined #mojo
02:11 buu_ joined #mojo
02:14 noganex joined #mojo
02:30 jberger batman: oslo WAS just around the corner from Michigan
02:30 jberger :p
02:31 jberger I do need some brown cheese and mackerel
02:33 mst jberger: GO AWAY
02:35 mst sri: I hope that was acceptable; if not please complain :)
02:36 avenj IRC is better with more vanity kills
02:37 avenj (I just bullseye'd myself, didn't I?)
02:37 Craftsmanship joined #mojo
02:37 Craftsmanship oi, this guy again
02:37 avenj oh crap
02:38 jberger joined #mojo
02:39 jberger Ouch
02:39 mst jberger: now fucking take your holiday
02:39 mst I can do worse :)
02:40 jberger Ok ok, I give. Uncle!
02:40 mst sri: see, it learns :D
02:40 mst (yes, I'm an asshole, shocking that ;)
02:41 jberger :o
02:41 jberger Tomorrow I finally get around to writing a blog post about phantom
02:41 jberger It's been way too long since yapc
02:41 * mst gives up and goes to bed
02:42 mst sri: I TRIED
02:42 jberger Wat?
02:42 purl Watt?  Watt?  I can't hear you, there's this buzzing noise where my brain should be. or https://www.destroyallsoftware.com/talks/wat
02:42 jberger I can't even talk about perl?
02:43 sri http://memecrunch.com/image/528da3f61605fb06f70002fe.jpg?w=400
02:47 Craftsmanship Mojo::Server::Daemon can't auto-restart on changes, can it?
02:48 jberger Craftsmanship: that's morbo
02:48 jberger Which is just a ::Daemon with the restart
02:49 jberger mst:in other news I'm happy to report that I found my mst coaster
02:52 Craftsmanship jberger: can i ask script/$moniker to use that instead?
02:53 jberger http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Morbo
02:55 Craftsmanship and that thing recursively watches directories, right?
02:56 jberger It watches certain ones by default, others can be added with command line arguments
02:59 Craftsmanship sensible defaults++
04:21 Lucas1 joined #mojo
05:03 cpan_mojo API-Twitter-0.01 by AWNCORP https://metacpan.org/release/AWNCORP/API-Twitter-0.01
05:49 kaare joined #mojo
05:56 absolut_todd joined #mojo
05:57 cfedde joined #mojo
05:58 elik joined #mojo
05:58 howitdo joined #mojo
05:59 davido__ joined #mojo
05:59 jwang joined #mojo
06:00 jb360 joined #mojo
06:03 PotatoGim^Home joined #mojo
06:17 cfedde joined #mojo
07:19 Vandal joined #mojo
07:25 trone joined #mojo
07:29 absolut_todd joined #mojo
07:31 berov joined #mojo
07:36 batman jberger: Hehe. You're welcome anytime :)
07:49 amon joined #mojo
08:16 tyldis joined #mojo
08:29 PotatoGim^Home joined #mojo
09:02 bin_005 joined #mojo
09:37 cpan_mojo Mad-Mapper-0.03 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mad-Mapper-0.03
10:02 sh4 joined #mojo
10:08 berov batman: Mad::Mapper looks very promising :)
10:09 pink_mist haha, love the name of it :P
10:09 batman thanks :) i'm very unsure in which direction i will take it...
10:09 batman but first i need to find a project where i can use it, hehe
10:12 berov I would use it in Ado to replace DBIx::Simple::Class
10:13 berov but need to figure our something like Mojo::SQLite, which I know sounds like a non sense, but will ensure consistent syntax
10:14 batman yeah... just don't try to make it async.
10:15 berov batman: yes, that is why I said nonsense
10:15 batman i mean, you need an api that can handle a callback, but just it blocking
10:15 berov yes
10:15 batman hehe. i see :)
10:17 batman i see you require a TABLE... Mad::Mapper doesn't: https://metacpan.org/pod/release/JHTHORSEN/Mad-Mapper-0.03/lib/Mad/Mapper.pm#table :)
10:18 batman this is probably the most experimental thing i have on cpan: https://metacpan.org/pod/release/JHTHORSEN/Mad-Mapper-0.03/lib/Mad/Mapper.pm#expand_sst
10:18 batman mostly because it feels so wrong. hehe
10:26 berov batman: you habe $self->table
10:26 batman yeah, but it has a default value
10:26 berov yes, as you wrote you use the last part of the class name
10:27 berov in the documentation of Mad::Mapper :)
10:28 berov batman: also evcentually you may want to support quoting of column/table names
10:28 frederico joined #mojo
10:29 batman that's interesting... i wonder if anything bad happens if that's the default
10:30 berov I do not remember already, but since i did it was bad :)
10:31 batman sorry. i don't get that sentence :/
10:32 berov batman: I mean that i qoted the columns in DBIx::Simple::Class
10:32 berov $dbh->quote_identifier($_)
10:32 batman ah. thanks
10:32 berov and this can be optional of course
10:33 batman yes
10:34 berov at some point  some type constraints may be needed too and here we have a Mojo DBix::Class HAHA
10:35 jontaylor joined #mojo
10:38 pink_mist Mojo ALL THE THINGS
10:38 pink_mist :P
11:10 punter joined #mojo
11:31 ans joined #mojo
11:35 mattastrophe joined #mojo
11:54 stephen joined #mojo
12:14 Craftsmanship joined #mojo
13:23 absolut_todd joined #mojo
13:27 cpan_mojo Mojolicious-Plugin-CGI-0.21 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-CGI-0.21
14:14 mattastrophe joined #mojo
14:18 PryMar56 joined #mojo
14:22 DaTa huh, bridge is gone
14:23 DaTa ah, in favor of under ... nice changelog
14:31 jberger DaTa: see also https://github.com/kraih/mojo/wiki/Upgrading
14:33 jberger hmmm, also does this page make any sense to anyone? https://github.com/kraih/mojo/wiki/Member-expectations
14:33 * jberger will delete if not
14:33 jberger the wiki could probably use a cleanup
14:38 ajr_ joined #mojo
14:46 jberger nuked
14:49 frederico joined #mojo
15:31 good_news_everyon joined #mojo
15:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vqjM4
15:31 good_news_everyon mojo/master 4d05633 Sebastian Riedel: more consistent JavaScript
15:31 good_news_everyon left #mojo
15:49 tyldis joined #mojo
15:54 punter joined #mojo
16:25 mattastrophe joined #mojo
16:37 tyldis joined #mojo
16:41 kaare joined #mojo
16:50 kaare joined #mojo
16:51 kaare joined #mojo
17:00 jberger does this seem like a sane solution for Perl versions that do not provide CORE::die and CORE::warn?
17:00 jberger https://github.com/jberger/Mojo-Phantom/compare/core
17:00 jberger I'm getting test failures because of these
17:04 y1mmm joined #mojo
17:05 buu_ jberger: Which versions are those?
17:06 jberger < 5.16
17:06 buu_ oh
17:06 buu I have no further comment!
17:10 bpmedley http://www.effectiveperlprogramming.com/2011/05/override-die-with-end-or-coreglobaldie/ ?
17:12 bpmedley I would start by leaning towards $SIG{__WARN__} and $SIG{__DIE__}, I think.  It has ben so long since I have done stuff like that in older perls.
17:13 jberger bpmedley: I'm not trying to hack the handlers, I'm trying to provide a consistent die mechanism
17:14 bpmedley I'd have to see a smallish example; sorry, I must be confused.
17:14 jberger https://github.com/jberger/Mojo-Phantom/compare/core#diff-2fe960962dd8f10008104512eab41db3R110
17:14 jberger the javascript returns JSON with a function name and arguments to be called
17:15 gryphon joined #mojo
17:15 jberger if I don't have CORE::die I can't send ['CORE::die', 'something horrible happened'] and have &{'CORE::die'}('something horrible happend') do what it is suppose to do
17:16 berov joined #mojo
17:17 bpmedley I see.  Hrmm.  Does it work?
17:21 meredith That seems pretty sound to me; it's connected to JS stuff and the JS world doesn't bat an eye at polyfills ;)
17:23 jberger bpmedley: the tests start passing, so yes?
17:23 jberger meredith: good point
17:23 purl nice and sharp
17:23 buu Seems pretty sane to me
17:24 jberger ok then, this is going to cpan and I can (hopefully) stop getting these failing test messages
17:25 bpmedley Hrmm.  If I'm reading this right, you're importing into CORE and not $package itself?
17:27 jberger $package is the caller's package
17:27 bpmedley local *CORE::die  <-- Doesn't that override CORE, though?
17:28 jberger yes, but only where CORE::die does not exist
17:28 jberger CORE::die actually isn't overridable in 5.16+
17:28 jberger IIRC
17:29 meredith imagine a perl without death
17:29 jberger anyway, see here, this was the failing tests
17:29 jberger https://github.com/jberger/Mojo-Phantom/blob/master/t/exception.t
17:29 jberger the $package is "main"
17:29 jberger but it calls CORE::die
17:29 bpmedley The only issue I can think of is if $package's $function expect a different handing of die and warn.  Sorry, I'm being fairly vague and what you have will work most of the time, I think.
17:30 jberger $package::$function can never be CORE::die unless the package is CORE:: which would be very unusual
17:31 bpmedley What I tried to say is: what if $function calls CORE::die or CORE::warn itself and expects different behaviour?
17:31 jberger if it is <5.16 it won't do that, because it can't and if it is >= 5.16 then I won't mess with it
17:31 bpmedley That make sense.
17:32 * jberger high-fives bpmedley
17:32 bpmedley jberger++
17:36 melo joined #mojo
18:03 mattastrophe joined #mojo
18:10 Grinnz meredith, Torchwood Miracle Day?
18:12 meredith yes, processes are meant to die
18:13 meredith incidentally i've been playing with Elixir a lot lately, so..
18:18 cpan_mojo Mojo-Phantom-0.03 by JBERGER https://metacpan.org/release/JBERGER/Mojo-Phantom-0.03
18:19 Grinnz jberger, wrong version number in Changes :P
18:19 jberger :o
18:20 risugg joined #mojo
18:20 jberger fixed in git
18:20 jberger thanks
18:20 * jberger sigh
18:20 Grinnz something something https://metacpan.org/pod/Dist::Zilla::Plugin::NextRelease
18:20 Grinnz :P
18:21 Grinnz (though i really hate the default format that plugin uses)
18:21 jberger hmmmm, now if only I didn't dislike dzil so much :-P
18:24 mattastrophe joined #mojo
18:26 batman jberger: App::git::ship also fix version numbers
18:30 jberger one of these days I'll likely write my own tool, its a rite of passage right?
18:30 jberger or maybe just pack it in and start writing VBA :-P
18:33 Grinnz lol
18:35 meredith i used to be annoyed by needing a different app for each dist to build an installable version, dzil made me annoyed by needing a different plugin bundle for each dist ;)
18:36 batman that's one of the things about git ship: you don't need it.
18:36 batman it's just an aid if you want to use it.
18:37 meredith i do have a dist.ini i mostly like, i think my only hangup left is it wanting to upload at the same time it cuts a release.
18:37 batman i really think it's stupid to force anyone to learn a tool to submit a patch or run tests :/
18:38 preaction prove -lr t works
18:38 batman :)
18:39 meredith some people really jump in on the dzil project mangling, as i understand it.  i haven't run into it personally
18:39 jberger right, except that then someone submits a patch against cpan not github and then get frustrated
18:40 preaction i like Pod::Weaver, since POD is terrible. and then i like the automated git things it does for me
18:40 jberger but that is never my concern, I'm my primary consumer and I dislike when I make easy things harder in the name of streamlining
18:40 preaction except that would happen with anything, especially if the cpan version and the github version have diverged due to ongoing development
18:40 Grinnz batman, Dist::Milla and my updated pluginbundle are specifically designed so you dont need it to submit a patch or run tests
18:41 Grinnz just to release
18:42 Grinnz https://metacpan.org/pod/Dist::Milla#Dist::Zilla-makes-contributing-difficult1
18:42 meredith i'll take a look at App::git::ship bc i've thought about mojolicious plugins a few times and i consider the generated plugin scaffold a Strong Guideline.
18:44 preaction Milla uses dzil? i thought it was its own thing
18:44 Grinnz nope, it is just a dzil pluginbundle
18:44 batman App::git::ship has awful documentation. sorry about that
18:44 Grinnz Minilla is its own thing
18:44 preaction ahh
18:45 preaction and they seem to have the same conventions, which is interesting
18:45 Grinnz yeah
18:45 Grinnz essentially miyagawa was going to write something like Minilla, but tokuhirom already had, so they worked together
18:46 preaction yeah, makes sense. those two produce some great stuff
18:46 dod joined #mojo
18:50 mattastrophe joined #mojo
18:52 _dave_ I need some advice :) http://pastebin.com/t7Mbwixf
18:52 Repaster Repasted text from _dave_: http://fpaste.org/243360/67271771/
18:53 _dave_ repaster?
18:53 purl rumour has it repaster is actually set to not respond to any command except in PM
18:53 _dave_ I'm trying to "yield"
18:53 _dave_ the pastebin makes that clear but the repast er doesn't
18:55 bpmedley _dave_: I'm confused.  Is this in a Mojo web app?
18:55 _dave_ well it will be inside one
18:55 _dave_ if I'm even on the right track
18:56 bpmedley Can  you create a smallish Mojolicious::Lite app?
18:56 _dave_ hm, yeah I can ... I'm essentially checking for a flag in a while loop
18:56 bpmedley Are you running a command and need to wait for results, or something similar?
19:08 _dave_ bpmedley: http://pastebin.com/TwPxHGPH
19:08 Repaster Repasted text from _dave_: http://fpaste.org/243383/28125143/
19:08 _dave_ That is a very contrived example
19:10 _dave_ it uses significant cpu too
19:13 thowe how do I access a helper from a Mojolicious::Command?
19:18 mst Mojolicious::Command has an app() attribute
19:19 thowe helpers seem to be available from Mojolicious::Controller->helper_name, but not Mojolicious::Controller->app->helper_name    Which I didn't quite grasp, but how do I get the helper from Mojolicious::Command?  Mojolicious::Command->app->helper_name doesn't get me my helper.
19:19 mst and it seems the helper calling code is an AUTOLOAD on $app
19:19 mst ah, the helpers live in the renderer
19:19 mst is the app even set up enough for that in your command?
19:20 thowe I don't know what "app even set up enough" means, so I'll wager "no"?
19:20 mst well, nor do I really
19:21 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Helpers
19:22 sri http://mojolicio.us/perldoc/Mojolicious#AUTOLOAD
19:24 bpmedley _dave_: https://bitbucket.org/snippets/bpmedley/ekdLe <-- This seems to work; I wonder if there is a better way?
19:25 absolut_todd joined #mojo
19:25 _dave_ if condition vars were part of Mojo::IOLoop this might be easier :)
19:26 _dave_ not that I completely understand the event driven ideas either
19:26 thowe sri, I must be missing something, because I don't see anything new at those links I haven't tried...  Do you see my above longish comment?
19:26 mst _dave_: you can use http://p3rl.org/Future with Mojo if you want
19:27 sri thowe: your comment is just wrong
19:27 mst _dave_: they're a bit like AE condvars except with features
19:27 _dave_ mst: Nice! I'll check that out
19:27 thowe I'm most confused by why Mojolicious::Controller->helper_name works when Mojolicious::Controller->app->helper_name doesn't.  But from within my Command, I can't seem to get it in anyway I try
19:28 _dave_ mst: you are implying this plays well with the Mojo event loops right?
19:28 thowe The odd thing is, app->helper_name doesn't complain, so it seems to know it exists, but it doesn't actually read the config.
19:29 mst _dave_: it's a promise-like object
19:29 _dave_ promise?
19:29 purl promise is that they wont just port, they will rewrite
19:29 _dave_ O.o
19:29 mst _dave_: also https://metacpan.org/pod/MojoX::IOLoop::Future
19:29 sri that module has terrible docs
19:30 _dave_ well yeah, it says "block" :D
19:30 _dave_ does it really mean "block"?
19:30 mst um, yes, because blocking is the only thing that requires integration
19:30 thowe keys(%{$self->config}) == 7  ;  keys(%{$self->app->config}) == 0
19:30 mst i.e. being able to call $future->await
19:30 mst if you're not trying to block you don't need any integration at all
19:30 mst and there's no 'plays well' involved
19:31 mst Object::Remote is built atop Future + its own mini-IOLoop
19:32 mst _dave_: I'm not sure what problems you're imagining tbh
19:32 _dave_ well I'm not sure of much in this area myself, I could be waaay off base
19:34 _dave_ I'm essentially trying to manage shared memory and locking between multiple processes
19:34 _dave_ I don't have a choice about the shared memory atm sadly
19:35 _dave_ so I'm trying to lock accesses on the shared memory and I'd like to wake up when the lock is released and run a callback
19:35 _dave_ in the middle of a mojo app
19:36 _dave_ I'm beginning to see exactly why sri there used Mojo::Pg for his simple chat application :/
19:36 _dave_ or example
19:36 sri :)
19:36 _dave_ sri, you didn't put a "yield" method in your framework for a reason right?
19:37 sri yield?
19:37 purl well, yield is low on thread solution or a cooporative multitasking term.
19:37 _dave_ while (something is not ready) { Mojo::IOLoop->yield(); }
19:37 mst _dave_: uh, that's -exactly- the 'blocking' that $future->await does!
19:37 sri that requires threads or coroutines
19:37 _dave_ is it?
19:37 purl it's it!
19:38 sri mst: not really
19:38 mst although obviously that ends up being re-entrant which can be dangerous
19:38 sri $future->await does absolutely nothing if you call it inside a running event loop
19:38 thowe Myabe this is just a bug in the Config plugin
19:39 sri if Future->await is supposed to be re-entrant it is totally broken by design
19:39 mst er, no, it's an option, which may turn out to be a footgun, but in some circumstances works fine
19:39 _dave_ a "footgun" LOL
19:39 mst Object::Remote does re-entrant awaiting and it works
19:39 sri oh shit
19:40 mst it's not something you always want to do, and it's best to avoid it where possible
19:40 sri i just don't see how it could ever be a good idea, unless you're watching like no events at all
19:40 mst sri: ok, so, Object::Remote's on-demand loading -requires- it
19:41 mst since I can't turn CORE::GLOBAL::require into a callback
19:41 mst if you had a busy event loop it could go horrible wrong very easily, sure
19:41 mst but in O::R you're usually only watching a handful of events internally anyway
19:41 mst so in -practice- it works fine, and it makes the interface for users much easier
19:41 mst in that they can ignore the async under the hood when they're doing simple stuff
19:42 sri normally you'd use something like Coro there
19:42 mst I've just been fired over the wire fatpacked, I can't do that
19:43 sri is leonerd making progress with his async/await stuff?
19:44 thowe Perhaps this will be clearer: https://gist.github.com/thowe/e99ab7679af869b3cbea
19:44 mst sri: I think so
19:44 thowe and ultimately what I want, but fails similarly: https://gist.github.com/thowe/d567aad0fe51a50175dc
19:45 sri _dave_: this might be what you expected with "yield" https://gist.github.com/kraih/6082061
19:45 sri hehe, 2013.... good times... i wasn't bitter yet about mongodb being shit
19:46 _dave_ I can't use postgres yet until I solve the upsert problem for myself
19:46 _dave_ sadly
19:46 sri release postgres 9.5 already!
19:46 _dave_ Mango still works right?
19:46 * sri shrugs
19:47 _dave_ I so do not know enough coro to grok what's going on here
19:47 _dave_ never used coro
19:47 _dave_ read about it
19:47 sri guess i would update that gist for Mojo::Pg if Coro worked with perl 5.22 -.-
19:47 _dave_ I could punt and write all the shared memory to postgres every access ;)
19:48 _dave_ just "drop table" each time
19:48 sri oh, just noticed the gist uses something i've only declared a feature like 2 weeks ago :o
19:48 _dave_ I like sledgehammers too ;)
19:49 _dave_ really? a recurring timer at 0?
19:49 mattastrophe joined #mojo
19:49 _dave_ so that executes as often as it can? O.o
19:52 thowe I'm not sure if this would be a bug in the Config plugin or in Helpers...
19:53 mst thowe: Dumper($self->app)
19:53 mst thowe: I'm wondering if you've ended up with the default value for that which is a plain application rather than yours, so everything's there but empty
19:54 thowe why would config exist but not have read the config file?
19:54 mst oh. sorry. that attribute isn't part of the default app, is it
19:55 thowe no, see my comment at the bottom of the first Gist, I set it up in startup
19:56 mst I'd add warn statements to the config loading code
19:57 thowe what would they warn about?
19:59 mst uh, I'd start off with 'warn "Got here";' sprinkled about to see which bits of the code are even running
19:59 mst then having established the config file loading code was running, I'd then start warning paths etc. to see what was going on
20:01 thowe does "config" collide with another method name?
20:02 mst I don't know, how about you debug it and find out? :)
20:02 mst Dumper($class->can('config')) :)
20:03 thowe ha...  I appear to have fixed my issues by renaming the helper to "myconfig"
20:04 thowe ->config must have been colliding with the plugin name(?)
20:08 bin_005 joined #mojo
20:08 * thowe is a silly goose
20:09 mst oh for fsck's sake
20:09 mst sri: you have an AUTOLOAD but no can :(
20:14 sri mst: oh for fsck's sake, that is intentional
20:14 mst sri: why?
20:14 sri food now
20:52 plicease joined #mojo
21:12 jberger plicease? on #mojo?! welcome sir
21:16 mattastrophe joined #mojo
21:22 sri so, we don't want helpers included in ->can() because the router uses it to find actions
21:24 thowe pleh...  Installing Moose failed.  This isn't going to be a very productive day.
21:30 sri http://www.funnyonlinepictures.com/wp-content/uploads/2013/05/amoosing.png
21:31 thowe heh
21:35 thowe the DBIC Schema loader apparently has new features since the last time I ran it...  It auto-created things I was creating manually...
21:37 thowe it auto-created a many-to-many for me.  I wonder what version that started in.  I may need to specify a version requirement now(?)
22:21 Flying_Squirrel joined #mojo
22:27 _dave_ thanks bpmedley! This works as a "yield": https://bitbucket.org/snippets/bpmedley/ekdLe
22:27 mishanti1 thowe: I see you're having dependency-issues. Just wanted to say I'm _super_ happy about http://stratopan.com . Currently it is in a free beta.
22:27 mishanti1 thowe: Also, the guy running has provided excellent support.
22:27 bpmedley You're welcome.  I hope it uses the delay and friends correctly.
22:41 thowe I don't know that I'm having dependency issues.  Moose failed some tests.
22:41 thowe and apparently I'm doing things Moo doesn't support
22:43 thowe I just forced it...
23:56 pink_mist http://i.imgur.com/6r5Vfvo.jpg just came across this 0_o

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