Camelia, the Perl 6 bug

IRC log for #mojo, 2010-08-28

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

All times shown according to UTC.

Time Nick Message
00:40 sri marcus: dark nebula episode 2 finished :)
01:06 Akron joined #mojo
01:13 Akron left #mojo
01:49 yakudza joined #mojo
01:54 tempire hrm
01:55 tempire Perl has never been ported to the JVM, has it?
01:55 sri there was an attempt a few years back i think
01:55 tempire I just learned about the Google App Engine.
01:55 sri GAE sucks
01:55 sri it's not the future
01:55 tempire Does it?  The promise sounds amazing.
01:56 sri there are way better alternatives
01:56 tempire Free alternatives?
01:56 sri the whole idea of sandboxing languages is stupid
01:56 tempire free!
01:56 sri they are working on GAE Enterprise for a reason
01:57 sri heroku is the right way i think
01:58 sri free is a problem though
01:58 sri heroku is basically a sugar layer for amazon ec2
02:00 sri i don't think there is a simple cloud hosting service for perl yet though :(
02:00 tempire I would kill a man for a mojolicious heroku
02:01 sri i've thought about it, it's rather simple, but there is not enough money to be made :/
02:01 tempire ec2 isn't hard to manipulate, really.  I can't imagine it would be that difficult to set up.
02:01 tempire yeah.
02:02 tempire The branding would be nice, though.  Especially in contrast to deploying with another framework I know.
02:03 tempire But the free thing.  Dernit.
02:05 sri well, you can't really do anything cool inside the GAE sandbox
02:07 sri no long polling, no connections to the outside, only google storage
02:09 tempire ec2 reserved instance pricing isn't so bad.
02:10 tempire $227.50 per year
02:11 sri hmm
02:16 sri +$0.03 per hour
02:18 tempire That's how they get the 227.50 figure
02:18 tempire "After the one-time payment for an instance, that instance is reserved for you, and you have no further obligation"
02:18 tempire oh
02:18 tempire you might be right
02:18 sri as a non native english speaker i'm very confused
02:19 tempire Even so, it comes to 40USD per month.
02:19 tempire That's not so prohibitive.
02:19 sri +transfer volume
02:19 sri just 1gb is free
02:20 tempire How many people create web apps that get more than 10G per month, though.
02:21 tempire $1.50
02:21 tempire Or, actually $1.35
02:21 tempire Still about 40 per month
02:22 sri i would love to see such a service for perl though
02:35 janus left #mojo
03:13 janus joined #mojo
04:00 tempire Well no wonder heroku can provide a free layer to ec2
04:01 tempire 3M, followed by 10M in funding.
04:03 tholen42 joined #mojo
04:05 tl left #mojo
04:08 sri well, the free heroku layer is really just for testing
04:09 sri they also share ec2 instances between apps
04:10 sri you don't get instances from them, just worker processes
04:11 sri worker processes also seem to be sandboxed strictly
04:11 tempire I'm dreaming of a service that deploys a mojolicious app with a click, then opens up a bespin window to let you edit code.
04:12 sri well, you could write a script that creates a ec2 instance for you and deploys the app :)
04:12 sri you would just have to insert your ec2 credentials
04:13 tempire well if you just say it outright, how am I suppose to surprise anyone!
04:14 sri the big problem with free cloud hosting is spam
04:14 tempire are arbitrary requests that big of a problem?
04:14 sri you either disallow all outside communication or require money right from the start
04:15 sri as in IO::Socket::INET->new
04:15 sri people will abuse such a service
04:16 sri so you can't really do anything fun with a free service
04:16 tempire you could rate limit requests, and always give priority to the ip the admin is logged in from.
04:17 tempire I'm not really thinking of anything more than small deployments
04:17 tempire Getting people looking at and seeing easy perl/mojolicious deployments would be my goal
04:18 sri you would basically scale down to CGI-ish behavior
04:18 sri with strict limits
04:19 sri but you still need a sandbox to prevent fork and stuff
04:20 sri http://colabv6.dan.co.jp/lleval.html # you basically want a little more advanced version of this
04:21 skaurus left #mojo
04:49 skaurus joined #mojo
04:50 skaurus sri: I found a bug. file http://github.com/kraih/mojo/blob/m​aster/lib/Mojolicious/Controller.pm, line 97. It should be $template = shift if (@_ % 2 && !ref $_[0]) || (!(@_ % 2) && ref $_[1]);
04:50 skaurus added parenthesis in latter condition
04:51 skaurus or render('template_name', \%hash) doesn't work properly - it get default template name instead of template_name
04:51 skaurus and maybe arsg gets broken too
04:52 skaurus sorry that I don't prepare a patch)
04:57 sri skaurus: thanks fixing, whats your real name?
04:59 skaurus Dmitriy Shalashov
05:00 GitHub55 joined #mojo
05:00 GitHub55 mojo: master Sebastian Riedel * 5cfd68c (4 files in 4 dirs): fixed small render bug - http://bit.ly/cwqthf
05:00 GitHub55 left #mojo
05:04 sri ohoh
05:05 sri it broke another test
05:06 skaurus %)
05:08 sri hmm, considering that it never worked i'll just remove it :o
05:11 skaurus :)
05:12 GitHub72 joined #mojo
05:12 GitHub72 mojo: master Sebastian Riedel * ebfd0b4 (2 files in 2 dirs): cleanup - http://bit.ly/aD69bS
05:12 GitHub72 left #mojo
05:14 skaurus i'm not sure if rendering guide should be cleaned too?
05:16 sri don't think so
05:18 cognominal left #mojo
05:20 skaurus oh. Now nor render('smth', {}) nor render(template => 'smth', {}) working
05:20 skaurus in second case template name will be template, not smth
05:21 sri correct
05:21 sri both never worked anyway
05:21 sri no loss
05:22 skaurus %) are you going to make work at least one of them? :)
05:22 sri nope
05:23 skaurus :(
05:23 sri why?
05:23 skaurus how then i will choose template name different from method name?
05:23 sri ->render('smth')?
05:24 sri ->render(template => 'smth')?
05:24 skaurus and if i want to pass some args?
05:24 sri ->render('smth', foo => 'bar')
05:25 sri ->render(template => 'smth', foo => 'bar')
05:26 sri thats the whole point of the modulo operation in render
05:26 skaurus oh
05:28 cognominal joined #mojo
05:29 skaurus left #mojo
05:30 GabrielVieira joined #mojo
05:31 fod left #mojo
05:38 polvo who is good at sorting here? ;)
05:39 polvo i mean sort();
06:05 arpadszasz joined #mojo
06:12 perlrocks Twitter: "Right back at ya baby! Mwah! “@danperezfilms: One word: #Mojolicious: @ItaliaTrent #Film”" --ItaliaTrent http://twitter.com/ItaliaTrent/status/22332595208
06:31 arpadszasz hello
06:31 arpadszasz i'm having trouble getting the request params
06:31 arpadszasz this is what i've tried http://pastie.org/1121995
06:31 arpadszasz trying to get params as a hash
06:48 arpadszasz this seems to work: my %params = @{ $self->stash('mojo.params')->params }
06:49 arpadszasz but it's ugly :)
06:56 polvo arpadszasz, i'm not sure, but try $self->req->params->to_hash;
06:57 arpadszasz yeah, that works
06:57 yko joined #mojo
07:00 arpadszasz thanks
07:00 arpadszasz but i can't find it documented
07:09 yko arpadszasz : perldoc Mojo::Parameters
07:12 yko left #mojo
07:13 yko joined #mojo
07:15 arpadszasz i've read Mojo::Parameters
07:16 arpadszasz one of the first things i've tried was to get the params from Mojo::Parameters->new->to_hash
07:17 arpadszasz i think (at least for people new to Mojo) that a mention of $self->req->params would be appropriate in Mojolicious or Mojolicious::Lite POD
07:18 arpadszasz i'll try to send in a POD patch later today
07:23 und3f[A] is now known as und3f
08:03 Htbaa joined #mojo
08:55 _mpu left #mojo
09:08 MojoGuest928 joined #mojo
09:08 MojoGuest928 From: http://www.google.com/url?sa=t&source=w​eb&cd=3&ved=0CBoQFjAC&url=http%​3A%2F%2Fdev.xantus.org%2F&rct=j&q=w​ebsocket%20irc&ei=5dF4TMOeOMaXcbKW0ZcG&​amp;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
09:08 MojoGuest928 left #mojo
09:43 baton8 joined #mojo
09:52 yko left #mojo
09:57 yko joined #mojo
10:05 MojoGuest989 joined #mojo
10:05 MojoGuest989 From: http://www.google.de/search?q=websocket+demo&​amp;ie=utf-8&oe=utf-8&aq=t&rls=or​g.mozilla:en-US:official&client=firefox-a (1 hits)
10:05 MojoGuest989 left #mojo
10:09 spleenjack joined #mojo
10:10 arpadszasz left #mojo
10:31 MojoGuest456 joined #mojo
10:31 MojoGuest456 From: http://www.google.lt/search?q=websocket+demo&​amp;ie=utf-8&oe=utf-8&aq=t&rls=or​g.mozilla:en-US:official&client=firefox-a (1 hits)
10:31 MojoGuest456 web
10:31 MojoGuest456 left #mojo
10:47 janus left #mojo
11:13 Vizin joined #mojo
11:24 janus joined #mojo
11:34 yakudza left #mojo
11:48 chansen joined #mojo
12:53 maettu joined #mojo
13:00 und3f is now known as und3f[A]
13:13 Vizin left #mojo
13:32 maettu how can I manually set Content-Type to "application/javascript"?
13:51 sri maettu: $self->res->headers->content_type(...) or $self->render(..., format => 'js')
13:55 maettu sri: thank you (I'm still not very common to the stash..)
14:06 perlrocks Twitter: "Would anyone actually be interested in heroku-ish cloud hosting for #perl and #mojolicious?" --kraih http://twitter.com/kraih/status/22355224502
14:09 Htbaa left #mojo
14:10 perlrocks Twitter: "What kind of #perl cloud hosting service would you be willing to pay for? and how much? #mojolicious" --kraih http://twitter.com/kraih/status/22355548874
14:10 perlrocks Twitter: "Me!, only #mojolicious? - RT @kraih: Would anyone actually be interested in heroku-ish cloud hosting for #perl and #mojolicious?" --freekey http://twitter.com/freekey/status/22355561066
14:12 perlrocks Twitter: "@kraih i'm not familiar with heroku but it seems to be intresting idea for #perl and #mojolicious" --Dim_K http://twitter.com/Dim_K/status/22355705031
14:14 perlrocks Twitter: "What kind of #perl cloud hosting service would you be willing to pay for? and how much? #mojolicious: What kind of... http://bit.ly/aw2hfI" --TopCloudHosting http://twitter.com/TopCloud​Hosting/status/22355782495
14:14 perlrocks Twitter: "Would anyone actually be interested in heroku-ish cloud hosting for #perl and #mojolicious?: Would anyone actually... http://bit.ly/bYsC1G" --TopCloudHosting http://twitter.com/TopCloud​Hosting/status/22355782785
14:25 perlrocks Twitter: "@kraih I'm mostly do #catalyst and #mojolicious apps. 90% using #dbic (sqlite for testing/devel and mysql for production). PSGI heroku-ish?" --freekey http://twitter.com/freekey/status/22356592607
14:28 diegok sri: (i'm freekey) a PSGI heroku-ish service/engine would be heaven :)
14:30 diegok sri: I was dreaming on something like this several times. But never did anything more than dream on :(
14:30 sri the service is actually easy to implement
14:31 sri the problem is making money with it
14:31 diegok sri: and restrict environment while not restrict apps?
14:32 sri you have to restrict the app
14:33 diegok sri: yes, you should restrict apps structure, right?
14:33 sri nono, just features
14:33 diegok I'm not used to heroku. Just talk'd about it with ruby friends.
14:34 diegok and used their apps there.
14:34 sri you are not allowed to open sockets and stuff
14:34 sri just to white listed services
14:34 diegok but you can talk to a ddbb, right?
14:34 diegok ok
14:35 diegok and how you tell which database(s) you will use and how to deploy?
14:35 diegok or apply deltas...
14:36 diegok (migrations)
14:36 diegok dbic::versioned or something like this?
14:36 sri possibly, i would only provide the database
14:37 sri and run a script on deployment
14:37 diegok (i'm using versioned plus homebrew script on top of it)
14:38 diegok sound's really nice. But the money is a problem without critical mass :(
14:40 diegok then you need to monitor app needs to deploy/proxy to new instances... right?
14:44 sri ye
14:50 diegok sri: Now I'm deploying several apps on ovh 46 euros servers. But I think I would use a service like this for small apps. Still think I will then move the apps to my servers when hosting on the heroku-ish cloud service become too expensive for the app needs...
14:51 diegok sri: I'll survey my ror friends using heroku ;-)
14:51 sri right, such a service only makes money with small apps
14:51 sri don't think it's possible to hit the critical mass with perl :/
14:52 diegok sri: :-((
14:52 * diegok cry loud
14:54 perlrocks Twitter: "mojolicious" --tempire http://twitter.com/tempire/status/22358679108
14:55 diegok sri: yes, that's the big problem. Free testing apps will need more money that the earned by pay ones till the service hit the critical mass :(
14:56 perlrocks Twitter: "Building a cloud hosting service for #perl is actually quite trivial, the big problem would be hitting critical mass. #mojolicious" --kraih http://twitter.com/kraih/status/22358818436
14:57 diegok sri: is it trivial to stop apps not used for x time and start on first request?
14:57 sri it is
14:57 diegok :)
14:58 sri heroku does that
14:58 sri thats why the first request to a small app on heroku takes more time
14:59 maettu some days you explained me where / how to find the parameters of a GET request. Now where are the parameters of a POST? :-S
14:59 yko left #mojo
14:59 sri $self->params
14:59 diegok that should alleviate free apps costs...
14:59 sri they are all mixed there
15:00 diegok maettu: it follow the old CGI tradition :)
15:00 sri you still need between 100 - 200 paying customers to keep the service alive according to my calculations
15:00 sri more if the service is based on ec2
15:00 diegok right.
15:01 maettu $self->param only gives me action, controller, nocache ..
15:01 diegok ovh is a cheap option for europe customers (as you don't pay for trafic).
15:01 sri i like hetzner
15:01 perlrocks Twitter: "@kraih Like the design for the mojolicious site, it would give #perl some cool cred & could be a catalyst for a return to Perl." --paulhenrich http://twitter.com/paulhenrich/status/22359291375
15:02 diegok Don't know hetzner. I'll check.
15:03 maettu parameters don't come in "Parameters" but in "Post" according to firebug
15:04 sri maettu: i'm not sure what you mean
15:04 maettu sri: one minute, I'll try to figure out..
15:04 sri if you want only POST parameters use $self-req->body_params
15:06 diegok sri: hetzner looks similar to ovh on the first look. Nice to know an alternative. Thanks.
15:12 maettu I need what was in $cgi->param('POSTDATA') with good old fashioned CGI.pm
15:13 * sri can't follow
15:13 sri please speak in http terms
15:13 maettu :-S
15:19 maettu ok, found it: $self->req->content->asset
15:20 maettu perhaps this helps you to understand what I meant.. :-)
15:20 sri so you want the actual message body unparsed
15:20 sri $self->req->body will work too
15:22 maettu yes, thank you for your patience..
15:26 Outlaw joined #mojo
15:45 maettu is there a also "shortcut" for $self->req->method?
15:48 MojoGuest736 joined #mojo
15:48 MojoGuest736 From: http://www.google.nl/ (1 hits)
15:49 MojoGuest736 left #mojo
15:49 sri maettu: no, it's already short enough
15:50 maettu sri: true :-)
15:51 tempire rackspacecloud is cheaper than ec2
15:52 tempire 256RAM,10G HDD, 1G incoming, 10G outgoing is estimated at $13.23 per month
15:53 tempire they have a rest api as well
15:53 sri intersting
15:54 tempire posterous uses it
16:11 yko joined #mojo
16:12 Outlaw left #mojo
16:12 spleenjack left #mojo
16:13 spleenjack joined #mojo
16:16 spleenjack left #mojo
16:16 spleenjack joined #mojo
16:21 tempire rackspace is definitely a better experience to setup than ec2
16:22 tempire even has a web-based console
16:22 sri hosting is not really the problem though
16:22 sri it could just as well start on a few normal dedicated servers
16:40 yko left #mojo
16:40 yko joined #mojo
16:41 crab what is this "it" that could start on a few normal dedicated servers?
17:00 sri heroku-ish hosting for mojolicious
17:00 sri (and perl)
17:00 vti sri: how many clients is the minimum number?
17:00 sri 100-200
17:03 sri without ec2
17:05 sri psgi would be extremely easy to host in a self managing cluster
17:05 sri websockets and long polling take a little more work
17:06 sri databases also want to be managed
17:10 arpadszasz joined #mojo
17:14 yko left #mojo
17:14 sri but i don't think there are enough people willing to pay for it
17:15 sri most are only interested in a free service for testing
17:19 spleenjack left #mojo
17:22 und3f[A] is now known as und3f
17:27 sri once 100 people request it i'll start ;p
17:28 spleenjack joined #mojo
17:43 yko joined #mojo
17:50 arpadszasz sri, the fact that Mojolicious can do websockets might draw users to that service
17:51 arpadszasz as i researched yesterday, the major webservers (Apache, nginx, etc.) can't do websockets, only through some hacks
17:52 sri maybe, maybe not
17:52 GabrielVieira left #mojo
17:52 arpadszasz just a thought
17:55 arpadszasz websockets might be the "killer app" for that service, exploiting the fact that _now_ the #1 hit on Google for "websocket demo" is dev.xantus.org
17:55 arpadszasz that's good marketing :P
17:55 DaTa sri: what do you think about a bind_cb in Mojo::IOLoop->listen, that get's called after the socket is created? So one can listen on privileged ports, and drop privileges after binding there
17:57 sri DaTa: we do that without a bind callback in daemon_prefork for ages
18:00 sri actually, i think even daemon supports it
18:01 sri yea, works flawless
18:01 DaTa yeah, spotted it thanks :)
18:30 vti sri: websocket hosting with a websocket ssh ;)
18:37 sri vti: a what?
18:37 sri oh your websocket ssh, sneaky vti -.-
18:38 crab so mojo doesn't verify ssl/tls certificates when connecting to a server?
18:38 sri by default it isver liberal
18:38 sri *+y
18:39 crab can i make it strict? or do i have to roll my own check using the ssl/tls_verify_cb?
18:40 sri i think you have to roll your own atm
18:42 sri patches welcome if there are more IO::Socket::SSL options we could support
18:50 crab also, the ioloop handles writes completely internally, right? there are no callbacks for "writable" events?
18:50 sri thats right
18:50 crab you just hand it a buffer and take it for granted that it will write it in whatever chunks are needed?
18:50 crab ok
18:51 sri right, it will also try to directly fill the kernel send buffer and bypass poll/epoll/kqueue for writes
18:52 sri for micro servers that can be a 100% performance difference
18:53 sri (like examples/microhttpd.pl)
18:53 sri depends on the kernel send buffer size though
18:54 crab where's the code that does that?
18:54 sri sub write
18:55 sri it's specifically disabled on windows now, since their tcp stack can't handle it
18:56 sri if you want to know when it finished writing your chunk you can also pass a callback
18:58 crab sub _write? ah, i see. it does syswrite($buffer->to_string) and expects eagain/ewouldblock if the buffer is filled before the chunk is written. fine.
18:59 sri the code is still fresh but so far it seems to work pretty much everywhere
19:00 sri apart from the windows kiccups
19:06 vti sri: i am not sneaky :(
19:06 crab how does websocket ssh work?
19:07 sri X_x
19:07 sri vti: stop sneaking around!
19:07 vti crab: http://vimeo.com/13681309 !
19:08 vti sri: i don't like the translation! it's very bad =/
19:08 sri Oo
19:10 vti it's like niederträchtig :'(
19:10 sri aww
19:10 * sri hugs vti
19:10 crab vti: it execs ssh and talks to it?
19:11 sri translations are mostly wrong though
19:11 vti crab: ye, via websockets
19:11 crab (i just caught a glimpse of "IO::Pty" in lib/Shell.pm when you opened it
19:11 vti crab: there is even a source code ;p
19:11 crab i don't understand how websockets fits in. where is the source code? maybe i'll understand if i read it
19:12 crab found it.
19:12 sri websockets provide a persistent low latency connection
19:14 vti crab: it's like a real terminal, as soon as you type a letter, it's already there
19:19 crab so my browser makes a websocket connection to some perl code that feeds the ssh client?
19:21 vti ye
19:21 crab oh!
19:22 crab there is no actual ssh involved. right?
19:22 crab at least, if i read the code correctly.
19:22 crab you exec a *shell* and then i talk to it.
19:22 vti as a client, you need only a browser with websocket support
19:22 crab i thought you exec ssh which connects to some ssh server
19:23 vti video example does this, the source code is a bit different :)
19:23 crab ah, ok. so i'm not terminaly confused.
19:27 crab but if i understand correctly, if you just change $config->{shell} to e.g. 'ssh foo.somehost.com', it should "just work"? right?
19:27 crab and other changes would be just to accept hostname etc. in the form
19:36 esskar_ joined #mojo
19:39 esskar_ sri, thanks
19:56 esskar_ all tests pass
20:51 yko left #mojo
20:55 awnstudio joined #mojo
21:02 maettu left #mojo
21:09 [1]awnstudio joined #mojo
21:09 awnstudio left #mojo
21:09 [1]awnstudio is now known as awnstudio
21:10 perlrocks Twitter: "Sandboxing #perl is actually much easier than i thought thanks to FreeBSD::i386::Ptrace by @dankogai. :) http://bit.ly/dr5OAA #mojolicious" --kraih http://twitter.com/kraih/status/22383393442
21:22 sri damn, i think i know exactly how to do it
21:30 und3f is now known as und3f[A]
22:02 arpadszasz left #mojo
22:47 GabrielVieira joined #mojo
23:13 su-bzero_ joined #mojo
23:18 su-bzero left #mojo
23:23 AL-76 joined #mojo
23:30 ysyrota joined #mojo
23:35 spleenjack left #mojo

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