On Wednesday, April 25, 2012 6:36:12 PM UTC-7, Brandon Benvie wrote:
>
> You probably want to take a second look at dom.js if you're not dead set 
> on C++ because it's the closest to what you're describing. The thing about 
> the DOM and IDL interfaces is that there's an enforced separation between 
> the interface objects and the implementation objects. What this means is 
> that you can load up the impl classes, which contain almost all the actual 
> weight of the code, in one V8 context and then simply generate new 
> interface objects along with a new V8 context each time. The interfaces are 
> generated directly from IDL in fact, just converted to JS and with type 
> adapters like OptionalBoolean, OptionalStringOrNull, etc. (directly 
> translated from WebIDL spec). They use harmony proxies to present as normal 
> objects and forward to the corresponding impl objects that are never 
> directly exposed to sandboxed code.
>
> It's important to note the distinction between something like jsdom and 
> dom.js. jsdom is module that does pretty well in approximating a DOM-like 
> environment. dom.js is a spec compliant (almost) host environment 
> implemented in JavaScript that achieves full separation between 
> implementation and interface. Not the same thing at all. 
>
 

> Also dom.js was developed at Mozilla for use in Spidermonkey, but it works 
> in V8 now (to satisfy your "not V8 specific" requirement). It's very 
> generic in terms of requirements for js environments but it does require 
> WeakMaps and Proxies which limits its use to V8 and Spidermonkey until the 
> other engines implement them.



It's not that I'm dead set, it's just I may not always have a V8 context, 
or any JavaScript context. I'm writing my application in Go (golang.org). 
With Go I can link C libraries (C++ with C wrapper) and call the functions 
directly. I'm using V8 as a way for users to write plugins for their pages. 
In other areas, other than the user's pages, I won't be using V8. Being 
able to load and modify the DOM from Go is also something I need. C++ (or 
even C) is the common link to Go, V8, and even Node.js (or any platform 
that can link libraries). I considered writing this in Go, but then V8 has 
to reach through C++, and then such a library would only be useful to Go 
users. C/C++ is the most direct method for everyone.

Luke

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to