Camelia, the Perl 6 bug

IRC log for #mojo, 2012-07-14

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

All times shown according to UTC.

Time Nick Message
00:57 noganex_ joined #mojo
02:14 noganex_ joined #mojo
02:44 Lucas1 joined #mojo
03:01 bjoernfan joined #mojo
03:34 ryozi joined #mojo
04:00 drago joined #mojo
04:04 drago Mojo - it's so freaking awesome.  Thanks x1000000
06:05 niczero joined #mojo
06:08 niczero morning sri
06:08 niczero been wondering...
06:08 tetraodontidae joined #mojo
06:09 niczero could you please add Mojo::Cache::compute
06:11 niczero $cache->compute($somekey, sub { ... })
06:11 niczero works like set
06:12 niczero and
06:13 niczero $value = $cache->compute($somekey, sub { ...})
06:13 niczero works like get
06:14 niczero the coderef is ignored unless key is absent from cache
06:16 niczero If it's called 'compute' then the coderz have easy upgrade path to more sofffisticated implementations
06:18 niczero Would help rapid prototyping, with smooth enrichment when the need arises
06:44 Vandal joined #mojo
06:51 Leandr joined #mojo
07:01 d4rkie joined #mojo
07:17 sr joined #mojo
08:11 Leandr joined #mojo
08:31 xaka joined #mojo
10:07 amirite joined #mojo
10:20 Psyche^ joined #mojo
10:20 Foxcool joined #mojo
10:55 mire joined #mojo
10:55 d4rkie joined #mojo
11:10 * sri yawns
11:11 sri niczero: i don't see the benefit
11:25 batman joined #mojo
12:04 Coff joined #mojo
12:05 Coff Hi all.
12:06 Coff Does anyone know where I need to 'hook' in to be able to redirect a request if the user do _not_ request some static content?
12:07 Coff I guess 'before_dispatch' is a no-go?
12:10 Foxcool joined #mojo
12:49 nic The revulsion against env vars was (historically) for two reasons
12:49 nic CPU cycles were expensive and people didn't like the cost of perl accessing its env
12:50 nic And it had been a long slog to escape the nightmare of UNIX env vars
12:50 nic in those days a lot of apps just wouldn't work unless you had a magic incantation of env vars
12:51 nic Anyone remembering the problems of LD_LIB_PATH knows what I'm talking about
12:52 nic Some apps had to have the path defined, with some X before some Y, whereas another needed Y before X, and another needed the var to be undefined
12:54 nic I'm a bit disappointed with perlbrew that it has almost returned there, and it's hampering the Modern Perl revolution
12:54 nic But my understanding with Mojolicious is that the env vars are just for short-term use, so those historic problems don't apply
13:22 crab i... see.
13:31 * sri wonders why the env var discussion went in that direction, the original question was if it's ok that MOJO_USERAGENT_DEBUG and MOJO_TEMPLATE_DEBUG look so similar
13:32 sri because one is more of an enduser feature now while the other is diagnostics for the core developers
13:36 crab oh, i didn'r even realise there had been an env var discussion.
14:03 nic sri: when you say you don't see the benefit, is that you don't see the benefit of a cache class having a 'compute' method, or you don't see the benefit in Mojo having a cache class that's useful to end coders?
14:03 nic (just so I know what I'm trying to persuade you of :) )
14:14 sri nic: both
14:14 sri it's not an end user api, so core would have to benefit from all new features
14:16 sri and if you want to turn it into an end user api you would have to convince me that the majority of our users benefits from it
14:19 sri the FAQ outlines it actually pretty well, you can always try a vote http://mojolicio.us/perldoc/Mojolicious/Guides/FAQ​#Can_you_add_feature_XY_to_the_core_distribution3F
14:42 nic fair enough
14:42 nic I'll pop it into a separate class
14:43 sri if you just want to sneak in a tiny feature, the easiest way is to reduce lines of code, i can never resist that :)
14:44 nic :)
14:45 nic Looking at the Mojolicious code, I don't see any lines that benefit from ->compute
14:45 nic so I can see that a separate module + Mojolicious::Plugin::SimpleCache is the way to go
14:46 nic I want the caller to not care whether the key already exists
14:47 nic and to guarantee a key doesn't have a duplicate
14:48 nic "I want this value, if you don't have it, get it and keep a copy; btw, this is how you get it"
14:49 nic I liked the intro to CHI talk at YAPC, but it's way too big for my purposes
14:49 nic I just need something about four lines longer than Mojo::Cache
14:49 nic I really must spend less type talking; could have had the unit tests written by now :)
14:54 marcus https://twitter.com/stevelosh​/statuses/223829691176456192
14:56 marcus hmm
15:13 sri Oo
15:27 Coff How does one go about modifying modifying the value of an app attribute.
15:28 Coff Meant to have a '?' back there..
15:29 Coff app->attr(foo => sub { ... });    is what I have defined. After a couple of requests I need to 'reload' what the application thinks that attribute should be.
15:29 jontaylor joined #mojo
15:32 batman Coff: sure you don't want to store that value in a session cookie instead?
15:33 Coff Yup. It is a structure initially pulled from a database, then 'cached' in-app. Need to reload that value when the database content changes (which is almost never).
15:34 batman i don't think you're asking the right question, but it can be solved like this: has foo => \&_build_foo; sub _build_foo { 123 } hook before_dispatch => sub { $_[0]->app->foo($_[0]->app->_build_foo) };
15:35 Coff Thanks. I'll have a look at that solution. :)
15:35 batman btw: you need some if(...) logic in addition, since my code will reset the value on each request
15:36 batman like if($last_time + 60 < time) { ... }
15:37 JiYu joined #mojo
16:18 batman https://gist.github.com/3111962 <-- any idea why it can't find index.html.ep from this lite app?
16:23 inokenty batman: maybe because of semicolon after % title 'Upload image example'   and  % layout 'default' ?
16:27 batman no. that should result in a syntax error...
16:27 batman if anything
16:38 GitHub180 joined #mojo
16:38 GitHub180 [mojo] kraih pushed 1 new commit to master: http://git.io/K89tIw
16:38 GitHub180 [mojo/master] small optimizations and documentation tweaks - Sebastian Riedel
16:38 GitHub180 left #mojo
16:41 sri batman: __PACKAGE__->attr looks wrong
16:41 sri easpecially since you're using it as $self->app->$attribute_name
16:41 sri __PACKAGE__ in a lite app is "main"
16:42 sri or some random generated sandbox package
16:42 sri while app is an instance of Mojolicious::Lite
16:43 sri no idea about the index problem, but that's the error that was obvious to me
16:44 sri you may have more luck with helper foo_bar => sub { $images };
16:44 batman ok
16:47 sri interesting how perltidy changes little by little with every release, and every time a few parts of mojolicious look different :)
16:49 batman oh. i did cat file | perl - daemon
16:49 batman that didn't work well
17:05 tempire diegok: did you ever get the mojo deploy issue worked out, where it was continually asking you for credentials?
17:06 andrefs joined #mojo
17:08 brambles joined #mojo
17:13 spaceships joined #mojo
17:33 batman yey! my @ and # hack in the title worked as expected :) https://twitter.com/perlironm​an/status/224194398748028929
17:34 * batman feel so clever
17:34 * tempire pats batman on the back
17:35 batman hehe
17:36 batman i thinking about resubmitting the blog now (without @ and #) now, but i'm not sure if i bother to...
17:37 xaka joined #mojo
18:04 sri \o\
18:04 sri /o/
18:05 sri aww, ack is ahead of us on github again :/
18:05 sri marcus jinxed it
18:06 marcus sri: we've managed to lose a couple :-/
18:07 sri always happens when there are more than two commits per day :S
18:11 mire joined #mojo
18:12 * sri doesn't understand why autoboxing is not more popular in python
18:17 Ulti sri noticed your post about perl6 are you thinking of porting Mojolicious to it?
18:17 sri since the first day i started designing mojolicious
18:17 Ulti yay
18:18 sri don't get too excited, it will be years until perl6 is ready
18:18 Ulti yeah I already play with each release of Rakudo
18:18 Ulti its getting better quite quickly
18:18 sri i estimate at least 5-10 years
18:18 Ulti lol
18:19 Ulti its fairly usable now, but utterly unstable from a feature pov
18:20 sri from my point of view it is absolutely unusable
18:20 Ulti I'd agree with the 5 year estimate, 10 if you mean you have something resembling a bigger community and libraries
18:20 Ulti yeah
18:20 Ulti anyone wanting to actually develop something serious its not usable, to play around and get used to the syntax its ready now
18:21 sri the switch away from parrot will be at least 2 years, finishing the core language and stdlib is a wildcard
18:22 Ulti well there is already the .net version
18:22 Ulti edit: mono
18:22 sri but all language design seems to happen in rakudo
18:22 Ulti yeah
18:23 sri and don't forget that it has to be at least as fast as perl5
18:24 sri that's another few years of optimizations
18:24 Ulti well the OO wont ever be
18:24 sri you can't say that
18:24 sri on the jvm i bet it could
18:24 sri just look at jruby
18:25 sri it's a beast
18:25 sri and everybody said it couldn't be done
18:25 Ulti its more who is going to make the beast
18:26 Ulti the reason everyone says something cant be done is usually because they dont want it to be done :)
18:27 sri perl6 will also have to be faster than ruby, after all it takes just about the same time porting mojolicious to python or ruby
18:30 sri i really hope perl6 gets concurrency right
18:31 sri got a feeling that will make or break the language
18:34 rem_lex joined #mojo
19:14 andrefs joined #mojo
19:21 jontaylor joined #mojo
20:21 taryk joined #mojo
20:30 marcus sri: doesn't seem to be a big focus so far.
20:35 sri marcus: don't think that means much yet, the biggest problem seems to be parrot limitations
20:38 sri autothreading with junctions does seem like a pretty interesting idea
20:54 diegok tempire: don't remember. It was some tests for slides. But I can do all the test you want ;-)
21:34 tempire as far as I know, it's working perfectly; I use it all the time
21:34 tempire I just want to know if something isn't working as expected
22:01 Ulti sri isnt there supposed to be some form of automation for porting from perl5 to perl6?
22:02 Ulti sri the autothreading with junctions thing is basically what I use Perl5 for when I do all my huge bioinformatics runs of things
22:03 sri Ulti: perl6 is a different language, a mojolicious port would suck if it wasn't redesigned from scratch to take advantage of new features
22:04 Ulti yeah then it becomes a full reimplement :/
22:04 Ulti have you sen the Web module already available
22:04 sri no way around that
22:04 sri yea, they are pretty bad
22:05 Ulti :(
22:05 sri one facepalm moment after another ;p
22:05 Ulti you are busting up my dreams of eventually switching to perl6 sri
22:05 sri but that's to be expected when language design people prototype stuff
22:06 Ulti its kind of annoying, so far I really like the language, its especially great for writing parsers which is what 60% of my code can be reduced to
22:06 Ulti yeah I think it was done more so that there was something available
22:06 sri a full mojolicious redesign wouldn't take more than 3-6 months though, if i could work on it full-time and rakudo had the required features
22:06 sri (to repair some of your dreams)
22:07 Ulti like you're not a language if you dont have any kind of web framework
22:07 Ulti I'd pay towards that effort
22:08 Ulti I guess if you aren't hung up on a lot of CPAN includes its not so harsh moving to a new language
22:08 sri yea, and we can leave out more advanced features like hypnotoad for a first release
22:10 sri user agent, daemon and basic framework would be enough for a start
22:14 * Ulti is worried by how switching 8 time zones hasn't affected the people who are online
22:44 MichaelRpdx joined #mojo
23:15 andrefs joined #mojo

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