2 ms·
Thanks for sharing. That's very interesting! > We use both spidermonkey and v8 in custom environments Are you using SpiderMonkey on the server-side, too? I wo
by cpeterso 13y ago
Thanks for sharing. That's very interesting!
> We use both spidermonkey and v8 in custom environments
Are you using SpiderMonkey on the server-side, too? I work for Mozilla and some community members are interested in rebooting "SpiderNode", Mozilla's 2011 proof-of-concept to plug SpiderMonkey VM into the Node server. SpiderMonkey supports more ES6 features than V8 (or node --harmony), so SpiderNode developers could use more ES6 features on the server-side without worrying about browser compatibility.
- apaprocki 13y agoYes, most of the production JS is running on spidermonkey. The original binding is hand built using JSAPI, but the newer code we have abstracts the JS engine away behind an interface, making a single way to easily bind C++ classes to JS, allowing us to swap in spidermonkey or v8 without the bound code being aware. This is kind of what you want to do, only you want to emulate the v8 API to avoid having to retool the Node guts. Two different approaches but they achieve the same result. IBM guys working on the POWER node port asked if we can open-source the abstraction and adapters -- it's on my todo list to look into, but can't promise anything yet.
- cpeterso 13y agoMozilla has a prototype of what you suggested: "v8monkey", an API facade that emulates the v8 API on top of SpiderMonkey's JSAPI. A contributor named Sarat recently unbitrotted v8monkey and ported it to SpiderMonkey's current JSAPI (which was rewritten to support Generational GC). He posted his patches just three hours ago. :) https://bugzilla.mozilla.org/show_bug.cgi?id=1005411 https://bugzilla.mozilla.org/show_bug.cgi?id=1005411