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

IRC log for #mojo, 2015-10-08

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

All times shown according to UTC.

Time Nick Message
00:02 bpmedley I don't understand.  We're seeing rapid development in p5 now, have a Modern Perl influence, and have the plumbing to create a very elegant backend.  The main issue as I see is it is the echo chamber.
00:03 bpmedley I showed some Mojo code to my ruby friend at work, and his jaw basically dropped.  He said he never thought he would actually say that he had seen elegant perl.
00:07 sri personally, the whole perl6 situation makes me feel uncomfortable
00:07 sri i wish we had more flashy new features in perl5 to highlight
00:08 sri which is why the signatures delay hit me kinda hard
00:08 sri was really looking forward to showing it off in the docs
00:14 sri so, at least until 2017 we'll have nothing cool from the core language to show off
00:14 bpmedley Hrmm, I'll have to ponder an answer.
00:16 pink_mist the coolest feature that entered lately that isn't experimental is imo the k/v hash slice syntax
00:17 sri not really something to show off ;p
00:18 pink_mist true ^^;
00:22 sri really sad nobody made a signatures polyfill
00:22 sri i suppose it's not going to happen anymore
00:23 pink_mist polyfill?
00:25 sri https://metacpan.org/pod/signatures
00:26 sri that was supposed to be updated to be compatible with core signatures
00:26 sri so we could use that on older perls
00:26 pink_mist ahh
00:27 sri like a year ago we were planning on using it as soon as it got updated
00:27 sri but that never happened
00:30 pink_mist :( that would have been nice though, agreed
00:31 murre joined #mojo
00:34 odc joined #mojo
00:36 sri i guess there's still a tiny chance if someone steps up to finally do it
00:36 sri but i'm not holding my breath :/
00:39 sri also doesn't help that signatures is full of bugs like https://rt.cpan.org/Public/Bug/Display.html?id=80450
00:44 thowe joined #mojo
00:54 howitdo joined #mojo
00:56 howitdo joined #mojo
01:00 aborazmeh joined #mojo
01:04 howitdo joined #mojo
01:08 howitdo joined #mojo
01:26 meredith Function::Parameters does pretty decently against the core perl op/signatures.t suite if you import it with { sub => 'function_strict' }
01:26 Zoffix sri, what P5 has to "show off" doesn't need to be "new". I've barely started learning P6, but already I notice the large amount of P5's freedom is gone.
01:26 Zoffix And signatures... I never cared about them.
01:27 Zoffix Which is how I feel P5 should position itself. The "manual" vs, "automatic" compared to P6.
01:27 * Zoffix may be too wasted to argue on the topic coherently and thus turns on Red Letter Media on YouTube and waits for their pizza to be ready.
01:29 Grinnz Function::Parameters is, coincidentally (perhaps not), written by the reporter of that bug :P
01:31 * tempire swifts
01:32 meredith F::P seems to be the only thing left without a deprecation notice or a warning about design problems, in that niche
01:33 * tempire swifts every day
01:34 Grinnz you're Pikachu?
01:34 sri meredith: interesting, i always disregarded it because it uses fun/method by default i guess
01:34 Grinnz Pikachu doesn't learn Swift anymore in recent gens, madness
01:35 sri F::P requires perl 5.14, but that's not too bad
01:35 Grinnz that was Red/Blue only i guess
01:35 Grinnz yea F::P is nice
01:35 meredith yeah i was surprised having it replace 'sub' worked, but tried it on a whim when i had basically the same thing in mind -- polyfilling
01:36 kaare joined #mojo
01:36 lluad I have this horrible image of Pikachu learning Objective-C, now.
01:36 sri perl -Mojo -E 'use Function::Parameters {sub => "function_strict"}; a(sub ($c) { $c->render(text => "works!") })->start' get /
01:36 sri yea, pretty nice
01:37 sri perhaps there's a candidate for a polyfill after all
01:38 jberger I made a Kavorka plugin
01:38 jberger Kinda fun
01:38 gaunt joined #mojo
01:38 jberger Kavorka isn't deprecated either (is it?)
01:39 Grinnz just says "early stage of development" still
01:39 meredith compared to p5 signatures, i know F::P doesn't handle ($foo,,$bar), but according to the core test it doesn't do what i'd expect at a glance so i'd never use it
01:40 Grinnz that looks like it should be either a syntax error or the extra comma ignored
01:40 meredith re: kavorka i think it still has a note about maybe switching its keyword library, and the current one may have a warning about design issues if you click through to it.
01:41 meredith also from what i hear toby is busy with writing and a little one lately :)
01:42 meredith yeah the test suggests multiple commas are ignored. some could think it's "discard this argument position" at a glance
01:45 Grinnz yeah, but that doesn't really make sense in the way that signatures are used
01:45 meredith F::P dies at compile time on it
01:45 Grinnz particularly since there's already a syntax for discarding an argument
01:45 Grinnz don't remember if F::P shares that syntax though
01:45 Grinnz "Instead of a full variable name (such as $foo or @bar) you can write just the sigil ($, @, or %)." yep
01:45 Grinnz (that's unfortunately a big reason why prototypes and signatures are ambiguous, but it is what it is)
02:01 zivester joined #mojo
02:11 sri lol https://github.com/hmlb/phpunit-vw
02:17 saki heh
02:18 Grinnz that reminds me of something
02:25 Grinnz it was a javascript thing, but I can't find it now
02:25 Grinnz something like "try to run and ignore all errors"
02:26 noganex_ joined #mojo
03:00 noganex_ joined #mojo
03:00 thowe joined #mojo
03:00 Kogurr joined #mojo
03:00 Onigiri joined #mojo
03:00 y1mmm joined #mojo
03:00 cosimo joined #mojo
03:00 da5id joined #mojo
03:00 tyldum joined #mojo
03:00 jwang joined #mojo
03:00 Dandre1 joined #mojo
03:00 ans joined #mojo
03:00 mgrimes joined #mojo
03:00 fvox joined #mojo
03:00 bayashi_ joined #mojo
03:00 bpmedley joined #mojo
03:00 sri joined #mojo
03:00 cfedde joined #mojo
03:00 jberger joined #mojo
03:00 SmokeMachine joined #mojo
03:00 dabudabu joined #mojo
03:00 buu joined #mojo
03:00 batman joined #mojo
03:00 dotan joined #mojo
03:00 kmx joined #mojo
03:00 Foxcool joined #mojo
03:00 Ralesk joined #mojo
03:00 coolo joined #mojo
03:00 bobkare joined #mojo
03:00 ssm joined #mojo
03:00 hahainternet joined #mojo
03:00 kwa joined #mojo
03:00 robinsmidsrod joined #mojo
03:09 bc547 joined #mojo
03:11 jberger Grinnz: https://github.com/mattdiamond/fuckitjs
03:18 Grinnz YES
03:18 Grinnz jberger++
03:25 davido_ joined #mojo
03:29 Snelius Zoffix: ok, thx for info
03:41 jberger Cubs win!
03:43 cpan_mojo Mojo-Webqq-1.5.4 by SJDY https://metacpan.org/release/SJDY/Mojo-Webqq-1.5.4
03:46 aborazmeh joined #mojo
04:17 genio jberger: bwahahaha, I love the "obligatory coffee script version"
04:50 kaare joined #mojo
05:02 panshin joined #mojo
05:29 inokenty-w joined #mojo
05:50 davido_ joined #mojo
05:56 panshin joined #mojo
06:07 panshin joined #mojo
06:20 marcus what is smartqq?
06:20 marcus wish I could read japanese :-/
06:21 marcus urgently in need of babelfish for eyes
06:39 stokachu joined #mojo
06:41 marcusr joined #mojo
06:43 marcusr joined #mojo
07:00 arthas joined #mojo
07:03 dod joined #mojo
07:04 mattastrophe joined #mojo
07:11 eseyman joined #mojo
07:15 AndrewIsh joined #mojo
07:35 stephen joined #mojo
07:35 trone joined #mojo
07:58 Vandal joined #mojo
08:01 meshl joined #mojo
08:08 meshl joined #mojo
08:09 Dandre1 left #mojo
08:11 mattastrophe1 joined #mojo
08:13 nic "are you tired of running from conflict?"
08:14 nic jberger++
08:14 berov joined #mojo
08:14 berov joined #mojo
08:56 Shaeto joined #mojo
09:32 gaunt_ joined #mojo
09:49 vytas joined #mojo
09:58 panshin_ joined #mojo
10:09 jontaylor joined #mojo
11:08 vanHoesel joined #mojo
11:09 sugar joined #mojo
11:27 marcus I'm only running from jberger.
11:29 * nic points to the trapdoor where everyone else is hiding
11:29 * CandyAngel covers nic's mouth
11:29 CandyAngel Shhhhh
11:30 marcusr but the trapdoor is where we keep the alligators...
11:33 jberger marcus: yeah sorry, my blood got up yesterday, I'm ok today
11:42 neilhwatson joined #mojo
11:42 marcus jberger: can't hear you, still running.
11:42 marcus jk. :)
11:42 marcus I agree about the perl6 name change tho, but there's nothing we can do so I don't really bother.
11:45 nic If you're in perl6 you might see perl5 as having the more uncertain future, so it doesn't make sense to leave them (perl5) with the name 'perl'
11:46 nic and we are perl5 and we should be able to change the name, but has anyone thought of one that has potential to gain consensus?
11:46 nic mst created a channel for discussions, but I didn't see anything come of it
11:47 Dandre joined #mojo
12:11 sri perl6 talk depresses me, can we talk about nice stuff instead for a bit?
12:11 ribasushi yes, let's talk about sub-signatures \o/
12:11 sri :(
12:12 * ribasushi shuts up ;)
12:12 sri :,(
12:12 sugar joined #mojo
12:17 panshin joined #mojo
12:21 asarch joined #mojo
12:23 pink_mist can't we just fork F::P into Mojo::Signatures and fix it up to how we'd want it? :P
12:24 sri would be nice if F::P had a strict subset of core signatures mode
12:24 sri like "use F::P {sub => "strict_core_function"}" or so
12:25 dabudabu marcus: If there's anything you'd need translated from Japanese, I could do it
12:25 marcus dabudabu: I was just curious about what https://metacpan.org/pod/distribution/Mojo-Webqq/doc/Webqq.pod is.
12:26 pink_mist sri: was it only the ,,, issue that wasn't like in core?
12:26 sri pink_mist: i wouldn't even call it an issue
12:26 sri you just get so much additional stuff that's not in core
12:26 pink_mist ah
12:27 sri if people start using that by accident... it can be problematic
12:28 sri this is how far we got with signatures in mojolicious btw. https://github.com/kraih/mojo/compare/signatures
12:28 sri you could just add F::P as a fallback there
12:28 sri but thinking some more about it... a separate cpan module would be great
12:29 vanHoesel joined #mojo
12:29 sri something that only installs F::P on older versions of perl
12:29 sri and activates core signatures on newer ones
12:29 dabudabu marcus: Sorry, that's Chinese :(
12:29 marcus dabudabu: oh, my bad. sorry
12:30 marcus That's embarassing
12:31 dabudabu Naw, I'd bet most people who don't live in Asia couldn''t distinguish Chinese and Japanese
12:31 * sri can only identify korean, because every sign looks like a stickman :)
12:33 marcus given the amount of ebay packages with chinese letters I've recieved in the last 3 months, I should have been able to
12:33 * marcus is building a quadcopter
12:38 lluad joined #mojo
12:42 sri pink_mist: i think the biggest problem is actually the perl 5.14 requirement
12:42 sri can we make mojolicious depend on perl 5.14?
12:43 pink_mist how long ago was it Mojolicious started depending on 5.10.1?
12:43 sri long before it was cool
12:43 pink_mist can one make a deprecation cycle of this? maybe for 7.0 depend on 5.14?
12:44 sri https://github.com/kraih/mojo/blob/master/Changes#L2707
12:44 pink_mist oh wow that was long ago
12:44 bd sri: FWIW debian oldoldstable has 5.10.1, oldstable 5.14.2
12:45 sri and centos?
12:45 bd i don't know, people don't want to pay my centos rates ;)
12:45 sri (it's always about centos)
12:46 pink_mist http://distrowatch.com/table.php?distribution=centos <-- seems 6.6 is on 5.10.1
12:47 sri so, it's not too bad
12:47 sri worst case, someone makes a legacy fork again
12:48 bd well, 6.6 is EOL  2020-11
12:49 pink_mist it'll stop recieving updates in 2017 though
12:49 sri we're not gonna wait until 2020
12:49 pink_mist err full updates that is
12:49 bd pink_mist: is that on the distrowatch page?
12:49 pink_mist bd: wikipedia :P
12:49 sri remember, this was a thing between 2011 and 2014 https://github.com/jamadam/mojo-legacy
12:49 pink_mist https://en.wikipedia.org/wiki/CentOS#End-of-support_schedule
12:50 bd pink_mist: well running of to wikipedia is just ninja
12:50 sri so, 5.14 requirement is on the table now
12:50 pink_mist haha I take my info where I can :P
12:50 CandyAngel What is the current requirement? 5.10?
12:50 sri 5.10.1
12:51 bd why do you want to depend on 5.14?
12:51 pink_mist Function::Parameters depends on 5.14, and it seems the best way to get signatures into Mojo
12:52 pink_mist I'm +1
12:52 bd ah that's f::p
12:54 bd i used Method::Signatures::Simple in the past, but i have no idea if they are similar or not
12:56 CandyAngel I don't think requiring 5.14 is too onerous, with perlbrew being recommended anyway
12:56 CandyAngel That's what.. mid-2011?
12:58 nic Was 5.14 when unicode became reliable?
12:58 pink_mist that should be 5.10.1
13:01 ajr_ joined #mojo
13:07 panshin joined #mojo
13:07 AndrewIsh joined #mojo
13:10 jberger Any good signatures will depend on 5.14 because of the keyword api
13:11 jberger sri why fp and not kavorka?
13:12 * jberger likes tobyink modules
13:14 jberger Oh one of the warnings does look bad
13:14 * pink_mist is a huge fan of mauke's modules, which F::P is
13:15 sri jberger: kavorka is a monster
13:16 sri the one that's closest to core signatures (and reliable) wins imo
13:17 batman what is F::P ?
13:17 pink_mist I poked mauke over on freenode to see how willing he'd be of providing a strict_core_function version, still waiting on a reply =)
13:17 pink_mist Function::Parameters
13:18 * sri wouldn't actually mind a second major releae this year for something like signatures
13:20 batman pink_mist: thanks
13:24 mattastrophe joined #mojo
13:26 Vandal joined #mojo
13:28 CandyAngel Okay. I have a mission for tonight.. code a new version of perl-openhmd
13:28 CandyAngel So it sucks less
13:31 aborazmeh joined #mojo
13:33 hernan605 joined #mojo
13:58 gryphon joined #mojo
14:02 panshin joined #mojo
14:03 berov1 joined #mojo
14:05 sri soooo... F::P does work reasonably well as a polyfill in mojolicious
14:05 sri i have a patch
14:07 bc547_ joined #mojo
14:09 sri one small thing i did stumble over though
14:09 sri "sub app;"
14:09 sri that does not work
14:09 jberger does fp work like a polyfill? ie can it use "sub" as its keyword?
14:09 sri yes
14:11 jberger cool
14:12 jberger oh it is introspectable too
14:12 jberger I thought only Kavorka did that
14:12 * jberger might need to update his plugin
14:13 Grinnz mauke is no slouch
14:14 jberger that is certainly true
14:14 jberger I guess I just hadn't dug very deeply in F::P
14:19 jberger ok so if I add FP to my Mojolicious::Plugin::Kavorka it would clearly need a new name
14:19 Grinnz heh
14:20 jberger so I thought Introspection or Introspective but then I thought that it is possible we would want those for something more official
14:20 jberger so I google for synonyms, and I found it
14:20 jberger Mojolicious::Plugin::NavelGazing
14:20 jberger \o/
14:23 pink_mist lol
14:26 Grinnz Mojolicious::Plugin::SignatureActions (::EddieBauer)
14:26 jberger Grinnz: what fun is that?!
14:27 Grinnz Mojolicious::Plugin::Kirkland
14:27 jberger haha
14:27 jberger how do I copy a git repo on my own (ie not use fork from github)?
14:28 jberger I'll keep Kavorka as a shell plugin which just loads the other
14:28 good_news_everyon joined #mojo
14:28 good_news_everyon [mojo] kraih created polyfill_signatures (+1 new commit): http://git.io/vCTGH
14:28 good_news_everyon mojo/polyfill_signatures 968537b Sebastian Riedel: add basic support for signatures
14:28 good_news_everyon left #mojo
14:28 sri my basic experiments
14:28 sri i've only converted one class so far for testing
14:28 sri Mojo::Message::Request
14:29 jberger why CORE::join?
14:30 sri avoids warnings
14:31 jberger what was the warning?
14:32 jberger precedence?
14:32 sri don't remember
14:32 sri try it
14:34 Vandal joined #mojo
14:37 jberger "ambiguous call resolved as CORE::join() "
14:37 jberger hunh
14:39 jberger oh, because you define functions of that name
14:39 meredith yeah, and with f::p your functions are in scope in their own body
14:41 good_news_everyon joined #mojo
14:41 good_news_everyon [mojo] kraih pushed 1 new commit to polyfill_signatures: http://git.io/vCTlR
14:41 good_news_everyon mojo/polyfill_signatures 6e2b0b8 Sebastian Riedel: use signatures in Mojo::Headers
14:41 good_news_everyon left #mojo
14:41 sri here you get a better feel for the before and after
14:42 jberger certainly is more self-documenting
14:42 sri i'm not sure what's better "sub { shift->foo(@_) }" or "sub ($self, @args)  { $self->foo(@args) }"
14:42 sri second should have a performance penalty, but more self documenting
14:43 jberger in that case I don't mind too much either way, but in the case of $_[N] all over the place
14:45 jberger <°(((><
14:48 sri hmm, with two converted classes there is actually a measurable performance difference
14:48 jberger on F::P or both?
14:49 sri for examples/hello.pl it is 1074rps vs 1133rps
14:49 sri with core signatures and without
14:49 sri (without signatures at all)
14:49 jberger even core signatures adds opcodes
14:49 sri have not benchmarked F::P yet
14:50 jberger might try adding a trailing @
14:50 pink_mist 1133 is the polyfill one I assume?
14:50 sri nope, original
14:50 jberger 1133 is without sigs
14:50 jberger of any kind
14:50 Grinnz sri, you need to set dynamic_config to 1 to dynamically require F::P by the way
14:50 genio That's not a huge change.  but being only two classes out of N done, it will get slower :/
14:51 dod joined #mojo
14:51 pink_mist so it's slower with signatures?
14:52 sri lol, F::P is actually faster
14:52 pink_mist :/
14:52 Grinnz hah
14:52 pink_mist 0_o wat
14:52 sri baseline: 1033rps, core-signatures: 1074rps, F::P: 1128rps
14:53 pink_mist oh, it was 1033 not 1133
14:53 Grinnz 1133*?
14:53 sri oops
14:53 sri baseline: 1133rps, core-signatures: 1074rps, F::P: 1128rps
14:53 pink_mist d'oh
14:53 sri that's it ;p
14:53 jberger I wonder how FP does that?
14:53 hernan605 joined #mojo
14:54 jberger I wonder how the deparses compare
14:54 dod joined #mojo
14:57 sri ok, after a few more runs, baseline stays around 1130, while F::P is usually around 1100, and core signatures about 1050
14:58 jberger and those will go down with more classes converted
14:58 sri so core signatures are really really slow
14:58 sri yes
14:58 jberger lots of arity checks
14:58 sri F::P might be barely noticeable, but core signatures will hurt
14:58 jberger for s-es and g-s, try F::P in lax mode
14:59 jberger thats more apples-to-apples with baseline then
14:59 sri wat?
14:59 sri s-es/g-s?
14:59 jberger shits and giggles
15:01 sri equal to baseline
15:03 jberger yeah
15:05 jberger well, there endeth the experiment?
15:08 Grinnz_ too bad adding F::P as a real dep would mean we can't say "no non-core deps on latest perl" :P
15:09 ribasushi sri: if you want to test the op-based stuff seek http://www.nntp.perl.org/group/perl.perl5.porters/2015/02/msg226044.html
15:09 ribasushi build that branch, re-time
15:09 ribasushi main line in this email is: "see the following numbers of instruction reads under bench.pl:"
15:12 jberger "Note that this commit introduces a hard limit of 32767 parameters for any     signature sub, but I can't conceive of that being an issue."
15:12 jberger ^^ nope, I'm out :-P
15:12 genio heh
15:12 genio That's a lot of parameters
15:12 sri jberger: avoiding arity checks with @) does not help much
15:12 sri ribasushi: oh, i remember that
15:13 jberger sri: there still are the too few arity checks I assume
15:13 CandyAngel Arity?
15:13 jberger number of arguments
15:13 jberger sub ($x, $y) {} has arity two
15:14 CandyAngel Oh
15:14 CandyAngel Interesting, not heard that word before
15:14 ribasushi the arity and other checks are virtually free on the background of entersub itself
15:14 jberger I hadn't before these
15:14 CandyAngel Yay learning!
15:14 ribasushi hence why the custom sub-op is the only real way to get ahead perf-wise
15:15 sri correct me if i'm wrong, but this kind of performance cost makes using signatures in core impossible, doesn't it?
15:15 jberger perl has never been able to have strict arity checking before and it was one of the big arguments when sub signatures were in the works
15:15 jberger sri: I'd say so
15:15 jberger :'(
15:15 sri that means we are back to enabling it for users, but not using it ourselves
15:16 jberger in that case, it could be an optional dep back to 5.14
15:16 sri not using a polyfill at all seems fine too
15:17 sri we only fully support the last two perl releases
15:18 sri the original signatures branch https://github.com/kraih/mojo/compare/signatures
15:19 jberger so here's the thing, I'd almost rather have the polyfill, its not experimental
15:19 pink_mist sri: maybe stick a note somewhere to revisit this once OP_SIGNATURE goes into core? =)
15:19 sri which could be extended with doc updates and a note about signatures in Mojolicious::Guides
15:19 jberger as crazy as that sounds
15:20 sri pink_mist: OP_SIGNATURE is dead
15:20 pink_mist oh it is? =(
15:20 jberger bike shedded to death
15:20 ribasushi pink_mist: that's incorrect
15:20 jberger signatures only exists because of the unbelievable tenacity of Peter Martini
15:21 ribasushi pink_mist: from what I can tell it will likely show up in the Nov release
15:21 jberger ribasushi: :o
15:21 sri ribasushi: :o
15:21 ribasushi pink_mist: nevertheless - fish the branch out and time it please, it might not be worth it *anyway*
15:22 ribasushi jberger, sri: I don't have much to tell you if "very valid concerns were raised, and work continued with altered scope" is interpreted as "bike shedded to death"
15:23 sri is this the branch? https://github.com/Perl/perl5/tree/smoke-me/davem/op_signature3
15:23 jberger if indeed "work continued with altered scope" then I rescind my comment
15:23 sri nothing more recent than 8 months
15:24 ribasushi 8mo sounds about right
15:24 ribasushi but I'd check on #p5p if a different (likely a tad slower) version showed up
15:25 sri anyone got a perlbrew one-liner to install a perl branch?
15:26 jberger I only know for bleaad
15:31 ribasushi there's no oneliner - you need to clone the repo, checkout the correct rev
15:31 ribasushi and then:
15:31 ribasushi install  [options] /path/to/perl/git/checkout/dir
15:35 neilhwatson joined #mojo
15:37 genio sheesh.  that OP_SIGNATURE email thread just wasted a number of minutes of my day
15:38 PryMar56 joined #mojo
15:39 jberger ribasushi: I really can't find anything on signatures that would make me believe a november improvement
15:39 jontaylor joined #mojo
15:43 * sri compiles the OP_SIGNATURE branch"
16:02 sugar joined #mojo
16:11 Lee joined #mojo
16:12 neilhwatson joined #mojo
16:19 Dada joined #mojo
16:22 sh4 joined #mojo
16:31 sri ribasushi: OP_SIGNATURE is slightly faster than baseline it appears
16:31 sri 1157 rps
16:40 disputin joined #mojo
16:43 sri ribasushi: so yea, big improvement
16:50 Kogurr joined #mojo
17:21 panshin joined #mojo
17:43 trone joined #mojo
17:45 panshin joined #mojo
17:49 mattastrophe joined #mojo
17:53 mattastrophe joined #mojo
17:53 Kogurr joined #mojo
18:16 Dada Hi. I'm having trouble to store datas in the session in a under... anyone sees what's wrong with this code? (http://paste.scsys.co.uk/499948 it's short, around 7 lines). Dumper($self->session) shows that next_location is in it, but on my next request, the session will be empty, and I don't get why..
18:19 jberger Dada: you are returning undef and thus breaking the chain
18:19 Dada oh.. so what should I return?
18:19 jberger so that never gets sent to the client
18:20 jberger 1
18:20 jberger anything truthy
18:20 Dada but then my under will be successful while I wanted it to fail..
18:20 sri that should get sent to the client
18:20 sri render + return undef is totally valid
18:21 jberger d'oh my bad
18:21 jberger I shouldn't answer when I'm distracted, sorry
18:22 Dada ahah np, you just confused me for a second! so any other ideas?
18:23 jberger not really
18:23 * jberger is battling with mysql atm
18:24 Dada ok.. I'll keep looking, it must be quite a stupid mistake somewhere
18:24 jberger do any other session keys survive?
18:24 jberger I wonder if you are invalidating the session
18:25 jberger oh, also, recently we have seen someone who's system clock is wrong and so the session is invalid immediately
18:25 jberger check that too
18:25 Dada No, the session is empty before, and after too
18:25 jberger (both client and server)
18:25 jberger check that the cookie exists and has a non-zero size on the client
18:25 neilhwatson joined #mojo
18:25 Dada ok
18:26 Dada ok, I was working on a virtual machine that is like 17 hour late, it might be it..
18:27 Grinnz_ hahaha
18:27 jberger bingo
18:34 Dada it wasn't it. And there is no cookie on the client.. which is odd, because after the user authenticate, I create a cookie, which I see on the client.. I'll run some more tests..
18:36 * sri wonders if "my ($self) = @_;" is a better convention than "my $self = shift;"
18:36 Grinnz_ it is better optimized, i suppose
18:36 Grinnz_ not like that makes much difference...
18:36 sri i don't think that's true
18:37 Grinnz_ which?
18:37 sri that it's less optimized
18:37 jberger I'd expect that list assignment would be more efficient
18:37 Grinnz_ don't know for sure, i just know the first is optimized
18:37 Grinnz_ and the second has to modify @_
18:38 Grinnz_ (optimized in very recent perls only)
18:40 Grinnz_ the only reason i tend to stick with my $self = shift; is to be consistent with all the times when you actually want to modify @_
18:54 ZoffixWork joined #mojo
19:10 disputin joined #mojo
19:12 disputin joined #mojo
19:16 mattastrophe joined #mojo
19:16 mattastrophe joined #mojo
19:18 tempire my $self = shift is prettier
19:19 tempire I like not modifying @_ in theory. But I choose prettier for that.
19:30 genio that ^^
19:39 dave my ($self, ... ) = @_; helps me see what arguments there are to the method
19:40 dave from sri I learned that my ($self, $thing1, ...) = (shift, shift, ...) helps when I want to pass the rest of @_ down to some other method
19:40 CandyAngel Oh wow
19:40 CandyAngel The monkey patch is like.. core to how the Mojo code works
19:40 CandyAngel Wasn't expecting that
19:41 dave the monkey has shocked you ;)
19:42 Dada jberger: just to let you know I solved the problem I had earlier : I stored the data in the session before calling check_connected, and now it's ok. (check_connected was quite horrible, I think something in it was messing).
19:43 sri stop this monkey business
19:44 genio now I have The Monkeys theme song stuck in my head.
19:44 genio err, Monkees
19:45 dave lol ... so many different monkeys
19:45 genio https://www.youtube.com/watch?v=hUzexePjWlI
19:46 sri hmm, just found a job queue that allows jobs to be tagged to make it easier to search them
19:48 sri oh, and i have a use case for searching by queue
19:49 sri you could look up the last 10 finished jobs in a certain queue to collect statistics, like how long jobs have been waiting in the queue, or how long they take to process on average
19:51 sri too bad we have no actual queue list
19:54 jberger http://media.giphy.com/media/5xtDarCctRAAhRmtkaI/giphy.gif
19:55 jberger CandyAngel: I wouldn't say core
19:55 jberger to Mojolicious::Lite certainly
19:56 sri Mojo::Base too ;p
19:56 sri fairly recent change, for 3% overall performance
19:57 jberger oh true
19:57 sri so it's quite literally at the core :)
19:58 disputin joined #mojo
19:58 jberger but I wouldn't call that monkey_patching in anything but name, its just a symbol table injection
19:58 sri yea
19:58 sri still, it's symbol table manipulation at runtime
19:59 sri so the term fits
19:59 jberger true
19:59 jberger I think of TRUE monkey patching as replacing existing symbol table entries, but that does seem like splitting hairs at that point
20:01 Grinnz_ i think true monkey patching requires use of a live monkey
20:03 dave O.o
20:03 genio just live or live and evil?
20:11 CandyAngel Yeah, I am just coding a module and I was like "Hm, I wonder how Mojo does the class creation thing"
20:11 CandyAngel Because I think I should avoid Class::Tiny for something so simple
20:12 sri it's mostly about attribute accessor performance
20:13 sri we are always looking for interesting new ways to make this block faster https://github.com/kraih/mojo/blob/master/lib/Mojo/Base.pm#L40-L60
20:13 disputin joined #mojo
20:19 * btyler_ discovered MooseX::Role::Parameterized recently, and promptly wrote an unholy abomination of symbol table manipulation
20:20 Grinnz_ CandyAngel: not sure what you mean by "avoid Class::Tiny for something so simple", it's generally the simplest way to do such a thing (unlss you're already using Mojo)
20:21 btyler_ it was a great learning moment when someone was talking about it with me and started saying things like "...maybe this should be a class instead of a bunch of dynamically generated methods?" -- reminded me of jberger looking at my Mojo::UserAgent::UnixSocket draft and going "cool, but...why are you monkey patching?!"
20:21 Grinnz_ hehe
20:21 CandyAngel Grinnz_: Just a pretty unneeded dependency
20:22 Grinnz_ it's a lot lighter than having Mojo as a dependency
20:22 CandyAngel I wasn't going to have Mojo, I was just going to copy it :P
20:22 Grinnz_ lol
20:23 Grinnz_ idk, I like light dependencies as much as the next guy, but something like that I don't see the harm in a dependency like Class::Tiny
20:23 CandyAngel One day, these modules will be on CPAN
20:23 CandyAngel And then no-one will use them
20:23 Grinnz_ it's ridiculously small, works on any perl, and has no dependencies
20:23 * CandyAngel cues the violin
20:24 CandyAngel Well, the base module doesn't even have any attributes or anything, it's just avoiding writing sub new {} :P
20:24 Grinnz_ you mean your base module?
20:24 CandyAngel Yeah, the "root" module that you use first
20:25 Grinnz_ in those cases sub new { bless {}, shift } is usually enough
20:25 CandyAngel Oh wait, I do need to keep some values..
20:25 CandyAngel Oops
20:25 CandyAngel :P
20:26 sri it's also nice to avoid all the boilerplate with use strict, warnings, feature, utf8....
20:26 sri isn't it nice how we get no unicode questions anymore?
20:26 Grinnz_ heh
20:27 sri adding use utf8 helped sooooo much
20:27 sri seriously, every other day someone used to ask about mojibake in lite apps
20:29 dave I'm finding myself using Mojo::Base a lot more now, it's replaced Moose/Meece/Moo/More/Mygod and friends
20:29 dave unless I'm using roles, really don't need all the other muck
20:29 CandyAngel And then I need to restructure it to allow different backends
20:30 CandyAngel In case I ever learn XS or something
20:30 sri it's rare that i need roles, mostly i'm fine with delegation
20:30 Grinnz_ roles simplify things sometimes for me, but only done properly
20:31 dave I wrote a role based framework for moose that allows me to scan through millions of objects using only one moose object
20:31 dave couldn't do that without roles
20:31 sri there are some things though where roles make perfect sense, like Test::Mojo::Role
20:32 sri glad jberger formalized that
20:34 dave oh that's how you do that :)
20:35 jberger Test::Mojo::WithRoles is the more cute part
20:36 Grinnz_ Role::Tiny is teh awesome
20:38 * Grinnz_ ponders using Class::Tiny for App::RewriteVersion, because why not
20:38 dave for the grins ;)
20:43 panshin joined #mojo
20:46 jberger Grinnz_: you could use Class::Anonymous
20:46 jberger :-P
20:46 * jberger runs
20:46 Grinnz_ lol
20:46 Grinnz_ that might be slight overkill
20:47 jberger general reminder, Class::Anonymous is insane and should never be used by anyone for any reason
20:47 Grinnz_ hahaha
20:47 jberger that said its fun and you should try it :D
20:48 Grinnz_ https://metacpan.org/requires/distribution/Class-Anonymous?sort=[[2,1]] fill up that list!
20:48 Grinnz_ make jberger have responsibility!
20:49 CandyAngel Grinnz_: Sure!
20:50 CandyAngel jberger: Fixmahcodekthx
20:51 jberger :o
20:52 btyler_ jberger: blessed coderefs! awesome :D
21:04 jberger btyler_: did you see the & prefix?
21:04 jberger so much fun stuff in that module :-P
21:07 cpan_mojo Minion-2.02 by SRI https://metacpan.org/release/SRI/Minion-2.02
21:11 btyler_ jberger: the prototype? yes :D
21:13 jberger not just the prototype
21:13 jberger &class(...)
21:13 jberger I declare a prototype and then later defeat it
21:14 btyler_ oh, hah, no, didn't spot that
21:14 Grinnz_ lol
21:15 btyler_ there was a perl beginner's session at $work last week, and at some point someone asked about &sub. all of the people who were teaching immediately went "nope! nope nope nope nope!"
21:15 btyler_ followed by "where did you see that in the codebase?"
21:16 jberger :-P
21:16 jberger class should only publically be called with a block
21:17 jberger but extends is just a call to class that also establishes the @isa
21:17 btyler_ no objection here, I think it was just to spare opening the can o' worms of prototypes and the "they're not signatures" and "no, please don't use them" and "they always apply at compile time..except..."
21:17 btyler_ for the poor newbs
21:20 jberger right
21:38 meshl joined #mojo
21:47 CandyAngel Huh, that's confusing
21:47 CandyAngel This commit in my local repo is different to the remote one (with the same SHA1)
21:47 CandyAngel the file doesn't have the changes from that branch
21:50 CandyAngel Ah, there we go
21:51 nicomen I don't want to offend anyone, I'm just curious. What are the great benefits of signatures when making a library for others to use? Is there a lot of param validation that wastes LOCs and time, and are error-prone? Are there other significant benefits I am not able to see?
21:51 Grinnz_ the only benefit is your own code clarity and cleanliness
21:51 Grinnz_ and a bit of built in parameter validation
21:51 CandyAngel nicomen: But that's so offensive!
21:52 Grinnz_ lol
21:52 CandyAngel Stop asking completely reasonable questions!
21:52 * CandyAngel is baffled to how anyone could be offended by that question
21:53 nicomen Well, if I ask what's the point with something that has been pushed for alot, I could've sounded negative
21:53 Grinnz_ nicomen: essentially the biggest benefit is making perl look more like a modern language :)
21:55 nicomen btw. about Mojo::Base, for me the only thing it lacks is a attribute type-check, I'm guessing with signatures, one could produce attribute setters with signatures effectively getting type check?
21:56 Grinnz_ thats not really what signatures are for
21:58 nicomen ah, I thought they also allowed to check what was sent in
21:58 Grinnz_ Function::Parameters has an experimental feature to use Moose types, but thats about it
22:00 Grinnz_ also, that would require redefining the attribute setters, which seems rather overcomplicated when you could just use Moo
22:01 nicomen Grinnz_: yeah I have ended up going for Moo, but Mojo::Base is so close ;) Was intrigued when someone mentioned Class::Tiny earlier
22:04 nicomen looks cute
22:04 Grinnz_ you could also do something like, before 'some_attr' => sub { Types::Standard::Num->inline_assert($_[1]) if @_ > 1 };
22:04 Grinnz_ warning: i just made that up, YMMV
22:05 Grinnz_ whoops, assert_valid not inline_assert
22:06 nicomen that would require both a has and a before right?
22:06 Grinnz_ no, just Class::Method::Modifiers and the appropriate Type::Tiny class
22:08 Grinnz_ that of course doesn't do the coercion aspect of types, etc... much simpler to just use Moo :P
22:10 jberger if you want all the bells and whistles, just use Moops
22:12 Grinnz_ except for how it says it's unstable :P
22:15 nicomen jberger: I specifically don't want bells and whistles
22:16 nicomen I think I would even live just fine with even less than what Moo has
22:23 Grinnz_ well, type checking is a bell :P
22:23 Grinnz_ or is it a whistle?
22:25 nicomen hehe
22:25 nicomen it's part of a signature if you ask me ;)
22:25 jberger the whistle is what happens when you fail
22:29 panshin joined #mojo
23:21 odc joined #mojo
23:21 meshl joined #mojo

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