00:58:02  * xan_quit (Ping timeout: 250 seconds)
01:01:02  * utkonos_quit (Remote host closed the connection)
01:15:17  * mritzjoined
01:54:51  * C-Manquit (Quit: Connection reset by beer)
01:56:54  * seventhquit (Ping timeout: 240 seconds)
02:16:23  * joshthecoderquit (Quit: Leaving...)
02:54:44  * eohquit (Ping timeout: 248 seconds)
02:56:29  * eohjoined
03:13:46  * eoh|joined
03:15:10  * eohquit (Ping timeout: 252 seconds)
03:15:40  * eoh|quit (Read error: Connection reset by peer)
03:15:49  * eohjoined
03:44:34  * mritzquit (Quit: Computer has gone to sleep.)
03:56:12  * aadsmjoined
04:07:58  * eoh|joined
04:09:00  * eohquit (Read error: Connection reset by peer)
04:20:33  * aadsmquit (Quit: aadsm)
05:27:21  * joshthecoderjoined
06:49:20  * aadsmjoined
07:23:44  * aadsmquit (Quit: aadsm)
07:54:25  * bnoordhuisjoined
07:55:15  * joshthecoderquit (Quit: Linkinus - http://linkinus.com)
08:10:57  * xan_joined
08:24:40  * juanjosanchezjoined
08:33:35  * xan_quit (Ping timeout: 260 seconds)
08:59:02  * xan_joined
09:08:56  * utkonosquit (Remote host closed the connection)
09:12:46  * [[zzz]]joined
09:15:54  * [[zz]]quit (Ping timeout: 240 seconds)
09:36:47  * juanjosanchezquit (Ping timeout: 255 seconds)
09:56:24  * nierobjoined
10:01:21  * Net147joined
11:21:04  * C-Manjoined
13:19:58  * Net147quit (Quit: HydraIRC -> http://www.hydrairc.com <- Chicks dig it)
13:55:33  * jamespage_joined
13:55:38  * jamespage_quit (Read error: Connection reset by peer)
14:25:19  <C-Man>is it possible to add functions/objects to the global template after context has been created?
14:32:35  <C-Man>nevermind i figured it out ~.~
14:32:49  <C-Man>this channel seems to be deader then ever
14:32:57  <C-Man>even tho there are more people in here
14:33:02  <C-Man>since last time
14:54:31  <bnoordhuis>C-Man: we're very shy people
14:57:47  <C-Man>: (
14:59:12  <C-Man>bnoordhuis any chance you might know whats the difference of making a global object template before hand and setting function instances on the global object when the context is created
14:59:52  <bnoordhuis>C-Man: from a performance or memory consumption perspective, you mean? not much
14:59:54  <C-Man>any atvanges/disadvanges on either side
14:59:55  <C-Man>?
15:00:14  <bnoordhuis>in node we don't bother with prototypes and just set properties on the object
15:00:17  <C-Man>well i just can decide weather i should bother puttting everything in a template
15:00:22  <C-Man>or just set it after the fact
15:00:47  <C-Man>since it makes alot of difference in how i write the class
15:00:53  <C-Man>in the constructor
15:00:56  <C-Man>mostly
15:01:08  <bnoordhuis>pick whatever is easiest / most aesthethically pleasing
15:01:24  <C-Man>but from the script point of view it will not make any difference right
15:01:25  <C-Man>?
15:01:34  <bnoordhuis>no
15:01:50  <C-Man>thats good
15:02:05  <C-Man>bnoordhuis any idea what V8 uses sockets for ?
15:02:13  <C-Man>i can't seem to find any builtin network
15:02:15  <C-Man>functuionality
15:02:16  <C-Man>in it
15:02:24  <C-Man>made me curious
15:02:25  <bnoordhuis>maybe i should reword that as "not that i know of" - we don't do really fancy things with object templates
15:02:33  <bnoordhuis>it's for the debugger
15:02:39  <C-Man>oh
15:02:52  <C-Man>what kind of builtin functions does v8 have apart from Math and Date
15:03:14  <C-Man>and RegExp, Array, Object etc
15:03:16  <bnoordhuis>everything that's in the ecma spec, array, object, function, ec.
15:03:23  <bnoordhuis>right, those :)
15:03:29  <C-Man>but i mean from the utility standpoint
15:03:40  <bnoordhuis>nothing. it's unadorned ecmascript
15:03:55  <C-Man>since you could survive without Date and Math as opposite to Array , Object , Function
15:04:16  <bnoordhuis>there are some builtins hidden behind flags, like --expose-gc
15:04:26  <C-Man>ah i see
15:04:36  <C-Man>good very good
15:04:47  <C-Man>hmm what else was on my mind
15:04:50  <C-Man>Context::Scope
15:04:55  <C-Man>what is the correct use of that
15:05:03  <C-Man>do you just put it along HandleScope
15:05:08  <C-Man>in execution scopes
15:05:09  <C-Man>?
15:05:17  <C-Man>or can i store it in an object
15:05:18  <C-Man>?
15:05:41  <bnoordhuis>you could but it's mostly a utility to enter and leave a context in some c++ block scope
15:06:06  <C-Man>so it's a replacement for calling Enter/Leave ?
15:06:23  <bnoordhuis>{ Context::Scope context_scope(context); script->Run(...); } is equivalent to { context->Enter(); script->Run(...); context->Leave(); }
15:06:25  <bnoordhuis>so yes :)
15:06:34  <C-Man>ah !
15:06:36  <C-Man>makes sense
15:08:01  <C-Man>on a scale of 1 to 10 how hard is it to expose classes/methods
15:08:07  <C-Man>like
15:08:13  <C-Man>say i got a class Foo
15:08:20  <C-Man>and methods Bar and Fubar
15:08:27  <C-Man>to expose those to js
15:08:29  <C-Man>and have
15:08:33  <C-Man>Foo.Bar ()\
15:08:38  <C-Man>Foo.Fubar ()
15:09:20  <bnoordhuis>C-Man: is 1 easiest or hardest?
15:09:30  <C-Man>1 easiest
15:09:32  <C-Man>10 hardest
15:09:56  <bnoordhuis>3. objectively and provably 3
15:10:52  <C-Man>what about with proper constructors
15:10:54  <C-Man>like
15:11:05  <C-Man>var f = new CppClass (1,2,3)
15:11:09  <C-Man>f.CppMethod ()
15:11:19  <bnoordhuis>also easy. v8's api is pretty straightforward
15:11:35  <bnoordhuis>it's when you start doing things like inheritance that it becomes hairy
15:11:54  <bnoordhuis>there's a lot of examples in test/cctest
15:11:55  <C-Man>well js isnt really a language where you can inherit
15:12:29  <bnoordhuis>don't tell that to the people that write OO frameworks
15:12:41  <bnoordhuis>you know how heretics end up, don't you?
15:12:44  * nierobquit (Ping timeout: 252 seconds)
15:12:53  <C-Man>bwahahaha
15:13:42  <C-Man>another kind of question that springs to mind
15:13:48  <C-Man>is what kind of balance of JS vs C++
15:13:53  <C-Man>code should i maintain
15:13:57  <C-Man>if i want fair performance
15:14:12  <C-Man>there are things that could be done either way
15:14:15  <C-Man>easier being in JS
15:14:20  <bnoordhuis>C-Man: i don't know if there's a one-size-fits-all solution
15:14:25  <C-Man>better performance being in C++
15:14:31  * nierobjoined
15:14:34  <bnoordhuis>but in node we aim for a very thin c++ layer and shim most things in js land
15:14:51  <bnoordhuis>node itself is really glue between js and libuv plus some other libraries
15:15:08  <C-Man>do you load the js part at runtime
15:15:14  <bnoordhuis>yes
15:15:15  <C-Man>or compile it into your executable
15:15:22  <C-Man>somehow...
15:15:30  <bnoordhuis>yes
15:15:37  <C-Man>how do you do that ?
15:15:40  <bnoordhuis>i.e. compiled into the executable but not precompiled
15:15:45  <C-Man>is there any way to precompile ?
15:15:55  <C-Man>just plain strings
15:15:55  <C-Man>?
15:16:15  <bnoordhuis>node uses a js2c.py script that converts a .js file to a c char array
15:16:34  <C-Man>still would be pretty nice if one could precompile js...
15:16:36  <bnoordhuis>v8 has this preparser api but it doesn't speed up anything for us so we don't use it
15:16:54  <C-Man>well i'm more for kind of obfusctation
15:16:55  <C-Man>raeasons
15:17:01  <C-Man>and to make it take less space maybe
15:17:09  <C-Man>not concerned about loading speed
15:17:10  <bnoordhuis>you could create a snapshot that contains your code
15:17:18  <bnoordhuis>like v8 does for array/date/etc.
15:17:28  <C-Man>how does one go about doing it
15:17:34  <bnoordhuis>but obfuscation is a battle you can't win
15:17:44  <bnoordhuis>there's always func.toString()
15:18:01  <bnoordhuis>C-Man: re snapshotting, you'll have to look at how v8 does it
15:18:13  * [[zzz]]changed nick to [[zz]]
15:18:44  <bnoordhuis>in essence, the v8 build runs an intermediate step where v8 runs its js bootstrap code, then dumps the binary representation to disk
15:18:58  <bnoordhuis>said binary representation then gets compiled into the final libv8
15:18:59  <C-Man>ah
15:19:00  <C-Man>i see
15:19:12  <C-Man>bnoordhuis dont want to win it
15:19:16  <C-Man>just make it a little bit harder
15:19:19  <C-Man>:P
15:19:23  <C-Man>just a tiny bit
15:19:38  <bnoordhuis>you'll probably have more luck with a minifier like closure compiler
15:19:58  <bnoordhuis>because the snapshotted code is still toString-able
15:20:17  <C-Man>i kind of like it when one opens something in an editor and finds a bunch of giberish binary
15:20:22  <C-Man>kind of my fetish
15:20:30  <bnoordhuis>write c then :)
15:20:38  <C-Man>i used to do osdev for a hobby 10 years ago
15:20:41  <C-Man>lol
15:21:06  <C-Man>however now i realise the value of making things easier
15:21:52  <bnoordhuis>same here. i wrote a unix clone for 286s years and years ago
15:22:13  <bnoordhuis>sysv7 compatible, if you didn't look too close
15:23:53  <C-Man>wow nice
15:24:21  <C-Man>i didnt get that far due to my compulsive need to get everything perfect
15:24:27  <C-Man>and 10 billion rewrites
15:24:45  <C-Man>did learn a ton on x86 internals tho
15:27:47  <C-Man>bnoordhuis any idea what ExtensionConfiguration
15:27:49  <C-Man>parameter does
15:27:54  <C-Man>in context::new
15:27:58  <bnoordhuis>yes
15:28:12  <bnoordhuis>v8 lets you add js extensions
15:28:22  <C-Man>any way to find a list of em
15:28:24  <bnoordhuis>that --expose-gc thing i mentioned, that's an extension
15:28:25  <C-Man>or how to add them ?
15:28:47  <C-Man>isnt that a compile option
15:28:47  <C-Man>?
15:28:55  <C-Man>as in when building v8
15:29:16  <bnoordhuis>C-Man: grep -nrw Extension v8/src
15:29:29  <bnoordhuis>there's a couple more besides the gc extension
15:29:50  <bnoordhuis>re --expose-gc, no, it's a command line switch
15:30:16  <C-Man>O.o oh
15:30:26  <C-Man>so you like
15:30:34  <C-Man>make an ExtensionConfiguration object
15:30:37  <C-Man>and pass it those arguments
15:30:43  <C-Man>then pass that to the context ?
15:31:30  <bnoordhuis>yes, more or less
15:33:05  * cha0sjoined
15:47:16  * RT|Chatzillaquit (Quit: ChatZilla 0.9.86.1 [Firefox 2.0.0.22pre/2009081014])
16:04:06  * joshthecoderjoined
16:07:27  * bnoordhuisquit (Ping timeout: 276 seconds)
16:29:02  <C-Man>ah darn it bnoordhuis went away
16:47:52  * joshthecoderquit (Quit: Leaving...)
17:15:17  * aadsmjoined
17:23:15  * joshthecoderjoined
17:49:34  * aadsmquit (Quit: aadsm)
18:08:40  <C-Man>can anyone explain me handle scopes
18:09:26  <C-Man>;_;
18:26:28  * C-Manquit (Ping timeout: 248 seconds)
18:27:30  * C-Manjoined
18:42:59  * C-Manpokes /.*/
19:33:55  * xan_quit (Ping timeout: 260 seconds)
19:53:22  <alex4nder>C-Man: what do you want to know?
19:53:31  <alex4nder>they're pretty well documented and there are examples around
20:31:33  * mritzjoined
20:50:09  * elliottcablequit (Quit: Lost terminal)
20:55:08  <C-Man>alex4nder still there?
20:55:35  * joshthecoderquit (Quit: Linkinus - http://linkinus.com)
20:55:48  * joshthecoderjoined
20:56:02  <alex4nder>C-Man: yup
20:56:16  <C-Man>the thing is i'm not sure if i need a handle scope in my object
20:56:21  <C-Man>that will be holding
20:56:23  <alex4nder>in your object?
20:56:23  <C-Man>handles to things
20:56:29  <C-Man>well i want to make a class
20:56:29  <alex4nder>no, a handle scope is for a scope
20:56:34  <C-Man>that holds some handles
20:56:39  <C-Man>not sure if i need a scope
20:56:40  <C-Man>with that
20:56:49  <C-Man>only for { }
20:56:50  <C-Man>then ?
20:56:52  <alex4nder>you're holding handles across multiple blocks of codes?
20:57:03  <alex4nder>you sure you don't want a persistent handle?
20:57:15  <C-Man>thats it i dont know
20:57:19  <C-Man>where to use which kind of handle
20:57:24  <C-Man>and do i need scopes
20:57:25  <C-Man>for them
20:57:31  <alex4nder>I'd say read the documentation
20:57:36  <alex4nder>what are you trying to implement?
20:57:42  <C-Man>what documentation :S
20:57:54  <C-Man>the embedding guides does not explain it well
20:57:56  <C-Man>or at all
20:58:09  <alex4nder>I learned from them, and have written working code with them, so they explain it well enough.
20:58:12  <C-Man>the doxygen stuff doesnt explain much either
20:58:16  <alex4nder>because I'm not a genius
20:58:36  <C-Man>well lets say i have a class that will be sort of a global one
20:58:39  <C-Man>like a singleton
20:58:42  <C-Man>that lingers around
20:58:44  <C-Man>for a while
20:58:56  <C-Man>and it holds a handle to a context, global object template
20:58:58  <C-Man>and what not
20:59:00  <alex4nder>sure
20:59:06  <alex4nder>and you want to hold onto it for an extended period of time
20:59:11  <C-Man>and i'm not sure with scopes how they work with that
20:59:13  <alex4nder>so this is from the documentation: Persistent handles are not held on a stack and are deleted only when you specifically remove them. Just like a local handle, a persistent handle provides a reference to a heap-allocated object. Use a persistent handle when you need to keep a reference to an object for more than one function call, or when handle lifetimes do not correspond to C++ scopes.
20:59:20  <alex4nder>https://developers.google.com/v8/embed
20:59:24  <alex4nder>under Handles and Garbage Collection
20:59:27  <C-Man>so i can only use persistent handles
20:59:31  <C-Man>in that kind of situation
20:59:32  <C-Man>?
20:59:47  <alex4nder>you can look up the handle every time you need to access it, or you can use a persistent handle
20:59:56  <C-Man>oh i got it
21:00:00  <C-Man>thanks
21:00:58  <C-Man>so i use a Handle/Local only when i want to keep no longer then one scope length
21:01:07  <alex4nder>that's the idea
21:01:18  <alex4nder>using the stack, etc.
21:01:19  <C-Man>makes sense
21:01:24  <alex4nder>the dynamic is covered in the doc
21:01:38  <C-Man>thanks alex4nder
21:01:46  <alex4nder>no problem
21:02:41  <C-Man>if i dont give a context a global template
21:02:45  <C-Man>it still creates a global
21:02:46  <C-Man>object
21:02:47  <C-Man>right
21:02:48  <C-Man>?
21:04:13  <alex4nder>doxygen lists them all as optional
21:27:35  * elliottcablejoined
21:33:38  * seventhjoined
22:20:56  * C-Manquit (Quit: Connection reset by beer)
22:22:07  * C-Manjoined
22:26:34  * C-Manquit (Ping timeout: 246 seconds)
22:29:43  * C-Manjoined
22:30:13  * RT|Chatzillajoined
22:30:44  * C-Manquit (Client Quit)
22:46:36  * joshthecoderquit (Quit: Leaving...)
22:57:02  * C-Manjoined
23:32:25  <C-Man>is there any way to get context from Arguments ?
23:32:32  <C-Man>the calling context
23:35:30  <C-Man>do i even need a context for member functions
23:35:31  <C-Man>O.o