00:26:04  * Haragethjoined
00:30:37  * Haragethquit (Ping timeout: 260 seconds)
00:38:49  * |oo|quit (Ping timeout: 252 seconds)
00:38:49  * Xequit (Ping timeout: 252 seconds)
00:39:14  <konobi>creationix: check out Coat at all?
00:39:23  * songgaoquit (Ping timeout: 252 seconds)
00:39:26  <creationix>Coat?
00:39:44  <konobi>http://fperrad.github.io/lua-Coat/
00:39:53  <daurnimator>.green? how is that a TLD.
00:39:55  <daurnimator>sigh
00:40:47  <konobi>daurnimator: don't forget .prod and .dev are gTLDs now too
00:40:48  <daurnimator>creationix: hooray, tailcalls :)
00:40:57  <daurnimator>konobi: how... stupid
00:41:15  <konobi>google picked those ones up
00:43:18  <konobi>creationix: it's pretty cute... but the real power comes in from Roles and the ability to safely compose
00:46:01  * Xejoined
00:48:08  * |oo|joined
00:48:58  <daurnimator>konobi: :( so many globals.
00:49:25  <konobi>daurnimator: well, i think they should be scoped
00:49:33  <daurnimator>agreed. but they're not :P
00:51:05  <konobi>daurnimator: would be easy enough to do
00:51:58  <konobi>moose has better syntactic sugar though... wouldn't be too hard to fix that up
00:52:08  <konobi>the bulk of the work is all in the meta classes anyway
00:55:56  <daurnimator>konobi: for now at least, lua-Coat doesn't solve any issues I have.
01:30:41  <konobi>daurnimator: yeah... takes some time to get used to working with it.
01:31:43  <daurnimator>konobi: I suppose I just don't see the point
01:32:02  <daurnimator>i've never met a situation that I can't solve with a simple metatable with an __index.
01:34:09  <SinisterRectus>i just drop this where ever i need classes http://pastie.org/private/cyu67asy1fw3kuebnhca
01:38:57  <daurnimator>why so complex?
01:39:09  <SinisterRectus>lol
01:39:22  <SinisterRectus>and i thought it was simple
01:39:25  <daurnimator>this is what I do: https://github.com/daurnimator/lua-http/blob/master/http/headers.lua#L59
01:40:15  * songgaojoined
01:40:16  <SinisterRectus>i like a class declaration and callable classes
01:41:02  <daurnimator>SinisterRectus: I don't ;) too 'magic' for my liking.
01:41:23  <daurnimator>I like seeing everything laid bare; cause you know exactly what the code is doing and how to debug it
01:42:06  <SinisterRectus>well, there aren't too many surprises with MyClass = class('MyClass'); obj = MyClass()
01:42:59  <SinisterRectus>also inheritance
01:43:10  <daurnimator>SinisterRectus: well first off I question the inheritence chain: if I add something to the base class will it be added to a derived class?
01:43:31  <daurnimator>i.e. is it a 'copy class' constructor?
01:44:00  <daurnimator>and the answer to that also has performance implications
01:44:00  <SinisterRectus>no it won't retroactively apply
01:44:16  <SinisterRectus>wait
01:44:19  <SinisterRectus>hang on let me check
01:44:22  <daurnimator>SinisterRectus: so I can't debug a derived class by adding things to the parent?
01:44:23  <SinisterRectus>i don't think i've even tried this
01:44:30  <konobi>daurnimator: proper non-diamond multiple inheritance for one.
01:44:47  <daurnimator>konobi: IMO if you have multiple inheritence you messed up :P
01:45:11  <daurnimator>(I've never encountered multiple inheritence in a place I didn't want to already refactor)
01:46:10  <konobi>having proper MRO makes multiple inheritance much more feasible, since you have compile time guarantees
01:46:46  <daurnimator>konobi: compile time? we're talking about lua here.
01:48:10  <konobi>daurnimator: well, i mean "compile" time as in the interpreters compile phase before execution
01:48:17  <SinisterRectus>daurnimator: you're correct, you have to define the function in the base class before the object is initialized
01:48:47  <daurnimator>SinisterRectus: no you don't.... I just read through the code
01:48:50  <konobi>ie: if you ask for an invalid or uncertain method ordering, it'll bail straight away
01:49:00  <daurnimator>oh wait, sorry you do.
01:49:00  <SinisterRectus>:/
01:49:26  <SinisterRectus>i don't find that to be an issue though, outside of debugging
01:49:27  <daurnimator>SinisterRectus: this is the type of thing I *don't* like do when debugging a production issue :P simple = better.
01:50:01  <SinisterRectus>well everyone is going to have their own opinion, but i don't see the need to add a feature just for the purposes of debugging, if the end user doesn't need it
01:50:20  <SinisterRectus>i'd happily define a debug function before i need it
01:50:31  <daurnimator>SinisterRectus: btw, you don't inherit metamethods?
01:50:39  <daurnimator>SinisterRectus: also, watch out for inheriting from a class with a __pairs....
01:50:53  <SinisterRectus>no, i kept it simple
01:51:07  <daurnimator>SinisterRectus: other misc advice: add a mt.__name field. lua uses it for some error messages :)
01:51:16  <daurnimator>oh sorry, you already did.
01:51:21  <daurnimator>man I'm blind today....
01:51:23  <SinisterRectus>lol
01:51:32  <konobi>creationix: did you have any luck with static compilation?
01:51:40  <SinisterRectus>you can defiine metamethods though like Class:__tostring()
01:51:43  <SinisterRectus>and that will be inherited
01:52:06  <SinisterRectus>unless that's what you're asking
01:52:28  <daurnimator>SinisterRectus: okay, one thing though: `function(...) local bases = {...}; local name = table.remove(bases, 1)` <-- that's bad/weird. instead do: `function(name, ...) local bases = {...}`
01:52:51  <SinisterRectus>ooh yeah that was left over from when i had optional naming
01:52:59  <SinisterRectus>thanks
01:53:15  <daurnimator>SinisterRectus: and then you can move the assert up :)
01:53:57  <SinisterRectus>tbh i modeled this after luabind's class behavior
01:54:29  <SinisterRectus>http://www.rasterbar.com/products/luabind/docs.html#defining-classes-in-lua
01:54:33  <SinisterRectus>not that i know any C++
01:55:33  <SinisterRectus>so you have to initialize the base object, too
01:55:43  <SinisterRectus>it doesn't do it automatically like i believe middleclass does
01:56:11  <SinisterRectus>well, not initialize the object, but call it's __init
01:56:14  <SinisterRectus>its*
01:58:47  <SinisterRectus>anyway, back to work
02:00:55  <daurnimator>SinisterRectus: you could probably share the metatable for the classes themselves.
02:02:29  <SinisterRectus>hmm probably
02:03:47  <daurnimator>SinisterRectus: and the reason I mentioned __name is that your *classes* don't have it. (the objects themselves do)
02:05:49  <SinisterRectus>they both do
02:06:04  <SinisterRectus>class.__name = name
02:09:02  <daurnimator>SinisterRectus: I mean the class itself (it only has __call and __tostring)
02:10:02  <SinisterRectus>those are metamethods... __name is just a parameter of the class table
02:11:09  <SinisterRectus>i can't define __tostring to return __name, though, if it's not a closure of the class definition
02:12:07  <daurnimator>SinisterRectus: hold on, let me "improve" yours a bit
02:12:47  <daurnimator>btw, do you intend that in the case of conflicting method definitions from your multiple inheritence the *last* class wins?
02:12:53  <daurnimator>(normally it's the first one.... or an error)
02:12:55  <SinisterRectus>oh wait, i just pass it, it works
02:13:02  <SinisterRectus>yes, correct
02:14:14  <SinisterRectus>that's just my own convention, though
02:14:16  * Haragethjoined
02:17:11  <SinisterRectus>http://pastie.org/private/aiopdebhqwhfvljejzpqyq
02:18:08  <SinisterRectus>is that what you meant by sharing the metatable
02:19:44  <daurnimator>SinisterRectus: http://codepad.org/3Y9SGsPL
02:20:37  <SinisterRectus>ah yep pretty much that
02:21:08  <daurnimator>SinisterRectus: one more change (removing the __init is function check)
02:21:35  <SinisterRectus>it's optional though
02:22:20  <daurnimator>SinisterRectus: http://codepad.org/sae2liZC
02:22:50  <SinisterRectus>i'll def switch to rawset though
02:23:04  <daurnimator>uh, http://codepad.org/67Jn5HOS missed `self` in obj__tostring
02:23:04  <SinisterRectus>why do you not use pairs?
02:23:08  <SinisterRectus>np
02:23:19  <daurnimator>SinisterRectus: incase someone decides to use __pairs
02:23:20  * Haragethquit (Remote host closed the connection)
02:23:55  <SinisterRectus>is that a 5.3 thing
02:24:12  <SinisterRectus>hm, no it's in at least 5.2
02:24:15  <daurnimator>5.2 and 5.3. people often override pairs in 5.1 to provide it though
02:24:34  <SinisterRectus>what about __ipairs
02:24:56  <daurnimator>SinisterRectus: what about it? the table we pass we know doesn't have a metatable.
02:25:04  <SinisterRectus>doh lol
02:26:24  <daurnimator>SinisterRectus: so http://codepad.org/HBsrcOCd ?
02:27:21  <daurnimator>actually you need rawset at the bottom too: http://codepad.org/PC3z949Y
02:27:47  <SinisterRectus>yeah that has to come after the copy
02:28:18  <daurnimator>inheriting metamethods probably needs more finese anyway
02:28:44  <daurnimator>most of them shouldn't be inherited.
02:29:43  <creationix>konobi: hadn't tried it yet
02:29:54  <creationix>still pretty sick, easily distracted
02:30:11  * creationixis currently trying to finish the microcontroller vm for his son
02:30:28  * daurnimatorhas a sick dog :( vet is holding her overnight
02:30:31  <creationix>nodemcu's elua is too sloppy
02:30:52  <daurnimator>the esp8266 dev kit is sloppy
02:30:54  <creationix>espruino is nice, but is missing lots of hardware support on esp8266 and is slow
02:30:59  <creationix>daurnimator: truth
02:31:14  <daurnimator>creationix: https://github.com/superhouse/esp-open-rtos is hopefully a better base
02:31:17  <creationix>but I've got a ton of hardware
02:31:26  <creationix>the arduino port is pretty good. I've been using that
02:31:38  <creationix>just write my vm in C (C++ really, but I mostly ignore that)
02:34:52  <creationix>daurnimator: looks nice, I might just use this
02:34:58  <creationix>probably lower overhead than arduino
02:35:07  <creationix>I don't mind rewriting my I2C drivers
02:35:24  <creationix>most arduino libraries would be easy to port manually anyways
02:39:49  <konobi>creationix: i could probably give it a try over the weekend
02:40:15  <konobi>assuming cmake doesn't break my brane
02:43:03  <SinisterRectus>works nicely, thanks daurnimator
02:43:04  * Haragethjoined
02:43:33  <konobi>creationix: do you have some sort of OO framework that you recommend for lua?
02:44:09  <creationix>konobi: oh yeah, cmake is why I gave up
02:44:11  <creationix>now I remember
02:44:26  <creationix>I don't really like OO
02:44:31  <creationix>the one in luvit/core is fairly simple
02:44:41  <creationix>it made porting node's APIs to lua easier
02:45:02  <creationix>I much prefer closures and functions returning functions to objects with inheritance and methods
02:46:17  <konobi>yeah, in a lot of OO frameworks you'd not get proper async behaviour
02:47:44  <daurnimator>SinisterRectus: so I realised you can be self consistent.
02:47:59  <SinisterRectus>hm?
02:49:12  <konobi>creationix: though... you could probably get away with a lot using coroutines
02:49:44  <creationix>konobi: oh I use coroutines alright in my luvit code
02:49:51  <creationix>coroutines and closures are my friends
02:51:18  <daurnimator>SinisterRectus: create your class class with a class.
02:51:33  <SinisterRectus>oh..
02:52:10  <creationix>It's a shame forth is so hard to understand, the vm is so simple and the bytecode is super compact https://www.pololu.com/docs/0J40/6.c
02:53:00  * Adam__joined
02:53:06  <creationix>I wonder how hard it is to compile a lua-like language to forth-like bytecode. That's what python does right?
02:53:08  <creationix>and sort of what lua does
02:53:29  <konobi>creationix: would be interesting for UEFI apps
02:53:42  <creationix>is space limited for those?
02:55:14  <konobi>nope
02:55:31  <konobi>they're usually always on disk as a special "partition"
02:56:23  * Haragethquit (Ping timeout: 250 seconds)
02:59:27  <daurnimator>SinisterRectus: http://codepad.org/kjoas5zs
03:00:12  * Adam__quit (Remote host closed the connection)
03:01:33  <SinisterRectus>O_o
03:03:28  <SinisterRectus>that's cool... mindboggling, too
03:03:34  <SinisterRectus>not really necessary tho
03:03:50  <SinisterRectus>or is it beneficial?
03:05:10  <SinisterRectus>it saves a table, yes?
03:05:35  <daurnimator>SinisterRectus: slightly refactored: http://codepad.org/7ujSzxMi
03:05:45  * Haragethjoined
03:07:20  <daurnimator>SinisterRectus: it separates out class construction from initialisation. should be easier to debug. + you don't ever use a *different* class system to build *your* class system :P
03:07:51  <SinisterRectus>indeed, but it prevents a second table from being used for the metatable, and sets the class as its own metatable
03:08:25  <daurnimator>SinisterRectus: huh?
03:08:57  <SinisterRectus>setmetatable(class, class) instead of setmetatable(class, mt)
03:09:23  <daurnimator>SinisterRectus: that's just for the class object itself. the 'class' object is of class 'class'.
03:09:38  <SinisterRectus>yes i know
03:09:44  <SinisterRectus>i'm saying that you save a table by doing that
03:10:44  <daurnimator>saving a table here isn't really top of mind
03:11:27  <SinisterRectus>i optimize for performance above debug-ability
03:12:08  <daurnimator>SinisterRectus: performance of a one-off thing done at *library* initialisation time?
03:12:55  <SinisterRectus>i guess it's a moot point, since i no longer have a metatable per class
03:12:57  <daurnimator>... and that performance difference is an ~24 byte memory allocation? :p
03:13:03  <SinisterRectus>previously i did
03:14:05  <SinisterRectus>this is really nice thoug
03:14:07  <daurnimator>SinisterRectus: also: print(class) => 'class class' ;)
03:14:25  <SinisterRectus>ooh i don't know if i like that
03:14:36  <daurnimator>SinisterRectus: well before you got "function 0x1234"
03:14:37  <SinisterRectus>ah i can change it
03:14:44  <daurnimator>I think it is a good thing actually
03:15:02  <daurnimator>it shows that 'class' isn't special, it's just another class (that happens to construct classes)
03:15:07  <SinisterRectus>no.. it returned class .. class.__name
03:15:18  <SinisterRectus>'class ' .. class.__Name
03:15:19  <SinisterRectus>name*
03:15:22  <SinisterRectus>(it's late)
03:17:15  * Adam__joined
03:19:32  <daurnimator>SinisterRectus: I think wires got crossed
03:20:17  * Haragethquit (Ping timeout: 276 seconds)
03:20:25  <daurnimator>I was saying the 'class' variable has a __tostring that returns "class class" *because* of the `"class " .. self.__name`
03:20:51  <SinisterRectus>indeed
03:20:56  <daurnimator>you still have `tostring(class("foo")) == "class foo"`
03:21:21  <SinisterRectus>yes, but i don't know what you mean by 'before you got "function 0x1234"'
03:21:50  <daurnimator>SinisterRectus: previous the thing returned by your module was just a function. with tostring(require"class") == "function 0x1234"
03:21:58  <SinisterRectus>ohhhh
03:22:10  <SinisterRectus>class()
03:22:11  <SinisterRectus>derp
03:22:23  <SinisterRectus>i thought you mean tostring(ClassName)
03:22:24  <SinisterRectus>okay
03:22:25  <SinisterRectus>nvm
03:28:11  <SinisterRectus>time for bed, thanks again for the help daurnimator
03:52:49  * Haragethjoined
03:56:37  * Adam__quit (Ping timeout: 250 seconds)
04:12:10  * Haragethquit (Remote host closed the connection)
04:33:18  * Haragethjoined
04:34:28  * SinisterRectusquit (Ping timeout: 244 seconds)
04:37:31  * Haragethquit (Ping timeout: 252 seconds)
04:39:31  * Haragethjoined
05:13:33  * SkyRocknRolljoined
05:29:29  * Haragethquit (Remote host closed the connection)
06:40:16  * rendarjoined
08:59:03  * dobsonquit (Ping timeout: 268 seconds)
09:08:30  * dobsonjoined
12:18:04  * SkyRocknRollquit (Ping timeout: 240 seconds)
12:47:48  <creationix>mornin'
13:11:18  * devurandomquit (Remote host closed the connection)
13:13:17  * devurandomjoined
13:51:32  <rphillips>morning
14:34:07  * Haragethjoined
14:38:50  * Haragethquit (Ping timeout: 268 seconds)
15:43:01  * Haragethjoined
15:49:09  * btsvolmarjoined
15:57:26  * Haragethquit (Remote host closed the connection)
16:12:08  <creationix>alright, deployed cas server for testing https://cas.luvit.io/
17:03:39  * Haragethjoined
17:12:06  * piernov_joined
17:15:31  * |00|joined
17:18:31  <creationix>and by "cas" I mean content addressable storage, not cassandra!
17:19:11  <creationix>the API is basically PUT https://cas.luvit.io/[sha1 hash] and then the body is the data
17:19:14  * |oo|quit (*.net *.split)
17:19:14  * boxofroxquit (*.net *.split)
17:19:14  * piernovquit (*.net *.split)
17:19:15  * konobiquit (*.net *.split)
17:19:18  <creationix>and then GET on the same url to get it back
17:19:23  * DarkGodjoined
17:19:39  <creationix>(though it will expire the values pretty quickly if nothing points to them, this is just for storage used by published modules)
17:21:23  * boxofroxjoined
17:24:00  * konobijoined
17:24:22  * konobichanged nick to Guest85405
17:36:46  * |00|changed nick to |oo|
17:41:00  * SkyRocknRolljoined
17:53:59  <creationix>rphillips, did you update the luv version in the agent?
17:54:09  <creationix>I've been having trouble with the new luv around some ssl stuff
17:54:14  <creationix>I think lua-openssl changed APIs again
17:54:19  <rphillips>hmm.
17:54:33  * Adam__joined
17:56:10  * Haragethquit (Ping timeout: 268 seconds)
18:08:32  <rphillips>1.9.0-1 of luv
18:12:33  <creationix>luv is fine
18:12:36  <creationix>it's luvi I don't trust
18:12:53  <creationix>I had problems in both lit and luvit's tests trying to update luvi
18:14:13  <rphillips>hmm. strange
18:27:25  * Adam__quit (Remote host closed the connection)
18:36:39  * Haragethjoined
18:43:12  * rendarquit (Ping timeout: 246 seconds)
18:48:29  * Haragethquit (Read error: Connection reset by peer)
18:49:30  * rendarjoined
18:55:22  * Haragethjoined
19:02:39  * Haragethquit (Ping timeout: 250 seconds)
19:02:42  * SkyRocknRollquit (Remote host closed the connection)
19:03:47  * Haragethjoined
19:04:29  * travis-cijoined
19:04:30  <travis-ci>luvit/luvit#2781 (master - 63f8051 : Ryan Phillips): The build passed.
19:04:30  <travis-ci>Change view : https://github.com/luvit/luvit/compare/959b6dc475ed...63f805131997
19:04:30  <travis-ci>Build details : https://travis-ci.org/luvit/luvit/builds/124832880
19:04:30  * travis-cipart
19:12:29  * Haragethquit (Read error: Connection reset by peer)
19:15:26  * Haragethjoined
19:56:56  * Haragethquit (Remote host closed the connection)
20:07:06  * Haragethjoined
20:11:24  * Haragethquit (Ping timeout: 246 seconds)
20:49:26  * Haragethjoined
21:49:34  * rendarquit (Quit: std::lower_bound + std::less_equal *works* with a vector without duplicates!)
22:43:41  * SinisterRectusjoined
22:45:48  * Adam__joined
22:45:48  * Haragethquit (Read error: Connection reset by peer)
23:31:08  * Haragethjoined
23:31:09  * Adam__quit (Read error: Connection reset by peer)