4 ms·
(I work on SpiderMonkey.) I'm also curious about the answer to this. From what I've heard, SM and V8 are both fairly painful to embed. This is all hearsay, but
by sfink 6y ago
(I work on SpiderMonkey.)
I'm also curious about the answer to this. From what I've heard, SM and V8 are both fairly painful to embed. This is all hearsay, but I think V8's API is a bit more stable, it's a little easier to play nicely with its GC though apparently it doesn't fit well with some setups, SM tries hard to handle out of memory conditions (crashing on OOM is a dealbreaker for some embedding scenarios), and the SM devs are said to be friendlier and more willing to help random people.
Related to the previous there's much less of a distinction between core SM devs and community -- there's a steady ramp from showing up on Matrix as a rando to becoming a trusted core member with equal permissions and respect, regardless of employment.
But that last is is from my personal experience as a long-time SpiderMonkey developer, and I've never personally attempted to embed V8 or hang out on their forums.
In practice, people tend to start with one or the other for a variety of reasons, some of them based more on happenstance than anything else. And it's hard enough to figure out how to get going that you'll tend to stick with what you're somewhat familiar with. Strong path-dependence.
- funkaster 6y ago> From what I've heard, SM and V8 are both fairly painful to embed Not sure what's the state now, but years (9?) ago I created the scripting layer for a very popular 2D open source game engine at the time. Had to do it twice: once with JavaScriptCore and the second time with Spidermonkey. Turns out that Spidermonkey was really not that hard to embed and I also ended up creating some nifty auto-generated bindings from the C++ code (using llvm) to Spidermonkey. The runtime to keep track of spidermonkey <> C++ objects was very lean. Overall I had a really good experience and if I had to today, I would probably start looking at Spidermonkey again.
- egberts1 5y agoYou are absolutely correct on all points, @sfink My growl moments come more often with SM over V8. :-D But I got paid for it so it got done.