6 ms·
Servo is a rendering engine written in Rust, why would it choose Chakra, which is written in C++, over WebKit, which is written in C++?
by nly 11y ago
Servo is a rendering engine written in Rust, why would it choose Chakra, which is written in C++, over WebKit, which is written in C++?
- adrianlmm 11y agoServo is use in production by any browser? or any Project like Chakra? or is just an experiment till now?
- gh02t 11y agoNot yet. I don't think it's an experiment and they are intending to actually use it at some point, but it is still in development right now
- jccalhoun 11y agoI don't think so. From the roadmap it looks like in a year or so it might start to be approaching a beta https://github.com/servo/servo/wiki/Roadmap https://github.com/servo/servo/wiki/Roadmap
- Sir_Cmpwn 11y agoServo currently uses SpiderMonkey as its JavaScript engine (SpiderMonkey is the Firefox JS engine). Sure, a JavaScript engine written at Rust would be useful at some point, but right now that's not on their roadmap.
- DiabloD3 11y agoFrom what I heard, it is on a roadmap, just not on Servo's. Apparently, it'll someday be a sister project to Servo.
- Manishearth 11y agoServo contributor here: Haven't heard of this plan (still could exist), though we do (mostly jokingly) toss the idea around every now and then. There are a couple of not-production-ready Rust JS interpreters floating around (https://github.com/swgillespie/rjs/ https://github.com/swgillespie/rjs/ is the latest I've seen) though. 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?
- pcwalton 11y agoIt is true, though, that a lot of the danger isn't in the JIT but rather in the bindings (e.g. the native implementation of the Date object, or Typed Array Buffer, or what have you), which Rust's safety features could help with.
- Manishearth 11y agoYou're comparing apples and oranges here. 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). [1]: https://news.ycombinator.com/item?id=10682274 https://news.ycombinator.com/item?id=10682274
- nly 11y agoMy bad, I meant JavascriptCore or the JS engines often paired with WebKit. What I meant was, why pair Servo with Chakra and not any of the other Javascript engines?
- apaprocki 11y agoI have a vested interest in creating a SM -> Chakra adapter to swap out SpiderMonkey and be able to compare it to see how it does because Chakra is also an interpreter and not JIT-only like V8. Such an adapter would also make playing with Servo -> Chakra possible. I haven't play with Servo, but is there a list of all the JSAPI calls that it needs to function or can you easily dump that list?
- Natanael_L 11y agohttps://news.ycombinator.com/item?id=10682291 https://news.ycombinator.com/item?id=10682291 this?
- Manishearth 11y agoYep. See also: https://github.com/servo/rust-mozjs https://github.com/servo/rust-mozjs
- Manishearth 11y ago