Sounds like a lot of work (not to say it's not possible or interesting). Our bindings code[1] is pretty complicated already. It depends highly on how Chakra deals with things internally -- if it's similar to SpiderMonkey; I'd be interested in having a look. Might become a fun project :)
Without a reference open source DOM implementation (which we have for SM -- Firefox's DOM), we'd also need good docs for the Chakra API. No idea if that exists.
[1]: https://github.com/servo/servo/tree/master/components/script...
(I'm guessing this would be at least the milionth time they hear about it :) )
I think the person who wrote this particular page simply didn't specify a friendly name, which is why it's falling back to the canonical name.
Will have a look and compare with the spidermonkey bindings when I get time.
Thanks!
Rendering engines (all in C++ except Servo):
- Servo
- Blink (Chrome/Opera)
- Trident/Spartan (IE/Edge)
- Webkit (Safari)
JS engines:
- Spidermonkey (used by Servo and Firefox)
- Chakra (used by Trident/Edge)
- V8 (used by Blink, also by Node)
Servo already uses a JS engine in C++ because a Rust JS engine is a huge undertaking in itself (see [1])
It does make sense to try out Chakra or V8 for Servo. It's probably a lot of work, though. And there may not be a net gain out of that (We have access to in-house spidermonkey know-how, none of that for the others).
Here's a `git grep jsapi` on that folder: https://manishearth.pastebin.mozilla.org/8853940. Haven't removed duplicates or formatted it, so it's probably much shorter than it looks.
Please keep me posted about this!
Stuff like JITs can't really reap Rust's safety+performance benefits[1], and overall the same might be said of a JS interpreter, with all the garbage collection and stuff. The other thing is that Spidermonkey/Chakra/V8 have had years of optimization and tweaks, starting from a clean slate would be _very_ hard. With Servo's small team this is an impossible task, but with a larger, dedicated, team, there's a chance. shrugs
[1]: though it's possible they will still be safer than the C++ counterparts, which is still good. The question then becomes, how much is that increase in safety, and can it justify a whole rewrite?