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

IRC log for #mojo, 2016-07-15

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

All times shown according to UTC.

Time Nick Message
00:06 jberger I don't remember you changing it
00:06 jberger if it was weeks ago it might have been while we were travelling
00:07 jberger I like code names
00:08 sri it's Thinking Face now
00:08 sri 🤔
00:08 jberger I'm not so sure about Thinking Face, Nerd Face felt like it was us programmers a little bit
00:08 jberger but I think longer names are funnier actually
00:09 jberger LEAF FLUTTERING IN WIND
00:09 sri didn't like that Nerd Face could be mistaken as offensive
00:09 jberger (which we've already had, I know)
00:09 jberger oh I can see that
00:11 jberger TEACUP WITHOUT HANDLE
00:11 jberger CAROUSEL HORSE
00:13 jberger PIG NOSE
00:13 Vitrifur joined #mojo
00:13 jberger MOBILE PHONE WITH RIGHTWARDS ARROW AT LEFT (!)
00:14 jberger SLEUTH OR SPY
00:14 jberger there are so many good ones
00:14 jberger but like I said, since you are reading them I think the longer the funnier (personally)
00:14 jberger http://unicode-table.com/en/blocks/miscellaneous-symbols-and-pictographs/
00:16 jberger TELEPHONE ON TOP OF MODEM
00:16 jberger seriously, that's awesome
00:51 sri Snowman Without Snow
00:52 sri Banana
00:52 sri Cookie
00:53 sri Doughnut
00:54 good_news_everyon joined #mojo
00:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vK0Qr
00:54 good_news_everyon mojo/master 8e374ee Sebastian Riedel: change code name
00:54 good_news_everyon left #mojo
00:55 jberger does doughnut feel too close to android release names?
00:55 jberger I mean, I like it other than that if you don't care about that
00:55 sri 🍩
00:55 sri don't care
00:56 sri nom nom
01:01 jberger omnomnomnom
01:09 nicomen jberger: telephone on top of modem is that like the old TV series VR-5?
01:11 nicomen *VR.5
01:43 kid51 joined #mojo
01:55 genio sri: understandable.  I'll end up just writing what I need in JS
02:33 Kundun joined #mojo
02:45 noganex joined #mojo
03:23 prajith joined #mojo
03:35 che-quest joined #mojo
04:44 prajith joined #mojo
04:45 ivi joined #mojo
05:22 anton joined #mojo
06:00 jberger genio: you could write it
06:01 jberger How bad is the wire protocol (if some hasn't already implemented it generically on cpan)
06:38 Jonis morning jberger >(
06:38 Jonis :)
06:52 AndrewIsh joined #mojo
06:54 jberger Morning? It's only 9pm!
06:54 jberger Jonis: o/
06:56 Jonis 9AM :)
06:56 Jonis Upgrading from Mojo 3.97 to 6.66 atm
06:56 Jonis and from perl 5.14 to 5.24
06:56 Jonis let's just say it's a little bit hairy
07:09 cuechan joined #mojo
07:22 jberger Well that's quite a jump
07:23 trone joined #mojo
07:28 dod joined #mojo
07:38 Jonis jberger: yep :)
07:49 jamesaxl joined #mojo
07:53 prajith joined #mojo
08:07 dod joined #mojo
08:10 dod joined #mojo
08:26 mishanti1 jberger: It's been a long time coming (the upgrade Jonis mentioned). Had to get all the code under test before we could even think about upgrading.
08:27 Vandal joined #mojo
08:28 nic Expect some nice performance gains
08:28 mishanti1 That is something we are looking forward to.
08:36 bd joined #mojo
09:15 mishanti1 I have 6.66 failing tests when trying to install with cpanm on 5.24.0. Output here: http://pastebin.com/znQyA2Qk . Eny idea how I might debug?
09:15 nic mishanti1: Add "--look" to your cpanm cmd
09:16 nic then run failing tests individually as "perl t/something.t"
09:16 mishanti1 nic: Thanks. Will test.
09:17 * jberger guesses directory permission issues with a temporary file
09:17 jberger Blind guess
09:17 bc547_ joined #mojo
09:17 nic good guess
09:19 nic jberger: What are you doing awake?  Are you having a late night?
09:19 nic sorry, didn't mean to sound intrusive
09:19 nic I meant....   you're not usually around during my morning
09:20 mishanti1 Ok, so the --look was a very neat thing. Didn't know about that. However, running the test in question `perl -Ilib t/mojo/log.t` give the same output as in the paste, without any further clues.
09:20 jberger I'm in Hawaii
09:20 jberger It is only 11:20pm here
09:20 jberger Just about to go to bed
09:20 nic \o/
09:21 jberger My current location doesn't have as good of WiFi throughput so my pics are a little behind
09:21 nic NO
09:21 jberger But here's the ever growing set
09:21 nic do not want pics of anyone's behind, little or otherwise
09:22 jberger Hahaha
09:22 jberger No behinds, i promise
09:22 jberger https://goo.gl/photos/TB6kPPkSEBR6cq3g9
09:22 nic mishanti1: as jberger said, first thing to do with that test is check the perms on your system tmp dir (and any dirs above it)
09:24 jberger I will say i have felt a little more out of the loop than usual being so far off European time
09:24 mishanti1 nic: On linux. Assuming mojo uses /tmp, to which the user (mine) running the tests can write to just fine.
09:24 jberger Chicago isn't so bad and you all seem to stay up later than i do
09:25 jberger Hawaii is another 5 hours later
09:28 nic jberger: Those are great pics
09:28 ribasushi jberger: booking is hiring fwiw ;)
09:28 nic What wildlife did you encounter in the caves?
09:29 nic (they look similar to ones Attenborough filmed in)
09:30 jberger None, they really aren't that big
09:30 nic heh, that's what you _thought_   :)
09:30 prajith jberger: Nice pics :)
09:30 jberger They are former lava tubes
09:30 jberger Which is cool to think about
09:30 ribasushi great pics indeed
09:31 nic ah, so there might be lots of caves with shape similar to those I guess
09:31 nic the ones he visited were heaving with the strangest bugs
09:31 nic and non-aquatic crabs if I remember correctly
09:32 jberger Two of the three caves had water at the bottom, they probably have interesting life in there
09:32 nic mishanti1: I'd take the first subtest that's breaking and reproduce what it's doing on the commandline
09:32 jberger But i sure want going to find it
09:32 jberger Wasnt
09:32 nic wise
09:33 nic would be colder than cold
09:33 jberger I've also been hacking fun trying to take surround pictures
09:34 jberger I'm hoping i can load them into the gearvr when i get home
09:34 nic I'm impressed how well those are turning out
09:34 jberger Yeah you can see some flaws but overall pretty good
09:35 jberger Hawaii really is paradise on earth, i highly recommend it to everyone
09:36 jberger We did maui a couple years ago and now this grand trip to kauai
09:39 prajith <jberger> plan your next vacation to Kerala, if possible :)
09:41 jberger prajith: you never know
09:46 prajith <jberger> that's not a pbm
09:47 Jonis jberger: hawaii looks gorgeous
09:49 jberger It really is but it is finally getting late, nn o/
09:51 Jonis nn:)
09:59 mishanti1 nic: So the when the test runs it tries to write one error, one fatal and one debug message to the loggfile on that order. The weird thing is that only the one with fatal-level set is written to the file.
10:00 mishanti1 s/on /in /
10:05 mishanti1 ...never mind. I'll go stand in a corner.
10:11 Jonis now I'm curious
10:28 Jonis postfix deref <3 <3
10:32 genio joined #mojo
10:37 kaare joined #mojo
10:55 vicash joined #mojo
10:58 tchaves joined #mojo
11:04 tchaves joined #mojo
11:05 tchaves joined #mojo
11:13 mishanti1 $MOJO_LOG_LEVEL was set to 'fatal' in my $ENV. It was there from some totally unrelated experiements i did yesterday.
11:24 Jonis hmm
11:24 Jonis json_is('/foo', 1), and then the test fails with got $got = 1, $expected = '1'
11:29 Jonis never fails for 0, and never fails for json_is('/foo/bar', 1)
11:32 kid51 joined #mojo
11:32 nic sorry, mishanti1, I should have suggested to check env vars
11:32 * nic goes to stand in the other corner
11:33 Jonis aha, it's a boolean
11:33 * Jonis fixed it
11:33 nic I know what would be useful, a test file added to Mojolicious that fails if any env vars are set that could impact tests
11:35 nic perhaps more useful (and practical) is just to have the first test in t/mojo/log.t bomb out if MOJO_LOG_LEVEL is set
11:37 itaipu joined #mojo
11:49 mishanti1 nic: I appreciate you trying to help anyway. Checking my $ENV was really one of the first things I should have done. And yes, adding what you suggest to the tests would probably be useful.
11:49 nic (preparing a pr as we speak)
11:51 ribasushi nic: better would be to make sure no test fails with rogue envvars in place
11:51 ribasushi my CI does this: https://github.com/dbsrgits/dbix-class/blob/master/maint/travis-ci_scripts/20_install.bash#L108-L168
11:52 ribasushi and this is what I use locally when I don't want to wait for travis: `maint/poisonsmoke.bash <list of tests if I don't want all>`  (  https://github.com/dbsrgits/dbix-class/blob/master/maint/poisonsmoke.bash  )
11:53 nic I appreciate the idea, just not seeing how it applies here
11:54 ribasushi you change tests that are envvar sensitive to something like: https://github.com/dbsrgits/dbix-class/blob/master/t/storage/dbi_env.t#L11
11:55 ribasushi nic: the earlier stuff helps you never miss a var in the future
11:55 nic I guess the file t/mojo/log.t could set $ENV(MOJO_LOG_LEVE) = undef at the start?
11:55 nic (probably with fewer typos)
11:56 nic ah, just seen that last one, yes, we're talking the same thing, and 'delete' is better
11:57 ribasushi it is a bit of work upfront, but once in place you never think about it again
12:02 nic Or... the pr is rejected and I never think about it again :D
12:26 nic http://github.com/kraih/mojo/pull/981
12:31 punter joined #mojo
12:31 dod joined #mojo
12:43 dvinciguerra_ joined #mojo
12:58 neilhwatson joined #mojo
13:16 gizmomathboy joined #mojo
13:37 sri that topic has been discussed a few times
13:38 sri we'll definitely not start treating one env var special
13:39 Adurah joined #mojo
13:45 mcsnolte joined #mojo
14:32 ptolemarch joined #mojo
14:44 kid51 joined #mojo
15:03 esh joined #mojo
15:10 trone joined #mojo
15:18 PryMar56 joined #mojo
15:20 zivester joined #mojo
15:37 lluad joined #mojo
15:40 sri oh, a new spooky scifi show from netflix has just been released
15:54 dvinciguerra_ joined #mojo
16:04 jnbek joined #mojo
16:07 cuechan joined #mojo
16:12 trone joined #mojo
16:18 dvinciguerra__ joined #mojo
16:28 ningu joined #mojo
16:32 dvinciguerra__ joined #mojo
16:32 disputin joined #mojo
16:34 ningu so I noticed that $c->write() in Mojolicious does not respect the charset but just sends bytes. is this by design?
16:36 Grinnz_ there's no charset for it to respect there. charset is managed by the renderer
16:37 ningu ok
16:37 waveform joined #mojo
16:38 ningu that makes sense but might be good to make that clear in the documentation
16:40 waveform Noob question: Am I correct in thinking that in order to make a blocking app non-blocking, all you need to do is wrap blocking calls with $c->delay(sub { ... }) ?
16:40 waveform Like this: http://pastebin.com/raw/vyVxYqJf
16:40 Grinnz_ https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/FAQ.pod#Will-my-code-magically-become-non-blocking-with-Mojolicious
16:41 Grinnz_ you gotta consider how they're blocking. if it's doing something that blocks for a while, putting it in a delay just changes when that happens
16:41 Grinnz_ if you can change it to use a non-blocking API on the other hand, like Mojo::UserAgent has for example, then you can let the event loop do the waiting instead of blocking
16:42 Grinnz_ otherwise, you can use Mojo::IOLoop::ForkCall or similar to fork off a process and do the blocking code there
16:43 waveform Is there any benefit to re-designing all my actions, like in the pastebin link ?
16:43 Grinnz_ not particularly
16:43 waveform do_blocking_stuff() generally means "update db"
16:44 waveform ok
16:44 Grinnz_ what kind of db?
16:44 waveform postgres
16:44 Grinnz_ if you use Mojo::Pg, it has a non-blocking API
16:44 Grinnz_ you can use that with delays and get possible benefits
16:45 waveform that's only because you pass $delay->begin as a callback
16:45 Grinnz_ right, but while it's waiting for the query to execute, the event loop is running so it can do other things
16:45 Grinnz_ then your next delay step resumes the action
16:46 waveform ok. so in my pastebin example, there is one tiny benefit... it lets other clients connect while do_blocking_stuff() is executing ?
16:47 waveform even if those new clients still have to await their turn in the event loop
16:47 Grinnz_ sure, but that'
16:47 Grinnz_ that's probably not really going to be beneficial in the large scheme
16:48 Grinnz_ er actually i misread, no it does not allow that
16:52 Grinnz_ here's an example how you would use the non-blocking Mojo::Pg api https://paste.fedoraproject.org/391535/60145014/
16:53 dvinciguerra__ joined #mojo
16:55 Grinnz_ bit of a conflation of $c and $self in those examples but you get the idea
16:56 Grinnz_ basically exactly how i did it in this project https://github.com/Grinnz/cah-cards/blob/master/cah_cards.pl#L60-L66
16:57 waveform ok, thanks. i assume it's not possible to wrap do_blocking_stuff() in a delay. do_blocking_stuff() itself would need to support non-blocking behaviour.
16:57 dvinciguerra_ joined #mojo
16:57 Grinnz_ correct, but as mentioned, ForkCall can work around that by doing the blocking stuff in a fork, and giving you a non-blocking API to the results
16:58 waveform the idea of forking worries me because it opens up the possibility of dos attacks
16:59 waveform i need to upload images to the cloud, for example
17:00 waveform i'll try and develop a non-blocking API with Mojo::UA
17:01 Grinnz_ yeah Mojo::UA can easily be used for that
17:07 punter joined #mojo
17:17 cuechan_ joined #mojo
17:21 trone joined #mojo
17:34 dvinciguerra_ joined #mojo
17:35 sri so hard to find a job that would let me stay in northern germany
17:45 ningu sri: where are you now?
17:46 sri in the bremen/hamburg/hannover triangle
17:46 ningu I was in Leipzig when I started with Catalyst and DBIx::Class
17:46 ningu but back in the US now
17:48 sri feels like the perl job market in germany has collapsed
17:49 ningu I am not sure it's much better in the US
17:49 ningu no one seems to like perl
17:49 sri been joking about taking a rails job... but...
17:49 ningu I haven't looked for a perl-focused job though
17:50 ningu mojo is very good, I haven't done benchmarks but I assume it must perform well enough under scale? is there stuff on the site bragging about that?
17:51 kes joined #mojo
17:51 sri odd times, now london jobs are out of the question too
17:51 dod joined #mojo
17:52 jberger I still think having native http/2 in mojo would drive adoption and thus more positions
17:52 preaction long-term, sure
17:52 sri yea, long term
17:52 pink_mist jberger: I'm pretty sure you're very welcome to implement it :P
17:53 ningu is it even on people's radars? I mean if they care about perl they will have heard of mojo but otherwise...?
17:53 sri short term i'd be happy not having to retire from the project at the end of the year ;p
17:54 jberger pink_mist: we cleaned up the internals with the intention of working on it
17:54 jberger I'm sure we are the closest perl framework
17:54 jberger Not horseshoes though, close doesn't count
17:55 ningu yeah
17:55 sri http/2 support is mostly just grunt work now
17:55 ningu grunt? are people still using that nonsense? :P
17:56 sri last open design problem is stream multiplexing in Mojo::Server::Daemon
17:56 sri but i think that might just fall into place once the protocol is implemented
17:59 jberger I still think you could apply to a TPF grant to implement it if you have a consulting lull
18:00 jberger Otherwise we just carve out time where possible to plug it out
18:01 sri think tpf grants are too small
18:05 sri (not that i'm available, i will definitely not do it)
18:10 jberger I thought they opened up the limitations on grant size at some point
18:10 jberger But yeah if you don't have time that's a different thing
18:10 jberger I don't either atm
18:11 sri even when i had time, it was like a 3 month project
18:11 jberger I figure it didn't hurt to ask
18:11 jberger But who knows
18:12 sri looks like there's a $10k limit now
18:12 sri wouldn't have been enough enyway
18:12 jberger Anyway this horrific job queue project at $work is finally almost done so maybe i can get a Lyle more time
18:12 jberger Little
18:13 jberger At this point I'd even take a Lyle more time ;p
18:21 jamesaxl joined #mojo
18:30 jberger I also suspect that even if i can't bring you on that if you just posted that you were looking for fte+remote that you would get interest from someone
18:47 ningu joined #mojo
19:05 itaipu joined #mojo
19:24 kid51 joined #mojo
19:26 marty joined #mojo
19:27 dod joined #mojo
19:44 marty joined #mojo
19:44 marty_ joined #mojo
19:49 marty joined #mojo
20:12 kid51 joined #mojo
21:08 CHYC joined #mojo
21:43 ningu joined #mojo
21:52 ningu can someone ELI5 the heartbeats in Mojo::Server::Prefork?
21:53 ningu how exactly are they accomplished?
21:53 jberger The manager process needs to know that the worker process is still alive
21:53 ningu right, but what counts as "alive"?
21:53 jberger Responsive, able to send a message
21:53 ningu what if it is serving a long-running request that is blocking?
21:53 jberger Then it isn't responsive
21:53 Grinnz_ then it could get killed off
21:53 ningu ok
21:54 jberger You can either turn up the timeout time or (better) figure out how to not block for that long
21:54 ningu not blocking for that long is going to be difficult at present
21:54 ningu I would like to fix it in the future
21:55 Grinnz_ https://metacpan.org/pod/Mojolicious::Plugin::ForkCall simplest way, but caveats for forked processes apply
21:55 ningu huh
21:55 ningu ok
21:56 jberger ningu: how long are you taking about
21:56 ningu it varies. it could be a few seconds, it could be a few minutes
21:57 Grinnz_ a few minutes for a browser request will often result in the browser giving up
21:57 ningu I know
21:57 ningu that is one of several reasons it needs to be fixed
21:57 ningu but for now it needs to at least work minimally
21:57 ningu I will tweak the timeout until I can fix it a better way
21:57 Grinnz_ well, if you increase inactivity timeout significantly and use fork_call it should work
21:57 jberger Could those be job queue type things? Are you waiting for it to do some long work rather than just building a reply
21:58 ningu jberger: pretty much, problem is there is no distinction in this app right now between things that should be fast and things that could be slow
21:58 ningu also, we often have the same "job" that is sometimes fast and sometimes slow -- for example imagine: collect all facts we have about English, vs. collect all facts we have about a language spoken by 100 people
21:58 ningu it's all "collect facts about the specified language"
22:00 jberger Could you use paging to your advantage?
22:00 ningu not really
22:00 ningu it isn't a long response
22:00 ningu it just takes a long time to calculate it
22:01 Grinnz_ other option: caching it ahead of time on a timer
22:03 ningu yes, I've considered that as well
22:03 ningu but for now it needs to work as expected, until we can fix it
22:17 * jabberwok just extinguished a handful of irritating bugs. it seems my code gets better as it gets smaller; these were the result of not removing enough old code. i figure once i have deleted all the code, I'll have a perfect program?
22:18 jberger Exactly
22:20 Grinnz_ replace all code with "use Some::Thing", put Some::Thing on CPAN and get someone to maintain it for you.
22:21 jabberwok Grinnz_ ftw
22:27 ningu is there any point in declaring that my templates are all format html, handler ep, or will that just work and not be any better/faster if I declare it?
22:27 Grinnz_ declaring how?
22:27 ningu I don't know, the renderer has a default_format/default_handler
22:28 ningu "The default template handler to use for rendering in cases where auto-detection doesn't work, like for inline templates." -- but the auto-detection isn't explained, apparently
22:31 ningu also, is there a notion of template inheritance with ep?
22:31 ningu or do you choose the layout in your code?
22:32 sri there are guides
22:32 sri http://mojolicious.org/perldoc
22:33 ningu yeah, I found it now
22:40 sri omg, the internet is incredible
22:40 sri https://www.facebook.com/live
22:40 sri all those blue dots in turkey are live feeds of the coup
22:42 _dave_ what coup?
22:42 _dave_ I live under a rock :)
22:42 sri turkey military took over, erdogan is on the run
22:43 Adurah Coup d'twat, huh?
22:43 _dave_ lol
22:43 _dave_ I think I will stay under my rock :D
22:44 Grinnz_ as long as that rock's not in turkey, you'll be alright
22:44 _dave_ half a world away
22:44 _dave_ roughly
22:45 _dave_ I already got burned coming out of my rock and learning webpack/babel/react
22:45 jzawodn joined #mojo
22:45 Grinnz_ hey those are all things our frontend guys are using and i'm paying no attention to!
22:46 _dave_ node ;)
22:46 _dave_ it's such a mess
22:46 _dave_ Grinnz_ you have good sense not to pay attention to it
23:00 jamesaxl_ joined #mojo
23:17 jamesaxl__ joined #mojo
23:23 jamesaxl_ joined #mojo
23:29 jamesaxl__ joined #mojo
23:56 stryx`_ joined #mojo

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