3 ms·
> JavaScript is actually quite fast these days Do you think a browser written entirely in JavaScript would be competitive with Chrome written in C++?
by criddell 6y ago
> JavaScript is actually quite fast these days
Do you think a browser written entirely in JavaScript would be competitive with Chrome written in C++?
- shadowgovt 6y agoDo I have Google's engineers to develop it and full control over the implementation of the JS engine? Am I allowed to compile the JavaScript to assembly? Because if yes to all of these, then in the abstract, as a thought experiment, I can create an implementation in the JavaScript language with machine code that is byte-for-byte compatible with Chrome written in C++. Step one is write a C++ compiler in JavaScript... ;) ... but more importantly, I don't know how the question is relevant to the question of whether a JavaScript implementation of render commands into a canvas might be faster than a JavaScript implementation of layout declarations that have to play a bunch of games to get desired results from a C++ renderer. The gains from C++ render performance start to get lost if the renderer is making a bunch of wrong guesses about what should be rendered and when.
- tshaddox 6y agoThat's kinda a weird question, since it would obviously depend on what is executing the JavaScript for the browser written entirely in JavaScript. Chrome doesn't ship C++ code to your machine, they compile the C++ to native code for your particular hardware and operating system (presumably with a great many differences and performance tweaks between each compilation target).