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

IRC log for #mojo, 2016-06-04

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

All times shown according to UTC.

Time Nick Message
01:14 tchaves joined #mojo
02:39 noganex joined #mojo
03:17 jberger there aren't very many registered subprotocols: https://www.iana.org/assignments/websocket/websocket.xml
03:29 jberger maybe WAMP? http://wamp-proto.org/
04:11 oalders joined #mojo
04:13 jacoby_ joined #mojo
04:52 mpapec jberger: original regex seems to be faster
04:52 mpapec https://gist.github.com/mpapec/ecadd07d8576a2c5a961d3431cfc47c6
04:52 mpapec gives,
04:52 mpapec Rate matchAll matchOne
04:52 mpapec matchAll 3700856/s       --     -41%
04:52 mpapec matchOne 6267101/s      69%       --
04:53 kaare joined #mojo
07:37 Vandal joined #mojo
07:40 ribasushi joined #mojo
10:07 plicease joined #mojo
10:09 * sri yawns
11:03 cpan_mojo Mojo-Redis2-0.25 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojo-Redis2-0.25
11:11 cpan_mojo Mojo-Redis2-0.26 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojo-Redis2-0.26
11:44 VVelox hmm... just greated a helper and < and > is being replaced with &lt; etc
11:44 VVelox How do I disable that?
11:44 VVelox using return to return what I want inserted in the template.
11:44 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Embedded-Perl
11:44 bpmedley VVelox: In templates?  Are you using <%== ?
11:45 VVelox %=
11:45 VVelox sweet
11:45 VVelox thanks
11:46 bpmedley VVelox: Also see auto_escape, I think..
11:52 bjoernfan joined #mojo
12:11 VVelox I <3 how helpful this channel is.
12:13 sri pay the favor forward ;)
12:13 VVelox will in time :)
12:14 mishanti1 Anyone here going to YAPC::EU?
12:17 sri not me
12:18 Vandal have you considered making default template engine jade-like?
12:19 sri a few times actually
12:20 Vandal don't have time for it?
12:20 sri it also wasn't a very popular idea
12:20 sri we will always have a need for ep, so it could only be an aditional template engine
12:20 sri but built around Mojo::Template
12:20 Vandal why?
12:21 sri because systems like jade are html specific
12:21 Vandal oh
12:21 Vandal didn't think of it
12:21 sri ep is good for all text based formats, which is really nice
12:21 Vandal but on the other hand your motto is "Ductape for HTML5"
12:22 mishanti1 For me Mojo is more like "Ductape for Perl".
12:22 sri for the html5 web
12:22 bpmedley That is cool.  I hadn't fully contemplated non-html ep templates.. That's svelte.. :)
12:22 sri which is a collection of technologies ;)
12:23 sri it is a little sad that there is no good jade like template system on cpan though
12:23 Vandal what about Text::Haml?
12:24 sri haml is not as cool as jade imo
12:24 Vandal but pretty close though
12:41 meshl joined #mojo
12:42 zivester joined #mojo
12:51 disputin joined #mojo
13:13 jberger sri: Thoughts on WAMP?
13:13 * jberger yawns
13:15 * sri yawns
13:16 sri wamp looked way too complicated when i saw it on the websocket mailing-list
13:17 jberger I think I'm going to give it a look today
13:29 noganex joined #mojo
13:30 janus joined #mojo
13:52 lluad joined #mojo
13:54 noganex_ joined #mojo
14:02 jberger actually the message scheme doesn't look too hard
14:02 jberger JSON arrays
14:29 lluad joined #mojo
14:51 jberger and it is gradually implementable
15:05 marty joined #mojo
15:46 sri ah, the people behind wamp were buggering me about using their websocket testing thingy, that left a very bad impression with me
15:47 jberger huh?
15:47 sri guess i never really looked into it after that
15:47 sri the company, tavendo
15:49 jberger they wanted you to use their tester? why would they care?
15:50 sri think they buggered all authors of websocket implementations
15:51 sri i can only guess, but i'd assume they wanted to establish their testing tool as the standard or so
15:51 jberger ah
15:51 jberger that does sound annoying
15:52 jberger and yet I don't see too many alternatives beyond socket.io for a "standard" for pubsub over websocket
15:52 jberger and it has an actual RFC
15:52 sri you mean a draft
15:52 jberger well, yes
15:52 jberger but something that defines an implementable protocol
15:52 sri the working group for it has been shut down
15:53 sri there is no rfc coming as far as i know
15:53 jberger seems like there are plenty of drafts that are defacto rfcs though
15:53 jberger especially in the JSON realm
15:53 sri disagree
15:54 jberger JSON reference is used all over the place for example
15:54 sri all the drafts i've ever implemented have become rfcs pretty fast
15:54 jberger and it is an expired draft
15:54 sri i don't know json reference
15:55 sri either way, i don't have to like wamp ;p
15:57 jberger no you don't
15:57 jberger I'm just trying to get a feel for it
15:58 jberger I figure even if I don't end up implementing it, it would still give me an idea of what kinda of metadata is useful
15:58 sri maybe look into the discussions that happened in other web framework c ommunities
15:59 sri rails, django and phoenix are all doing their own thing
15:59 jberger right, that's what I'm trying to avoid :P
16:00 jberger but it might be worth looking at
16:00 jberger for the same reason of getting ideas
16:00 sri rails and django have a history of picking shitty implementations when it comes to this stuff
16:01 sri one thread per websocket connection is still a thing in rails -.-
16:01 jberger which again leads to looking for a non-implementation-specific "standard"
16:05 sri sockjs might be the most widely implemented one
16:07 sri https://github.com/sockjs/websocket-multiplex
16:07 jberger is sockjs anything more than a websocket backcompat library?
16:08 sri it has informal extensions
16:08 jberger well, that is a very simple protocol
16:10 sri sounds like your goal is not having to write the js side :)
16:10 jberger that is part of it, yes
16:10 jberger it also makes interoperability possible
16:11 sri interoperability is always possible with a simple text protocol over websockets
16:11 jberger mojo isn't large enough in the broader framework community to drive javascript development (not yet at least)
16:11 sri lets face it, whatever you do it will be json over websockets
16:11 jberger right
16:11 jberger agreed
16:12 jberger wamp also implements msgpack over websocket as an optimization, but meh
16:13 jberger I actually like that multiplex doesn't really json though
16:13 jberger the payload can be whatever, but the protocol doesn't rely on even that
16:14 jberger so you can just split on the first three commas and the server doesn't have to parse any further
16:14 jberger just relay
16:14 jberger wamp claims that their ordering inside of the json array allows for that
16:14 jberger but then you end up writing a mini-json-parser that just does the head of the message
16:16 jberger also it differentiates an array of postitional arguments from a dict of keyword arguments and both can be sent in that order
16:16 jberger that is "language independent" but certainly tips its hand to one language in particular
16:18 jberger hmmm, I'm liking the sockjs thing
16:19 jberger it is really dead simple
16:20 jberger how much of sockjs needs to be implemented on the server side for the javascript library to be able to talk to it?
16:22 jberger because sockjs handles fallbacks the protocol looks like this: http://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html
16:22 jberger I guess it wouldn't be too hard to implement a look-alike multiplex in javascript
16:24 jberger looks a lot like socket.io but without the multiplexing actually
16:24 jberger lots of the same fallbacks etc
16:24 jberger (obviously)
16:27 sri you might also be too focused on the protocol
16:27 jberger it might seem that way
16:27 sri all the frameworks add a server side pub/sub layer
16:28 jberger I'm actually focused on trying to code something up if possible
16:28 sri so every message gets broadcasted across the cluster
16:28 jberger I was going to use pg backend at first
16:28 jberger then abstract away from it when that was working
16:29 jberger and because I already do something similar for Minion::Notifier I was actually starting to form an idea in my head for composable pubsub backing roles
16:29 sri honestly, i wouldn't even make the protocol public i suppose
16:29 jberger incidentally I was imaging the same three primatives as multiplex did
16:30 sri since, odds are frameworks will agree to a common one at some point
16:30 sri and you want to be able to switch protocols
16:31 sri or at least you'd want to be able to customize the protocol for new features that will pop up
16:32 jberger yeah
16:32 jberger nice that this doesn't use the sockjs protocol at all: https://github.com/sockjs/websocket-multiplex/blob/master/multiplex_client.js
16:33 jberger so we could actually just reuse that on the client side
16:49 jberger I didn't realize sockjs was a rabbitmq project
16:52 jberger hmmm, this doesn't look right: https://github.com/sockjs/websocket-multiplex/blob/master/multiplex_client.js#L33-L34
17:01 jberger oh the javascript default for join is comma
17:01 jberger argh
17:03 jberger wat?! string.split with a limit then throws away the rest of the string when the limit is hit?!
17:03 * jberger goes in a dark room to contemplate life choices
17:09 Sound joined #mojo
17:40 Sound So, I have a Mojo app behind nginx.  In the nginx log I have found some 502 responses (Bad gateway), with this debug error "upstream prematurely closed connection while reading response header from upstream". It looks like my Mojo app fails to return a response or dies, but nothing is written in the hypnotoad's log/production.log.  Do you have any hints on how to catch this?
17:42 bpmedley Sound: How often?  Does there appear to be a timing pattern?
17:44 Sound bpmedley: there's no timing pattern. It doesn't happen very often, and it always happens when handling a POST form upload which usually contains uploaded files. Some investigation in the logs makes me think the same input produces the same effect if the submit is retried in a few minutes
17:45 Sound bpmedley: so I can't exclude it depends from some exception thrown by my code when processing the request, but I'm surprised there's nothing logged
17:46 Sound Sadly I'm not able to reproduce this, but I get several complaints from users and I see evidence in the logs
17:47 PryMar56 joined #mojo
17:47 sri mojo version?
17:50 Sound sri: Mojolicious 6.46
17:50 sri upgrade, should be fixed already
17:50 Sound sri: so does it ring a bell about any particular bugs you might have fixed recently?
17:51 sri 6.60+
17:51 Sound sri: (in other words, shall I upgrade and continue investigating, or upgrade and consider this potentially fixed?)
17:51 Sound sri: I take it as a yes ;)
17:51 Sound sri: thank you!
17:53 Sound I guess you're referring to this bugfix in 6.60: "Fixed bug in Mojo::IOLoop where stopping gracefully would sometimes result in connections getting closed too early."
18:18 sri hahaha, the oled touch bar looks completely illogical in the mockups http://a.disquscdn.com/uploads/mediaembed/images/3733/2406/original.jpg
18:18 sri guess they might make esc and fn switch places
18:20 batman Oh man. Looks like a designer has gone crazy :(
18:21 sri the power button will prolly be a physical key with fingerprint reader
18:25 batman As long as it's physical :)
18:33 punter joined #mojo
18:43 odc joined #mojo
19:05 VVelox hmm...
19:06 VVelox when creating a mojo lite script, is it a bad practice to create subs in it for using in the helpers and else where?
19:06 VVelox Will that carry over nicely once I begin breaking it out?
19:07 batman VVelox: i often make subs in my lite apps.
19:07 batman once it gets too complicated, i just make a full app instead.
19:07 batman too complicated = when i thing i should factor out parts of the code into helper modules or controllers
19:08 VVelox yeah, I plan to eventually, but this is basically the first thing I've ever done in mojo, so just keeping it all as one for right now and fairly basic
19:09 batman VVelox: sounds like a plan :)
19:10 jberger VVelox: are you coming to Chicago.pm on thursday? you can discuss in person \o/
19:10 VVelox sure!
19:10 VVelox I've been to anti-socail lately, need to get out. :)
19:11 VVelox but yeah, remember that ffmpeg streaming stuff I was mucking with? starting to make use of it now :)
19:11 jabberwok i dislike Los Angeles. Maybe I'm just anti So.-Cal.
19:11 jberger right, I assumed that's what you were working on
19:11 jberger jabberwok: are you in SoCal?
19:11 batman VVelox: awesome! see you on thursday :)
19:12 VVelox Wooho! :)
19:12 jabberwok no, at home in a pun mood
19:12 jberger jabberwok: ah gotcha
19:13 jberger (man its like a Chicago.pm meeting right here in #mojo)
19:13 VVelox haha, yeah, this channel does have some fun overlap :)
19:14 * jabberwok raises glass to rainy saturdays when code starts working
19:15 jberger jabberwok: whatcha drinkin?
19:16 jabberwok R.C.
19:16 VVelox hmm... I miss Big Red
19:17 jberger I assume you mean Royal Crown not RC Cola
19:17 jberger though in Chicago it might be hard to know for sure
19:17 VVelox both are good
19:17 VVelox and even better combined
19:17 * batman drinks corona with lime :P
19:17 jabberwok =grin=
19:17 jberger RC Cola isn't a very good mixer IMO
19:18 jberger batman: a great drink for norway certainly
19:18 VVelox batman: Try it with lemon and cherry juice.
19:18 jberger VVelox: sounds interesting
19:18 jberger I'd try that at least
19:20 batman i only drink it when it's sunny
19:20 Adura joined #mojo
19:20 batman VVelox: i'll remember the cherry juice next time... sounds like there will be even less beer taste left then.
19:21 batman as if there's any in the original, haha
19:23 VVelox speaking of grenadine, it is really awesome in Guinness... only way I can finish a pint of the stuff is with a drop or two in it... otherwise each sip gets more and more bitter and the last bit at the bottom will be impossible to stomach
19:26 batman hehe
19:29 batman jberger: why is corona a great drink for norway..?
19:29 jberger because it is so tropical in norway
19:29 batman ah! yes. indeed
19:29 * jberger see's batman under a palm tree next to oslofjord
19:29 jberger s/'//
19:30 batman had 18C this night. not sure how warm it was during the day, but it's summer, summer, summertime! :)
19:30 batman *almost* too bad i'm leaving, hehe
19:39 VVelox Hmm.... with plugin Config and specifying a file, it loads the specified file, even if MOJO_CONFIG is specified?
19:41 batman VVelox: yup.
19:41 VVelox wait
19:42 VVelox yeah
19:42 VVelox sweet
19:42 batman i actually think that's a bit weird... but on the other hand, i've never bothered to specify the file, so... :)
19:47 VVelox Wooho! Now reading a config...
19:47 VVelox threw in a bit of logic to reverse it here
19:56 nicomen apparently my local pub (postkontoret) has run out of Mojo beer :-(
19:58 nicomen jberger: you guys have any of it? It's from Boulder, Colorado.
19:58 jberger I haven't seen
19:58 batman nicomen: oh my! i was there yesterday... didn't know they had mojo beer :/
19:59 nicomen well they don't anymore ;-/
19:59 jberger I miss that pork place in oslo
19:59 jberger oh man that was good
20:00 batman nicomen :(
20:00 nicomen Was that the small kebab at The crow?
20:00 batman jberger: where the meetup on friday was?
20:00 jberger yeah, that was it
20:00 batman :)
20:00 jberger we went there several times
20:01 sri that was great
20:01 batman i can't remember. the whole weekend was a complete blur :D
20:01 nicomen hehe
20:01 batman i only remember it was awesome
20:02 batman i will try my best to relax more *next* time
20:02 batman pretty sure i won't though :P
20:06 mishanti1 Mojoconf was great. :)
20:06 jberger another one will happen sometime
20:06 jberger there have been a few discussions privately
20:07 nicomen https://www.instagram.com/p/oT5aL7DQS5/?taken-by=nicomen79
20:07 batman jberger: sign me up! take my money! :)
20:07 jberger nicomen++
20:08 jberger nicomen: https://goo.gl/photos/DmeDbbDFz8AZGz236
20:08 jberger most of that is pictures of food or museums
20:09 jberger but there are a few conference pics
20:09 batman jberger: food+museums - was that on friday?
20:10 jberger it was the day sri arrived, whichever day that was
20:11 jberger https://goo.gl/photos/HU5TNZ9SaaQ3kQEF6 and https://goo.gl/photos/H8CGyEtwfFfnCab98 are probably my favorite
20:13 sri hahaha, i like the first
20:15 kaare joined #mojo
20:16 batman https://goo.gl/photos/HcpinS1JqaGx8hTDA
20:17 jberger batman++
20:17 jberger I never saw this album before
20:17 jberger I spent too much time during the conference taking it in, I didn't take enough pictures during
20:17 jberger I'm glad you did
20:17 jberger bjornfan did too, I know ... somewhere
20:18 mishanti1 He did take a lo of pictures yes.
20:18 asarch joined #mojo
20:21 batman yeah, i think one of the photos i have is stolen from him...
20:23 batman (at least)
20:24 batman one of the things i miss the most in js is negative indexes. like self.images[self.images.length - 1]) vs $self->{images}[-1];
22:16 jberger sri: this is just some initial tinkering: https://gist.github.com/jberger/df26d17143cb9baf78034d3ef7eb1d60
22:17 jberger the last helper (multiplex.pg.relay) is possibly just a route rather than a helper
22:17 jberger but it evolved like this
22:19 preaction jberger: why not just use a json array?
22:19 jberger rather than join with commas?
22:19 jberger https://github.com/sockjs/websocket-multiplex#protocol
23:00 inokenty joined #mojo
23:21 rgrinberg joined #mojo
23:38 dvinciguerra joined #mojo

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