If I can, I'd like to avoid encoding/decoding to/from JSON. My current 
approach is to provide functions to the language to create V8 Value 
objects, such as "String", "Object", etc.. The language reflects its own 
object and creates a V8 Object by calling context.NewObject(), 
context.NewString("foo"), and obj.Set(key, value). In order to do this, the 
handles returned from NewObject/NewString/etc probably need to be 
Persistent.

My concern with this is every value, like a String, is a Persistent handle. 
I was wondering if there was some kind of way to port a HandleScope to my 
language so I can construct the object. In this case is Handle/Local vs 
Persistent even matter? Do I get some sort of gain by avoiding Persistent 
in this situation?

Luke


On Tuesday, August 20, 2013 12:48:16 PM UTC-7, Clemens Cap wrote:
>
> Probably depends on the properties you require from your binding. You 
> could also serialize the object into JSON in your "other" language, prepend 
> a function call (as in JSONP) and have that executed. I suspect this to be 
> less costly in glue code and (depending on your "other" language, probably 
> more costly in CPU time, since you add parsing). 
>
>
>

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to