01:01:53  * alejandromgjoined
01:11:50  * alejandromgquit (Quit: leaving)
02:06:55  * mmaleckiquit (Quit: leaving)
07:25:10  * mmaleckijoined
07:29:46  * mmaleckiquit (Ping timeout: 244 seconds)
07:31:44  * mmaleckijoined
07:32:09  * mmaleckichanged nick to mmalecki[away]
11:11:21  * mmaleckijoined
11:13:39  * mmaleckiquit (Client Quit)
11:27:29  <indutny>heya
11:27:33  <indutny>anyone around?
11:44:37  * wankdankerquit (Remote host closed the connection)
13:07:32  * mmalecki[away]changed nick to mmalecki
13:39:17  <indutny>mmalecki: ping :)
13:39:35  <mmalecki>indutny: PONGETY PONG
13:40:39  <mmalecki>indutny: what's up?
13:44:26  <indutny>mmalecki: sorry, was on a call
13:44:43  <indutny>mmalecki: I removed global vars, replaced globals with a 'global' variables
13:44:55  <indutny>what do you think?
13:45:14  <indutny>that should definitely solve global leaking problem
13:45:31  <mmalecki>indutny: sounds fun! how do you take variables from outer scope?
13:45:55  <indutny>mmalecki: it's like in coffee-script
13:46:00  <indutny>lexical scoping
13:46:19  <mmalecki>ah, nice
13:50:44  <indutny>creationix: hey man, where are you?
13:50:49  <indutny>haven't seen you for two days
14:24:55  * piscisaureus_joined
14:26:34  <creationix>I
14:26:40  <creationix>indutny, I'm here
14:27:04  <creationix>remember I'm half a world away time-zone wise and I don't work on Sundays
14:28:11  <mmalecki>one does not simply not work on Sundays ;)
14:28:53  <mmalecki>(I release modules on Sundays)
14:55:17  <indutny>срш
14:55:20  <indutny>Ж)
14:55:23  <indutny>hi! :)
14:55:42  <indutny>I'm not working at sabbath
14:55:44  <indutny>haha
14:55:48  <mmalecki>some crazy letters you have there, Fedor
14:55:50  <indutny>have you guys seen Big Lebowski?
14:55:55  <mmalecki>yeah
14:56:02  <mmalecki>hahaha
14:56:08  <indutny>mmalecki: man, you Poland people are using latin letter
14:56:12  <indutny>letters*
14:56:18  <indutny>you're so happy nation
14:56:23  <mmalecki>:D
14:56:30  <indutny>we use that kind of cyrillic stuff
14:56:32  <indutny>meh
14:56:33  <indutny>don't like it
14:56:53  <indutny>creationix: so, what I'm interested in
14:57:04  <indutny>why CWrapper doesn't work for you?
15:01:45  <indutny>creationix: ^
15:06:10  * mmaleckiquit (Quit: leaving)
15:06:19  * mmaleckijoined
15:39:22  <creationix>indutny, not sure
15:39:25  <creationix>it just doesn't work
15:39:30  <creationix>and I see it's not actually in any test case
16:24:47  <creationix>tell you what though. This daily syntax changes keep my on my toes
16:25:06  <creationix>good thing I don't have more than 100 lines of candor code I depend on
16:25:20  <creationix>(not complaining btw)
16:27:30  <indutny>sorry :)
16:27:52  <indutny>creationix: well, it's in test-api
16:28:33  <creationix>alright figured out global
16:28:46  <indutny>creationix: cool
16:28:56  <indutny>I think it's much more intuitive this way
16:29:05  <indutny>lexical scoping + global object
16:29:41  <creationix>indutny, is this how you intend it to be used: https://github.com/creationix/candor.io/blob/master/test.can#L1-3
16:30:05  <indutny>probably
16:30:09  <creationix>so there is only one implicit global variable, "global"
16:30:13  <indutny>yes
16:30:14  <creationix>that makes linting easier
16:30:17  <indutny>yes
16:30:39  <creationix>so, CWrapper
16:32:01  <creationix>is what I did an OK solution
16:32:07  <indutny>creationix: https://github.com/indutny/candor/blob/master/test/test-api.cc#L93-106
16:32:13  <indutny>creationix: what you did?
16:32:15  <creationix>or is it better to only store the pointer in the cdata?
16:32:33  <indutny>creationix: that depends
16:32:40  <creationix>https://github.com/creationix/candor.io/blob/master/src/luv_handle.cc#L23-25
16:32:59  <indutny>creationix: it's simpiler to call vtable's destructor if pointer was stored
16:33:00  <creationix>https://github.com/creationix/candor.io/blob/master/src/luv_timer.cc#L72-76
16:33:15  <creationix>yeah, I don't know how classes in C++ work
16:33:36  <indutny>creationix: so you just do new CWrapper()
16:33:50  <indutny>creationix: or new YourClass()
16:33:58  <indutny>then do instance->Wrap()
16:34:00  <indutny>and use it
16:34:44  <creationix>when I tried it before, it was segfaulting like crazy
16:34:52  <indutny>probably it was GCed
16:34:57  <indutny>have you implemented destructor?
16:34:58  <creationix>and when I printed the pointer values, they didn't match at all
16:35:02  <creationix>no, it wasn't GC issues
16:35:04  <indutny>that's odd
16:35:10  <creationix>between wrap and unwrap something was way off
16:35:17  <indutny>let me check
16:38:05  <indutny>ooh
16:38:05  <indutny>odd
16:38:11  <indutny>you're right
16:38:59  <indutny>it's crashing
16:41:10  <creationix>I didn't understand enough C++ to debug it
16:41:18  <creationix>I handle single pointers, but that's about it
16:42:37  <indutny>aaah
16:42:47  <indutny>I think I fixed it :)
16:42:52  <creationix>cool
16:42:59  <creationix>I'll switch back to it then
16:43:03  <indutny>yes
16:43:12  <indutny>Unwrap was incorrect
16:43:20  <indutny>please pull latest changes
16:43:26  <indutny>I was doing (T*)(data)
16:43:30  <indutny>instead of *(T**)(data)
16:43:44  <indutny>so that was not a pointer to the instance
16:43:47  <indutny>but pointer to the pointer
16:43:49  <indutny>:)
16:45:33  <indutny>btw, you should increase liveness of object
16:45:42  <indutny>one second, I think I can implement some sort of api for that
16:45:47  <indutny>like instance->Ref()
16:45:50  <indutny>instance->Unref()
16:51:40  <creationix>ok, I don't understand what Handle is and when to use it
16:51:55  <creationix>will Ref and UnRef be Handle methods?
16:54:19  <indutny>no
16:54:23  <indutny>CWrapper's ones
16:54:33  <indutny>almost finished it
16:54:34  <indutny>one sec
17:01:35  <indutny>strange
17:01:40  <indutny>it's segfaulting...
17:01:45  <indutny>and I can't get why
17:04:16  <creationix>are your pointer values right?
17:04:41  <indutny>that's it
17:04:50  <indutny>they're incorrect
17:04:56  <indutny>probably GC has moved them
17:05:06  <indutny>but haven't updated
17:05:11  <indutny>i.e. haven't relocated
17:06:41  <indutny>yes, that's what happened
17:10:19  <indutny>aaah
17:10:22  <indutny>well,ok
17:10:23  <indutny>got it
17:11:56  <indutny>ok, fixed
17:12:03  <indutny>so the thing is
17:12:19  <indutny>that if you're running some async action on object - you should Ref() it
17:12:29  <indutny>one action has finished - Unref() it
17:12:37  <indutny>this way you'll get GC safity
17:12:43  <indutny>s/safity/safety
17:12:44  <indutny>creationix: ^
17:13:42  <creationix>right
17:13:51  <creationix>so creating a handle doesn't do that?
17:14:18  <indutny>creationix: yes
17:14:26  <indutny>creationix: and you should not ref it on creation
17:14:26  <creationix>btw https://github.com/creationix/candor.io/commit/2dda0e74b6d87483dab3a3d8ba21a5d448b46ede
17:14:35  <indutny>otherwise it won't be ever GCed
17:15:11  <creationix>how do I test gc?
17:15:12  <indutny>you should definitely add ~uvTimer()
17:15:18  <indutny>__$gc() call
17:15:27  <indutny>or allocate a lot of data
17:15:28  <indutny>:)
17:16:04  <indutny>oh, destructor is optional, sorry
17:16:18  <indutny>but I think you may want to cleanup something
17:16:43  <indutny>like, uv_timer_stop
17:17:08  <creationix>ok, so in C++ super calls are implicit?
17:17:18  <indutny>yes
17:17:21  <creationix>so if I override the destructor, CWrapper's destructor is still called
17:17:23  <creationix>before or after?
17:17:28  <indutny>ah
17:17:28  <indutny>no
17:17:31  <indutny>it won't be called
17:17:35  <indutny>and it's actually empty
17:17:43  <indutny>it's a virtual method
17:17:53  <creationix>right, it's the weakcallback that's the gc cleanup
17:17:59  <indutny>yes
17:18:16  <creationix>ok, so my constructor is called right before the instance gets deleted
17:18:17  <indutny>weakcallback calls delete on your pointer
17:18:26  <indutny>destructor, but yes
17:18:33  <creationix>hah, right
17:19:47  <creationix>ok, putting a __$gc() call after every statement crashed my program
17:19:57  <creationix>time to add the proper Ref and Unref calls
17:20:24  <indutny>haha
17:20:26  <indutny>yes
17:20:37  <indutny>for example .onClose may be invoked after your object was destroyed
17:21:02  <indutny>so you may want to call Ref() in Close()
17:21:07  <indutny>and Unref() in OnClose()
17:27:06  <creationix>right at any async boundary to keep a reference to it
17:34:39  <indutny>huh
17:34:39  <indutny>https://gist.github.com/4d6e3270ff9020441373
17:34:46  <indutny>too much assembly here
17:35:03  <indutny>for:
17:35:03  <indutny>i = 1000000000
17:35:03  <indutny>while (--i) {
17:35:03  <indutny>}
17:35:23  <creationix>yeah, can't help there
17:35:25  <creationix>good luck
17:35:49  <indutny>hehe
17:35:50  <indutny>thanks :)
17:35:55  <indutny>I think I'm spilling too much
17:36:05  <indutny>and not using registers correclty
17:37:33  <creationix>how much of that assembly are you writing and how much is generated?
17:37:37  <creationix>just curious
17:37:55  <indutny>it's handwritten
17:38:03  <indutny>and generated
17:38:23  <indutny>fullgen visit each AST node and produce some sort of code, using templates
17:38:30  <indutny>well, not exactly like that, but almost
17:43:06  <indutny>ok, going to read that GC book
17:43:07  <creationix>I see
17:43:10  <creationix>have fun
17:43:13  <indutny>can you please add me at gtalk?
17:43:17  <creationix>sure
17:43:20  <creationix>tim@creationix.com
17:43:22  <indutny>fedor.indutny@gmail.com
17:43:25  <indutny>ok, one sec
17:43:37  <indutny>I'm not receiving notifications from irc
17:44:17  <indutny>sent request
18:24:27  * indutnychanged nick to indutny_sleeping
18:55:48  * mralephjoined
20:13:05  * phuujoined
20:16:40  * mralephquit (Quit: Leaving.)
20:41:46  * piscisaureus_quit (Ping timeout: 260 seconds)
20:56:22  * piscisaureus_joined
22:11:08  * phuuquit (Quit: phuu)