00:43:24  * creationix_joined
03:23:17  * creationix_quit (Ping timeout: 260 seconds)
04:04:09  * creationix_joined
05:31:56  * creationix_quit (Quit: ZNC - http://znc.in)
06:58:08  * ^vjoined
07:18:17  * mmickopart ("Leaving")
07:41:17  * rendarjoined
07:57:43  * creationix_joined
08:01:06  * CapsAdminjoined
08:20:31  * jacksonpanjoined
12:53:40  * jacksonpanquit (Ping timeout: 276 seconds)
13:40:06  <SinisterRectus>creationix: i learned that libuv has a buffer type, can this be exposed instead of a custom type? http://docs.libuv.org/en/v1.x/misc.html#c.uv_buf_t
13:40:35  <creationix>sure, it's got the pointer indirection, but that's not too expensive
13:40:48  <creationix>and allows for resizing or pointing to existing chunks of memory
13:41:52  <creationix>(but again, if you want to point to your cdata instances, you'll need to ensure they don't get garbage collected before the userdata pointing to them does or bad things will happen)
13:42:59  <SinisterRectus>hmm
13:43:11  <creationix>copy be default it probably sanest for now
13:43:37  <SinisterRectus>i think the luajit docs warn against that too
13:43:39  <creationix>also I just realized the indirection can't be helped if I'll have to convert everything to this format to pass to libuv functions anyway
13:45:40  <SinisterRectus>"All explicitly (ffi.new(), ffi.cast() etc.) or implicitly (accessors) created cdata objects are garbage collected. You need to ensure to retain valid references to cdata objects somewhere on a Lua stack, an upvalue or in a Lua table while they are still in use."
13:50:25  <creationix>but using the built-in buffer type in luv is a great idea
13:50:31  <creationix>it even fits the project's scope
13:56:51  <creationix>going through the source, `uv_buf_t` is only used in stream.c, udp.c, and fs.c. Which makes sense, those are the parts that deal with binary data
13:57:02  <SinisterRectus>yep
13:57:06  <creationix>it shouldn't be too hard to add a new buffer type to luv and support it in all those
13:57:29  <creationix>we can almost even return it by default if we allow `tostring` on the buffer
13:57:48  <creationix>I just worry about people using colon methods on the strings
13:57:57  <creationix>`data:match(...)` will fail if data isn't a string
13:58:16  <creationix>but `string.match(data, ...)` might work if the string function tries to `tostring` the value
13:58:20  <SinisterRectus>unless you set the metatable.__index to string
13:58:36  <creationix>true, we could do that, but seems wonky
13:58:50  <creationix>also I'm not sure the string functions coerce their inputs. Lua isn't as coerce happy as JS
13:58:52  <SinisterRectus>would that work out of the box though. i wouldn't expect lua to coerce it to a string
13:58:56  <SinisterRectus>haha
13:59:57  <creationix>well, we definitely at least want a `:tostring` on the buffer
14:00:11  <SinisterRectus>for sure
14:00:35  <creationix>or rather, the `__tostring` metamethod
14:00:45  <SinisterRectus>yes that
14:02:17  <SinisterRectus>what about dereferencing it
14:02:41  <SinisterRectus>or indexing
14:02:45  <SinisterRectus>whichever is the appropriate term
14:27:14  <creationix>might be slow, hmm
14:27:29  <creationix>__index and __newindex would be the lua hooks
14:28:01  <creationix>that's one thing I like about uint8_t cdata, indexing is very fast
14:39:58  * jacksonpanjoined
15:16:29  * SkyRocknRolljoined
15:25:51  * SkyRocknRoll_joined
15:26:50  * SkyRocknRollquit (Ping timeout: 268 seconds)
15:54:28  * jacksonpanquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:00:22  * Andols_joined
17:30:08  * creationix_quit (Read error: Connection reset by peer)
17:43:43  * Andols_changed nick to Andols
18:05:52  * rendarquit (Quit: std::lower_bound + std::less_equal *works* with a vector without duplicates!)
19:10:37  * Soniquit (Ping timeout: 240 seconds)
19:12:39  * Sonijoined
20:43:17  * Andolsquit
20:55:44  * SkyRocknRoll_quit (Remote host closed the connection)