00:00:36  <rphillips>creationix: https://pgp.mit.edu/pks/lookup?op=vindex&search=0x890FF26A14C0FB1B
00:00:39  <rphillips>my signature showed up
00:00:44  <creationix>awesome
00:00:47  <creationix>dinner time
00:00:57  <creationix>and the raspberry pi just finished
00:01:24  <creationix>https://github.com/luvit/luvi-binaries/commit/b8b66123d7a3f5e58cb05dca3254cc86cd7c4c43
00:01:33  <rphillips>nice!
00:03:40  * dan336quit (Quit: Leaving.)
00:09:35  * a_lequit (Remote host closed the connection)
00:10:00  * a_lejoined
00:10:35  * a_lequit (Read error: Connection reset by peer)
00:11:06  * a_lejoined
00:11:25  * a_lequit (Remote host closed the connection)
00:17:07  * a_lejoined
00:21:42  * a_lequit (Ping timeout: 244 seconds)
00:24:41  * a_lejoined
00:42:54  * UniOnquit (Remote host closed the connection)
01:14:13  * kazuponjoined
01:17:26  <rphillips>tls server support is another big ticket item
01:35:35  * kazuponquit (Remote host closed the connection)
01:56:26  * kazuponjoined
02:16:57  * a_lequit (Read error: Connection reset by peer)
02:24:15  * a__joined
02:32:50  * a_lejoined
02:35:50  * dan336joined
03:14:53  * kazuponquit (Ping timeout: 264 seconds)
03:17:27  * dan336quit (Quit: Leaving.)
03:20:29  * dan336joined
03:25:57  * kazuponjoined
03:58:49  * kazuponquit (Remote host closed the connection)
04:10:33  * a__quit (Ping timeout: 272 seconds)
04:10:46  * a__joined
04:21:34  * a__quit (Ping timeout: 250 seconds)
04:39:39  * kazuponjoined
06:09:00  * travis-cijoined
06:09:00  <travis-ci>luvit/luvi#179 (feat/add_zlib - 8e7f177 : Rob Emanuele): The build failed.
06:09:00  <travis-ci>Change view : https://github.com/luvit/luvi/compare/0c5d64e54643...8e7f177fbc35
06:09:00  <travis-ci>Build details : http://travis-ci.org/luvit/luvi/builds/42828736
06:09:00  * travis-cipart
06:12:04  * erlbot--quit (Ping timeout: 250 seconds)
06:13:19  * a__joined
06:32:57  * dan336quit (Quit: Leaving.)
06:33:41  * dan336joined
06:38:15  * dan336quit (Ping timeout: 258 seconds)
07:44:21  * DarkGodjoined
08:09:56  * DarkGodquit (Remote host closed the connection)
09:04:09  * erlbot--joined
09:26:18  * a__quit (Ping timeout: 264 seconds)
10:50:06  * dan336joined
10:56:10  * dan336quit (Quit: Leaving.)
11:09:54  * kazuponquit (Remote host closed the connection)
11:48:25  * erlbot--quit (Ping timeout: 255 seconds)
12:04:40  * erlbot--joined
12:13:40  * erlbot--quit (Ping timeout: 258 seconds)
12:17:27  * erlbot--joined
13:17:44  * erlbot--quit (Ping timeout: 244 seconds)
13:24:29  * erlbot--joined
13:47:18  * erlbot--quit (Ping timeout: 256 seconds)
13:53:02  * erlbot--joined
14:12:19  * creationixtopic: Lua + libUV + jiT = pure awesome-sauce | http://luvit.io | https://github.com/luvit/luvit | https://github.com/luvit/luv
14:23:51  * erlbot--quit (Ping timeout: 252 seconds)
14:38:16  * kazuponjoined
14:47:23  * songgaoquit (Ping timeout: 258 seconds)
14:49:13  * songgaojoined
15:04:35  * erlbot--joined
15:09:33  * dan336joined
15:41:15  <rphillips>https://github.com/CorsixTH/CorsixTH
15:41:22  * mattlgyjoined
15:41:27  <rphillips>somewhat nifty
15:41:31  <rphillips>uses a lot of lua
15:46:11  * a_lequit (Remote host closed the connection)
15:54:45  <creationix>neat
15:56:48  * KennethWilkejoined
15:58:53  <KennethWilke>howdy
15:59:10  <creationix>KennethWilke: hi
15:59:26  <KennethWilke>creationix: how's it goin?
15:59:38  <creationix>great, working hard on luvit 2.0
16:00:12  <KennethWilke>nice, i'm gonna start tinkering more with it today, though i'm still pretty new to lua
16:00:38  <creationix>the Programming In Lua book helped me a lot
16:00:41  <KennethWilke>writing parsers for that load balancer i was working on has been driving me up the wall
16:01:16  <KennethWilke>i really wanted to stick with pure C, but i don't think i can in the timeframe i want to get it written in
16:01:32  * a_lejoined
16:01:35  <rch>i've really wanted to make a parser combinator library for luvit like https://github.com/jneen/parsimmon
16:02:45  <KennethWilke>that does look pretty nice
16:03:22  <rch>i really like it
16:03:32  <creationix>rch: how does that compare to lpeg?
16:03:40  <rch>lpeg is very powerful and very efficient
16:03:43  <rch>and very awkward
16:03:52  <rch>and you have to statically link it in
16:04:21  <rch>so i like peg parsers but the ones which have you write in a separate syntax to define your grammar i like a bit less. lpeg is one of those.
16:04:56  <rch>mostly though it's that it's not a native lua library
16:05:30  <rch>the interface parsimmon exposes is very simple and nice to use and entirely pure javascript
16:05:30  <KennethWilke>the only one i've gotten very familiar with is flex/bison and something similar to those in python
16:05:42  <rch>KennethWilke: codegen, a whole different world
16:05:44  <KennethWilke>pylex or something
16:06:04  <KennethWilke>yeah
16:06:18  <rch>here's an example of an lpeg parser https://github.com/robert-chiniquy/languor/blob/master/lib/redis/languor.lua#L166
16:06:21  <KennethWilke>bah safari doesn't seem to have that lua book
16:06:40  <rch>you can find it online, 1s
16:06:46  <KennethWilke>ty
16:06:59  <KennethWilke>h derp
16:07:02  <KennethWilke>oh*
16:07:04  <KennethWilke>i was already there
16:07:05  <rch>http://www.lua.org/pil/contents.html
16:07:12  <rch>i think this is a few versions old
16:07:15  <rch>but still mostly true
16:07:16  <creationix>the first edition is free, it’s a little dated but not too bad
16:07:24  <KennethWilke>it'll probably do
16:07:29  <creationix>luajit is lua 5.1 with some 5.2 non-breaking changed added in
16:07:33  <creationix>the free book is lua 5.0
16:07:55  <KennethWilke>nice, what's the best place to ref docs for luvit?
16:08:03  <rch>nodejs.org ;p
16:08:09  <creationix>that would be on my todo list
16:08:13  <rch>heh
16:08:14  <dan336>hahaha
16:08:19  <KennethWilke>no worries, so the git repo for now? :p
16:08:21  <creationix>luv’s docs are docs.libuv.org and luvit’s docs are nodejs.org
16:08:59  <KennethWilke>yeah fortunately i've done a lot of tinkering with libuv in C so i imagine that'll be pretty easy to get used to
16:09:23  <dan336>I look at the tests sometimes too, that seems to be a good place if you like reading code.
16:09:31  <creationix>KennethWilke: is this for a new project or working on an existing luvit project?
16:09:44  <KennethWilke>this would be a new project
16:09:56  <KennethWilke>i just want a little redis proxy
16:10:05  <KennethWilke>that can do some small features beyond proxying
16:10:16  <dan336>like master dection?
16:10:22  <creationix>since you know libuv, raw luv might be useful
16:10:37  <creationix>or use the new luvit version and just use the “uv” module directly instead of the sugar we’re still implementing
16:10:48  <KennethWilke>not even that, i just want to like limit the command set that can be used via a proxy
16:11:07  <KennethWilke>so that web nodes can just do GET and SET, but admins can use the full command set on the redis server for whatever they need
16:11:17  <KennethWilke>without renaming commands or any of that kinda stuff
16:11:18  <rch>RBAC for redis
16:11:23  <KennethWilke>yeah kinda
16:11:43  <rch>interesting
16:11:51  <KennethWilke>additionally, if i could, i'd like to use unix sockets so i can grab UIDs and namespace operations based on the UID of the remote connection
16:12:39  <creationix>the luv tests are probably the best docs for the “uv” module currently https://github.com/luvit/luv/blob/master/tests/test-tcp.lua
16:12:48  <creationix>I really enjoy using it directly personally
16:13:28  <creationix>but if you use the new “luvi-up” version of luvit (soon to be 2.0) you get awesome pretty-printing, a repl, and node-like requires
16:13:30  <KennethWilke>whats the raw luv stuff?
16:13:41  <creationix>luv is lua bindings for libuv
16:14:06  <creationix>it’s the same API style as libuv
16:14:15  <creationix>but luvit is node.js in lua, so a lot of API sugar is needed to bridge the gap between libuv and node
16:14:28  <creationix>we’re still working on that bridge part, but luv itself is quite stable and done
16:14:38  * kazuponquit (Remote host closed the connection)
16:14:53  <creationix>the older stable version of luvit had it’s own C bindings to libuv directly for luvit
16:14:54  <KennethWilke>so luvit is more of that built upon event driven kinda model?
16:15:19  <KennethWilke>vs like a procedural lua intepreter?
16:15:20  <creationix>yeah, luvit is luv + node style APIs (event emitters, node streams, etc)
16:15:42  <creationix>though libuv itself is also callback based, so it’s not that different, just simpler
16:15:46  <rch>KennethWilke: luv is still async, if you don't call the event loop yourself nothing happens
16:16:01  <rch>KennethWilke: just a lot more like writing C against libuv
16:16:25  <KennethWilke>alrighty
16:16:54  <creationix>I started writing a package manager for luvit using luvit and my own style of async code. Here is my wrapping of the libuv fs functions to be coroutine friendly https://github.com/luvit/lit/blob/master/fs.lua
16:17:09  <KennethWilke>does the regular lua interpreter have a package manager?
16:17:19  <KennethWilke>i've not used it at all
16:17:34  <KennethWilke>i've only used lua when it was embedded in some other program
16:17:50  <creationix>lua itself doesn’t. The lua community has a few
16:17:55  <creationix>luarocks is fairly popular
16:18:32  <creationix>but luvit doesn’t have the same module resolution algorithm as stock lua, so it doesn’t always work
16:18:42  <creationix>I did add a fallback in the new version to support normal lua modules
16:19:19  <creationix>the lua community is extremely fragmented because of it’s heavy emphasis on embedding
16:19:21  <KennethWilke>hmm, i think for this project i'll try going the luvit route, seems interesting and y'all are pretty friendly i'd like to contribute if i could
16:19:36  <creationix>KennethWilke: awesome, let me know how to help
16:19:43  <rch>i still kind of think mix-n-matching modules from luvit and vanilla lua is a bad idea, reminds me of what happened in python with all the eventing frameworks
16:20:03  <rch>but i get it
16:20:10  <creationix>rch: that’s exactly why luvit 1.0 explicitly didn’t support loading from luarocks
16:20:33  <dan336>KennethWilke: so are you going to have the proxy speak the protocol that redis uses? or something else?
16:20:50  <KennethWilke>dan336, yar, the redis protocol
16:20:58  <KennethWilke>i'd like to make a generic or modular proxy
16:20:59  <creationix>sounds like fun
16:21:10  <KennethWilke>but i'd like to know what i'm doing a little bit more before getting that ambitious
16:21:14  <rch>i haven't actually gotten this to work but there's luvit redis parsing code in it https://github.com/tadeuszwojcik/luvit-redis
16:21:16  <creationix>I recommend writing the actual protocol parser in a way that doesn’t involve I/O
16:21:20  <rch>+1
16:21:23  <dan336>yeah
16:21:25  <rch>using a stream interface is one approach
16:22:22  <creationix>the new style proposed by imzyxwvu is working really nice for me now
16:22:34  <creationix>adapting that to a stream is pretty straightforward
16:22:39  <rch>i still haven't dug into that
16:22:40  <KennethWilke>not involving I/O i think is what i had in mind
16:22:58  <KennethWilke>trying to parse what i can as data comes in asynchronously, no blocking operations
16:23:08  <creationix>rch: the only part of his proposal that I’m using is the decoder part. But I’m really loving it
16:23:18  <KennethWilke>is that what you mean?
16:23:38  <dan336>rch: i have used that redis library quite a few times. I think there is a missing header file in the project though....
16:23:43  <creationix>right, the basic idea is to have a simple decoder function that reads the input till either it’s done parsing a unit or needs more data
16:23:51  <creationix>if it needs more data, it returns nil meaning it needs more data
16:23:59  <creationix>it will be called again and start over when there is more data
16:24:09  <KennethWilke>yeah that's what i want to build
16:24:10  <creationix>if it had enough, it returns the parsed value and the extra data
16:24:15  * a___joined
16:24:17  <creationix>(lua has multiple return values)
16:24:40  <KennethWilke>was trying to do that in C, but was trying to chain buffers in a linked list and made all these functions to manipulate the buffer chains as list and it just got crazy
16:24:56  <creationix>for years I wrote resumable statemachines, often working a character at a time, but I’m starting to learn this restart style is much simpler and actually faster in practice
16:25:19  <KennethWilke>it was fast because nothing was being copied around, and memory allocations were few, but it was getting way to complicated for the amount of time i want to spend on it
16:25:40  <creationix>lua doesn’t have buffer chains like V8, but string concat is usually fast enough for parsers.
16:26:10  <creationix>yep, it’s a great optimization technique, but even luajit never implemented it as far as I know
16:26:26  <KennethWilke>at this point i think concat will be performant enough for my own needs
16:26:45  <creationix>I think so. Your messages are pretty small and tcp chunks are bigish in a busy network
16:26:47  <KennethWilke>i was just trying to pull out every trick i could think of
16:26:52  <KennethWilke>lol
16:27:46  <creationix>for reference, here is my binary decoder for a protocol I invented a while back https://github.com/luvit/lit/blob/master/net-decoder.lua#L3-L69
16:27:53  <creationix>it works really well and is easy to read
16:28:40  <creationix>it’s a syncing protocol between two CAS databases (Content Addressable Storage)
16:30:40  <KennethWilke>yeah that'
16:30:43  <KennethWilke>s not too bad
16:32:07  <creationix>and there is only actually one concat in it’s usage. For the case where more data was needed and a new tcp chunk came in https://github.com/luvit/lit/blob/master/server.lua#L22
16:32:14  <creationix>the rest is just string reading and slicing
16:37:49  * a____joined
16:38:31  * a___quit (Ping timeout: 272 seconds)
16:44:52  * dan336quit (Quit: Leaving.)
16:45:23  * a____quit (Ping timeout: 252 seconds)
16:45:26  * a_____joined
16:45:29  * erlbot--quit (Ping timeout: 264 seconds)
16:48:49  <rphillips>my super simple agent works now: https://gist.github.com/rphillips/cd979a607a432694b291
16:48:50  <rphillips>3 tls connections
16:49:08  <rphillips>2.6 MB
16:53:49  <creationix>rphillips: awesome
16:54:01  * a____joined
16:54:25  * a_____quit (Ping timeout: 255 seconds)
16:54:28  <rphillips>i'm going to see how far virgo-base comes along, and get tls.createServer functional (no tls server support yet)
16:54:30  <creationix>I’m pushing a minor update to luvi to fix case in uv type constants
16:54:47  <creationix>rphillips: I’m trying to update luvit to the new luvi versions and I’m getting a hang in one of the TLS tests
16:55:11  <rphillips>creationix: probably the sigterm constant
16:55:30  <creationix>ok, I’ll look again. I did a global search for all-caps strings
16:57:41  * travis-cijoined
16:57:41  <travis-ci>luvit/luv#190 (master - 83d485e : Tim Caswell): The build passed.
16:57:41  <travis-ci>Change view : https://github.com/luvit/luv/compare/6c4bd1a3a5f7...83d485eae2b8
16:57:41  <travis-ci>Build details : http://travis-ci.org/luvit/luv/builds/42882432
16:57:41  * travis-cipart
16:58:39  <creationix>strange, works just fine with luvi v0.5.1
16:58:46  <creationix>that change shouldn’t have affected it I thought
16:59:24  * a____quit (Ping timeout: 256 seconds)
16:59:33  * a____joined
17:00:22  * travis-cijoined
17:00:22  <travis-ci>luvit/luvi#181 (master - 1287a05 : Tim Caswell): The build passed.
17:00:22  <travis-ci>Change view : https://github.com/luvit/luvi/compare/1d2d8d316d76...1287a0545f65
17:00:22  <travis-ci>Build details : http://travis-ci.org/luvit/luvi/builds/42882741
17:00:22  * travis-cipart
17:01:49  * KennethWilkequit (Read error: Connection reset by peer)
17:05:57  * a____quit (Ping timeout: 240 seconds)
17:07:10  * a____joined
17:07:32  <rphillips>it doesn't look like a relative require is working... require('./some-file')
17:07:51  <creationix>that’s strange
17:08:20  <creationix>I use it all the time, where is it failing?
17:10:03  <rphillips>in my the virgo-base directory...
17:10:15  * erlbot--joined
17:11:15  <creationix>is this inside a zip or a LUVI_APP bundle?
17:11:42  * a_____joined
17:12:18  * a____quit (Ping timeout: 244 seconds)
17:12:19  <rphillips>inside the zip
17:12:31  <rphillips>module.dir doesn't seem to be defined
17:12:33  * UniOnjoined
17:12:46  <rphillips>hmm
17:12:49  * dan336joined
17:13:15  <creationix>yeah that will break it, I wonder where the bug is
17:14:01  <rphillips>checking
17:16:33  * a_____quit (Ping timeout: 252 seconds)
17:20:00  * KennethWilkejoined
17:21:05  * a___joined
17:25:26  * kazuponjoined
17:25:47  * travis-cijoined
17:25:47  <travis-ci>luvit/luvit#1292 (update-luvi - 452a905 : Tim Caswell): The build passed.
17:25:47  <travis-ci>Change view : https://github.com/luvit/luvit/commit/452a90580b0e
17:25:47  <travis-ci>Build details : http://travis-ci.org/luvit/luvit/builds/42885804
17:25:47  * travis-cipart
17:27:22  <rch>rphillips: nice! (re: mini-agent)
17:29:58  * kazuponquit (Ping timeout: 255 seconds)
17:30:33  * a____joined
17:30:41  * a___quit (Ping timeout: 258 seconds)
17:33:07  * travis-cijoined
17:33:07  <travis-ci>luvit/luvit#1293 (update-luvi - dbe8d4d : Tim Caswell): The build passed.
17:33:07  <travis-ci>Change view : https://github.com/luvit/luvit/compare/452a90580b0e...dbe8d4da6c56
17:33:07  <travis-ci>Build details : http://travis-ci.org/luvit/luvit/builds/42886661
17:33:07  * travis-cipart
17:34:14  * a_____joined
17:35:17  * a____quit (Ping timeout: 264 seconds)
17:37:35  * travis-cijoined
17:37:35  <travis-ci>luvit/luvi#183 (master - cb76af3 : Tim Caswell): The build passed.
17:37:35  <travis-ci>Change view : https://github.com/luvit/luvi/compare/1287a0545f65...cb76af371535
17:37:35  <travis-ci>Build details : http://travis-ci.org/luvit/luvi/builds/42886943
17:37:35  * travis-cipart
17:38:12  <rphillips>got it working... my fault :/
17:39:26  <rphillips>creationix: must I prefix all the imports with bundle: ?
17:39:49  <creationix>where are you requireing from?
17:40:34  <rphillips>the executable where the zip is attached
17:43:07  * a_____quit (Ping timeout: 272 seconds)
17:45:11  <creationix>rphillips: so you mean from the repl?
17:45:35  <creationix>or from main.lua in the bundle?
17:45:45  <rphillips>the virgo-base executable... i'm running ./virgo-base to run the unit tests
17:46:12  <creationix>ok, so are the unit tests inside the zip too?
17:46:41  <rphillips>roger
17:47:18  <creationix>what requires the unit tests?
17:47:21  <creationix>main.lua?
17:49:13  <rphillips>correct
17:49:45  <creationix>that should work then since all the files live inside bundle, hmm
17:50:39  <rphillips>it works if I put bundle: ... is that required?
17:50:54  <creationix>that should only be required if the file calling require is outside the bundle
17:51:20  <creationix>the only implicit place to grab bundle files from the outside is via global modules in the bundle:/modules/ folder
17:51:32  <creationix>but from inside, local relative requries should work just fine
17:54:58  <rphillips>local Connection = require('virgo/connection')
17:55:36  <creationix>virgo is at “bundle:virgo” ?
17:55:42  <rphillips>virgo/connection.lua within the zip
17:55:47  <creationix>or “bundle:modules/virgo”
17:55:58  <rphillips>it's in the root
17:56:03  <rphillips> /virgo/connection
17:56:10  <creationix>ok, so from main it would be “./virgo/connection” then
17:56:24  <creationix>“virgo/connection” is not a relative require
17:57:13  <rphillips>so, if I move that into modules/ it'll work with just 'virgo/connection'
17:57:28  <rphillips>ah i see
17:59:27  <creationix>I wonder if we should make global requires also look in the local folder
18:00:19  <creationix>currently it’s considered local if is begins with “./“ or “../“
18:00:41  * a_____joined
18:04:02  * a_lequit (Ping timeout: 258 seconds)
18:08:57  * a_____quit (Ping timeout: 240 seconds)
18:09:04  * a_____joined
18:11:22  * travis-cijoined
18:11:22  <travis-ci>luvit/luvit#1295 (update-luvi - 3c57deb : Tim Caswell): The build passed.
18:11:22  <travis-ci>Change view : https://github.com/luvit/luvit/compare/dbe8d4da6c56...3c57deb94caf
18:11:22  <travis-ci>Build details : http://travis-ci.org/luvit/luvit/builds/42890797
18:11:22  * travis-cipart
18:17:55  * a_lejoined
18:21:49  * a___joined
18:22:03  * a_____quit (Ping timeout: 258 seconds)
18:25:43  <KennethWilke>i'm tinkering with the tcp echo server example, and getting this error: [string "bundle:modules/stream_readable.lua"]:616: attempt to index local 'dest' (a nil value)
18:27:03  <rphillips>we haven't gone through the examples yet
18:27:16  <rphillips>i suggest starting with the master branch
18:27:20  <KennethWilke>alrighty
18:27:26  <KennethWilke>yeah this was from the luvi-up branch
18:28:11  * a___quit (Ping timeout: 258 seconds)
18:28:15  * a____joined
18:30:25  <KennethWilke>rphillips: yeah it's looking fine on the master, ty
18:32:44  * a_____joined
18:33:09  * a____quit (Ping timeout: 272 seconds)
18:44:51  <rphillips>creationix: if I do this from main.lua, require('bundle:/unit-tests/entry').run() should all the requires within the run() not require 'bundle:'?
18:45:01  <rphillips>i'll make a test case
18:45:34  <creationix>no they shouldn’t. You shouldn’t even need bundle in main.lua
18:45:39  <creationix>I think it’s a bug, please send a test case
18:51:50  <rphillips>creationix: https://www.dropbox.com/s/rbutaavn5c3yueb/test-case.tar.gz?dl=0
18:52:07  <rphillips>osx luvi binary included
18:53:41  <creationix>got it, thanks
18:53:46  <creationix>so that’s luvit’s require.lua right?
18:53:54  <rphillips>correct
18:55:45  * erlbot--quit (Ping timeout: 245 seconds)
18:56:39  <creationix>rphillips: fixed it https://gist.github.com/creationix/81d6df3dca8cb96eb1a5
18:56:44  <creationix>sorry if I confused you
18:57:13  <rphillips>going to try one more thing
18:57:39  <rphillips>oh interesting... the lua extension is required
18:57:56  <creationix>oh, ignore that part
18:58:09  <creationix>works without the extension
18:58:17  <rphillips>gotcha
19:00:20  <rphillips>int('hello world')
19:00:20  <rphillips> |+ modules/ |
19:00:20  <rphillips> | main.lua |require('./secondary')
19:00:39  <rphillips>bad paste
19:01:01  <rphillips>creationix: is the require('./secondary') intended to be that way? if I do require('secondary') within the testing.lua file
19:01:06  <rphillips>the ./ is required
19:01:24  <creationix>./ is required for relative requires
19:02:00  * dan336quit (Quit: Leaving.)
19:02:03  <rphillips>so the search path is only in modules/ right?
19:02:12  <rphillips>require('secondary') would need to be in modules/
19:02:16  <creationix>right
19:02:26  <rphillips>k. that was a bit confusing
19:02:32  <creationix>paths inside the bundle work exactly like outside the bundle
19:02:57  <creationix>the only special thing is if a module isn’t found outside the bundle, it will look inside bundle:modules
19:03:49  <creationix>(but only for non-relative requires)
19:03:58  * travis-cijoined
19:03:58  <travis-ci>luvit/luvi#184 (feat/add_zlib - 2216e72 : Rob Emanuele): The build is still failing.
19:03:58  <travis-ci>Change view : https://github.com/luvit/luvi/compare/8e7f177fbc35...2216e7228426
19:03:58  <travis-ci>Build details : http://travis-ci.org/luvit/luvi/builds/42896446
19:03:58  * travis-cipart
19:08:19  * a_lequit (Read error: Connection reset by peer)
19:08:46  * a_lejoined
19:11:45  <creationix>rje: on your pr, travis sees: “/home/travis/build/luvit/luvi/src/main.c:27:1: error: duplicate ‘extern’”
19:11:53  <creationix>I wonder if miniz is conflicting with zlib
19:12:13  <creationix>I include miniz.c indirectly from main.c
19:12:26  <creationix>https://travis-ci.org/luvit/luvi/jobs/42896448#L342
19:18:32  <rje>creationix: hmmm, i wonder why i don't see that on osx
19:18:40  * erlbot--joined
19:18:40  * erlbot--quit (Excess Flood)
19:18:48  <creationix>that’s strange
19:19:02  * erlbot--joined
19:38:25  <rch>"paths inside the bundle work exactly like outside the bundle" <—— does this mean the bundle is treated as the same as cwd ?
19:40:39  <creationix>this means “./foo” from “bundle:bar/baz/” will resolve to “bundle:bar/foo”
19:41:02  <rch>not "bundle:bar/baz/foo" ?
19:41:14  <creationix>and from “fs:/home/tim/bar/baz” will resolve to “fs:/home/tim/bar/foo”
19:41:24  <creationix>sorry, I didn’t mean to include the trailing slash
19:41:29  <rch>ohhhhh got it
19:42:10  <rch>so let's say i have a binary with a bundle and i do like $ ./rch-binary foo.lua
19:42:31  <rch>can foo.lua require() from inside the bundle? actually is this an intended use case in general for a binary with a bundle or will it always just load main.lua or something?
19:42:49  <creationix>that depends on how you setup require
19:42:55  <rch>heh
19:42:58  <creationix>remember that luvit’s require is not part of luvi
19:43:01  <rch>right, brave new world
19:43:02  <rch>yup
19:43:32  <creationix>but proper usage of luvit’s require module is to create a new require with the full path to the file being executed as the extra arg
19:43:46  <rch>so luvit 2 is a luvi binary and the core modules will be in the luvit bundle right, enabling me to require() them from rch.lua
19:43:48  <rch>hmmm
19:43:51  <creationix>so a require in foo.lua would be relative to cwd + foo.lua
19:44:42  <rch>but i'd be able to require('stream') and it will use "bundle:modules" which is where the core libraries live?
19:47:03  <creationix>right, the only implicit way that bundle files get required from non-bundle files is when it’s non-relative and isn’t found on the outside
19:47:20  <creationix>it will look in ./modules/foo, ../modules/foo, all the way down to /modules/foo
19:47:32  <creationix>then it will look in bundle:modules/foo
19:47:47  <creationix>that’s why all luvit built-ins live in bundle:modules
19:54:35  <rch>cool
20:05:44  <creationix>I think it’s time to add binary module support to luvi. I think some combination of uv_dlopen and uv_fs_mkdtemp
20:06:11  <rphillips>+1
20:06:15  <rphillips>should work
20:06:27  <creationix>too bad libuv doesn’t have mkstemp
20:06:47  <rphillips>though, i wonder if virus scanners think that is evil
20:06:52  <creationix>but I can try creating the temp directory, dumping the .so, dl-open it and delete it
20:09:09  <creationix>main issue is it won’t work on systems without a writable tmp filesystem
20:12:58  <rphillips>we need a logging module
20:13:09  <rphillips>virgo gave us a logging module
20:13:38  <rphillips>man, so much to do
20:13:59  <rphillips>it would be nice to keep the same api
20:14:35  <rch>i would worry about virus scanners too
20:14:42  <rch>but not sure what the alternative is
20:16:18  <rphillips>luckily, unix shouldn't be an issue
20:16:18  <rphillips>who runs a virus scanner on their linux box :)
20:17:20  <rch>can we make binary module support a luvi plugin somehow? so it is possible to make luvi/luvit binaries without it
20:18:41  <rch>virgo-upgrade-service.lib.entry: error {"err":{"error":{"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect"}}}
20:18:52  <rch>^ do i need to rebuild my vm to get etcd somehow? it runs under init or something?
20:19:00  <rch>whoops wrong channel x.x sorry
20:21:36  <creationix>rch: sure, it can be left out of the tiny build if it ends up being a problem. It won’t be enough code to worry about it’s size
20:21:40  <creationix>I expect about 10 lines of C
20:22:13  <rch>=]
20:22:14  <creationix>and luajit already makes calls to dlopen to trigger over sensitive security scanners
20:24:40  * dan336joined
20:32:28  * phorejoined
20:40:36  * travis-cijoined
20:40:36  <travis-ci>luvit/luvit#1297 (luvi-up - 05c6ef1 : Tim Caswell): The build passed.
20:40:36  <travis-ci>Change view : https://github.com/luvit/luvit/compare/7d7a3287c48c...05c6ef170711
20:40:36  <travis-ci>Build details : http://travis-ci.org/luvit/luvit/builds/42907543
20:40:36  * travis-cipart
20:41:22  <creationix>rch: Assuming I can load dynamic libraries out of the zip, how do we want to handle binary dependencies for the various platforms in a single source tree
20:42:14  <creationix>I’m thinking maybe submodules containing binaries for the supported platforms and then the bundler being smart enough to grab the correct one?
20:42:48  <creationix>and if a file doesn’t exist when searching, try adding a platform specefic suffix
20:43:03  * erlbot--quit (Remote host closed the connection)
20:43:12  * erlbot--joined
20:44:30  <creationix>Looking for “gamepad” would first check for “gamepad.luvit”, but if it’s not there, look for “gamepad.dll” on windows or “gamepad.darwin.so” on osx, “gamepad.linux-x64.so” on linux, etc
21:04:39  <rphillips>hmm. that might work well
21:33:11  <KennethWilke>i'm messing with the tcp echo server example. how do i go about setting a callback for reads as they come in from the client?
21:36:34  <KennethWilke>i'm thinking i use readStart for that in some way
21:46:09  <KennethWilke>ah nvm, i think i found what i'm looking for
21:51:03  <creationix>this seems to work https://gist.github.com/creationix/804045fd48aa6374a74a
21:51:41  <creationix>then you can require .so files in any luvi bundle
21:52:53  * dan336quit (Ping timeout: 258 seconds)
21:53:38  * dan336joined
21:55:41  <KennethWilke>i'm realizing now why it was suggested i look at the nodejs docs :p
21:56:30  <creationix>KennethWilke: I see you went with using the node-like sugar layer
21:56:44  <KennethWilke>oh that wasn't intentional
21:56:56  <KennethWilke>i just saw something in the tests that i could run with lol
21:57:05  <creationix>luvit’s tests or luv’s tests?
21:57:10  <KennethWilke>luvits
21:57:18  <creationix>there are examples in luv’s tests that only use the libuv APIs is you already know those
21:57:25  <KennethWilke>at this point node-like sugar doesn't do me any good since i've used luvit now more than node
21:57:26  <creationix>but it is lower level, just less to learn
21:57:50  <creationix>https://github.com/luvit/luv/blob/master/tests/test-tcp.lua
21:58:12  <creationix>luv has two syntaxes, one is C style where you pass in the context as the first argument, the other is using lua’s : trick
21:58:30  <creationix>the last two tests in this file are identical, just different syntax
21:59:09  <creationix>and you can ignore the expect() and most the assert() stuff, that’s for the unit test
22:00:10  <KennethWilke>ahh alrighty
22:01:49  <rch>creationix: interesting. hard problem to solve, i don't have a brilliant idea for binary deps
22:02:49  <KennethWilke>so i'd pass a callback to the socket:read_start() right?
22:02:58  <creationix>right
22:03:24  <creationix>here is my sync server https://github.com/luvit/lit/blob/master/server.lua
22:03:58  <KennethWilke>oooo okay
22:04:04  <creationix>I have the protocol logic in decoder
22:04:09  <KennethWilke>i see what i'm doing wrong then, the way i kicked off the server is node style
22:04:19  <KennethWilke>so i don't have that method defined on this client object
22:05:07  <KennethWilke>this example is a lot more like what i'm accustomed to
22:05:22  <creationix>https://github.com/luvit/lit/blob/master/server.lua#L14-L53 shows how to wrap a bare uv_tcp_t with full backpressure and a decoder
22:05:45  <creationix>the actual logic is in a blocking coroutine with sync I/O https://github.com/luvit/lit/blob/master/server.lua#L59-L64
22:05:48  <KennethWilke>that lexical scoping thing lua does is pretty great for this use
22:06:00  <creationix>yep
22:06:16  <creationix>I prefer using luv directly since I know the libuv API
22:06:18  <KennethWilke>https://github.com/luvit/lit/blob/master/server.lua#L46 whats the hash doing here?
22:06:31  <creationix>hash means length
22:06:36  <KennethWilke>ahhhh alrighty
22:06:39  <creationix>it’s a lua thing
22:07:03  <KennethWilke>trying to take note of the lua things, i went through a good bit of that book you suggested
22:07:17  <KennethWilke>and i'm glad i did because i wouldn't have expected 0 to be true
22:07:39  <creationix>or lists be 1 indexed
22:07:40  <rch>KennethWilke: https://github.com/luvit/luvit/wiki/node-to-luvit-gotchas <—— may help or may be something you can add stuff to
22:07:44  <KennethWilke>yeah that too
22:08:20  <KennethWilke>ahh but i dunno jack about node, other than i love libuv and it uses it
22:08:25  <creationix>rch: ohh, module and module.exports now work in luvit 2.0 :)
22:08:47  <creationix>javascript is closer to C in syntax than lua is
22:08:49  <rch>creationix: innnnnteresting wait does that mean recursive requires work too
22:08:56  <creationix>rch: yep
22:09:02  <rch>KennethWilke: aha maybe you want to do "lua for libuv covers" wiki page then
22:09:04  <rch>creationix: woohoo!
22:09:05  <creationix>I fixed that weeks ago
22:09:07  <KennethWilke>yeah i've written plenty of javascript, just not in the context of node
22:09:19  <rch>s/covers/coders/
22:09:22  <KennethWilke>more in the context of those dirty browsers
22:09:28  <KennethWilke>and necessary evils
22:09:50  <creationix>lua + libuv is a really nice combo, I enjoy it
22:10:07  <creationix>the luvit sugar is more for people coming from node who need something not to memory hungry
22:10:09  <KennethWilke>it seems pretty nice to me so far
22:10:30  <rch>i like the node/luvit api in most places
22:10:35  <rch>give me the native uv stuff for when i need it and i'm good
22:10:47  <creationix>yep, both are in luvit now
22:11:42  <KennethWilke>luv by itself is a lib for things with a lua interpreter right?
22:12:11  <KennethWilke>a lua lib or module
22:12:11  <creationix>rch: https://github.com/luvit/luvit/blob/luvi-up/tests/test-require.lua#L123-L131
22:12:22  <creationix>KennethWilke: right, luv is just bindings to libuv using the lua C API
22:12:29  <creationix>works with luajit, luvit, normal lua, etc
22:13:03  <creationix>luvi bakes it into luajit and adds a nice way to build without a C compiler, and luvit is a better module system + lots of node sugar
22:13:43  <rch>creationix: nice, thanks
22:13:59  <KennethWilke>the better module system aspect there makes me want to stick with luvit for what i'm doing
22:14:17  <creationix>right, use luvit, but you don’t have to use the sugar
22:14:24  <creationix>just require “uv” instead of “net” to create a TCP server
22:14:38  <KennethWilke>that sounds good
22:14:40  <creationix>net comes with node style streams, automatic timeout and all sorts of other stuff
22:14:50  <rch>i wish you could do that in node too ;p but they remove uv_native from the userspace runtime
22:14:59  <creationix>I
22:15:09  <creationix>I’m trying to talk iojs into splitting node like we did
22:15:16  <rch>that would be so dope
22:15:23  <creationix>libuv.js would be the node version of luv
22:15:48  <rch>major refactor though when they already have enough on their hands
22:15:56  <KennethWilke>so what about the package management stuff, luvit has this or it's being worked on?
22:16:20  <creationix>worked on
22:16:27  <rch>KennethWilke: most people use git submodules or npm for now but creationix has a thing coming
22:17:00  <KennethWilke>that's one of the things that got me really liking python
22:17:02  <KennethWilke>dat pip
22:17:11  <rch>sorry i can't sympathise i am very unhappy with pip
22:17:21  <KennethWilke>well i used to use cpan with perl
22:17:24  <rch>heh
22:17:24  <KennethWilke>so pip seems fantastic
22:17:27  <rch>cool
22:17:30  <KennethWilke>and the ruby one...
22:17:31  <KennethWilke>blech
22:17:57  <KennethWilke>gems or whatever they are
22:18:36  <creationix>npm for node is pretty nice
22:18:59  <creationix>I hope mine will be even better, I’ve learned a lot over the last 5 years working on node
22:18:59  <KennethWilke>yeah our UI people are using node so i've used npm to get deps on our webheads and stuff
22:19:14  <creationix>some parts of npm really rub me raw
22:19:37  <KennethWilke>i've seen it do screwy things with dependency handling
22:19:46  <KennethWilke>but to be fair i've has similar issues in perl and python too
22:20:50  <KennethWilke>i'd be interested in helping out with luvit's package manager as i gain enough knowledge to be useful/dangerous
22:21:13  <rch>https://github.com/luvit/lit
22:21:37  <creationix>lit is still pretty early, I only spent a couple days on it
22:21:53  <KennethWilke>yeah i'm still pretty early too ;p
22:22:10  <creationix>but the idea is your machine will have a local database that syncs down just the packages you’re interested in from some remote repo
22:22:22  <creationix>storage will be much like a git repo’s internals using content addressable storage
22:22:41  <creationix>this way duplicate files across any versions or packages will be only downloaded or stored once
22:22:58  <creationix>and names/versions will just be bookmarks into this graph
22:23:06  <rch>like, symlinks?
22:23:13  <KennethWilke>that sounds good, i dunno if i have skills that'd be beneficial for the early part of that process, but i'd certaining be interesting in authoring some libraries that can be distributed through it
22:23:23  <creationix>no, content addressable means the key is a hash of the actual value
22:23:24  <KennethWilke>certainly* rather
22:23:59  <rch>right but i meant mechanically when i require a given thing in a package that needs version 1.0.0 how does require resolve this? is the package i need in my local modules dir?
22:23:59  <creationix>the key “is” the data, just highly compressed to a 20 byte hash that can only be “decompressed” with a database that contains the full value
22:24:35  <creationix>rch: so I have to ideas, one is to just export a tree form the graph to the filesystem in the project’s modules folder
22:24:50  <creationix>symlinks won’t help since the objects are deflated on disk or stored in leveldb or soemthing
22:25:06  <creationix>another idea is to enable luvit to require directly out of the local database
22:25:14  <rch>ah i think i like the first model better
22:25:27  <creationix>I’ll do the first for sure since it’s what people are used to
22:25:35  <rch>but a luvit require module to support the second option would be cool in some circumstances
22:25:36  <creationix>but I plan on added the second style for people who prefer that
22:25:45  <rch>yeah i think the first one seems more initially appealling because it doesn't lock you in
22:26:06  <creationix>my wheaty platform (js-git/node) serves web app directly from local git repos
22:26:13  <creationix>even bare repos,
22:26:28  <creationix>it can even serve from remote repos. It just caches stuff locally so it’s fast and works when offline
22:27:05  <creationix>try it, `npm install -g wheaty` and then `wheaty git://github.com/creationix/howtonode.org.git`
22:27:11  <creationix>I think that’s the command
22:27:27  <creationix>needs node 0.11.x installed to /usr/local/bin I think though
22:29:23  <KennethWilke>regarding the libuv like uv module vs the node like net module; which route would you guys suggest going with?
22:29:45  <KennethWilke>if the net module adds a good bit of useful functionality i'd consider using it
22:29:55  <rch>KennethWilke: the luvit stuff will have a simpler interface and make 90% of the stuff you do a lot more succinct
22:30:03  <rch>KennethWilke: it is basically the most common use cases built on top of the luv stuff
22:30:21  <KennethWilke>yeah it seems like that
22:30:22  <rch>KennethWilke: kind of depends on if you want a C-like development experience or you want a higher level one
22:30:34  <rch>KennethWilke: but i am biased because i like luvit/node
22:31:09  <KennethWilke>i always like the level of control the C-like route provides, but if the abstractions are done well and hit a lot of things that aren't worth doing myself it seems like a good choice
22:31:13  <creationix>I prefer the libuv style and I created luvit
22:31:24  <rch>creationix: heh yes
22:31:32  <rch>creationix: there are so many reasons why that makes sense
22:31:37  <rch>to build luvit you need to be a libuv expert
22:31:42  <KennethWilke>lol
22:31:45  <rch>you love coroutines and other flow control methods
22:31:57  <KennethWilke>as a crazu person who loves C, libuv is one of the best libs i've used for sure
22:31:59  <rch>you love experimenting so a more flexible tool is worth more
22:32:05  <creationix>dinner time, wife is calling me
22:32:11  <rch>see ya
22:32:55  <creationix>good luck KennethWilke. Feel free to steal any ideas from lit’s code. It’s the closest thing existing to what you’re writing
22:33:18  <KennethWilke>creationix, ty! i'll be sure to bug you some more too :p
22:36:12  <KennethWilke>and now i can add lua to my repertoire of languages, having flashbacks to all the crap that had a lua interpret that i was just confused by
22:40:04  * erlbot--quit (Ping timeout: 250 seconds)
22:40:26  <KennethWilke>is there a way to see what methods are attached to an object in lua?
22:40:58  <KennethWilke>i tried 'for i in pairs(object) do print(i) end' but it only seems to give me object members not methods
22:45:20  <KennethWilke>ah nvm i found some crazy function that'll do what i'm lookin for
23:15:44  <bjorn>for i in pairs(getmetatable(object).__index) do print(i) end
23:17:39  <KennethWilke>yeah i found http://stackoverflow.com/questions/5636596/how-to-find-out-all-properties-of-an-object-in-lua
23:18:00  <KennethWilke>gave a nice example of where that stuff hides
23:19:48  * mattlgyquit (Remote host closed the connection)
23:22:42  * a__joined
23:22:51  * a_____quit (Ping timeout: 252 seconds)
23:27:53  * dan336part
23:28:02  * dan336joined
23:43:02  * KennethWilkequit (Quit: Leaving)