by bzbarsky · 14y ago · 0 comments
http://www.2ality.com/2012/02/servo.html is worth a read.
> Chrome is the only browser going along these lines
Chrome is using a C++ core with no plans to stop doing that that I know of....
I also think JavaScript is a bad basis for a platform in any case, since it requires loads of complexity to be fast. Why not just a simple typed language or VM? I have read some JS JIT papers and they have found plenty of code generation bugs (more security holes).
For the rest, one of the main points of Rust and servo is to have better security-by-design. Whether the DOM ends up implemented in JS or in Rust is still up in the air at this point, but either one would be much better than C++ from a security perspective.
As for JavaScript, it's what we have due to happenstance, but displacing it involves either a huge amount more complexity in web browsers (to support JavaScript _and_ another language both touching the same objects and whatnot without memory leaks) or just dropping JS entirely and implementing some other language (not exactly likely to succeed). Maybe someone will create a VM that can run both JS and something else well. Maybe. It's not all that simple to do.
We don't need a VM to run JS "well". Nothing going on in the browser is even CPU intensive if not for the huge gobs of complexity going on. People are making simple things harder and harder to do, and complex things easier and easier. If you just write everything for a simple typed VM you don't have to bend over backward to make things run fast. There's nothing going on in the client side of say, GMail, that I couldn't do (faster!) on the computer I was using in 1997.
> Nothing going on in the browser is even CPU
> intensive if not for the huge gobs of complexity going on.
That's not quite true. People do in fact do CPU intensive stuff in browsers, if nothing else because they write algorithmically slow code.Note that GMail is not an example of an application that really does intensive JS. A photo editing app would be a better example.