Having two competing implementations forces both into a performance competition, and encourages work on standards to ensure compatibility. Firefox switching to V8 might help in the short term, but long term it would likely be to the detriment of everyone
Lars Bak, the v8 head:
"In 1994, he joined LongView Technologies LLC, where he designed and implemented high performance virtual machines for both Smalltalk and Java. After Sun Microsystems acquired LongView in 1997, Bak became engineering manager and technical lead in the HotSpot team at Sun's Java Software Division where he developed a high-performance Java virtual machine.".
The same source says SpiderMonkey is about 540k sLOC.
Bak has learned a lot of lessons along the way I'm sure, and unless Cliff Click decides to write VMs again (sounds like he's semi-retired, doing something else) then he may be the best person for the job. But nobody's perfect. For me this is Exhibits A-C.
One day JS engines will add cryptographic signatures to replace the complex origin rules and they will unify the WebAssembly workflow with the JavaScript code pipeline and we'll have a full JVM again.
Signed HTTP exchanges might give you that already, AFAICT.
The other thing Donald Knuth is famous for is getting so fed up with typesetting for his books, he created a document format to help him keep his sanity. And then went way way down that rabbit hole instead of finishing his book series. One might argue that's not sanity-preserving.
V8 gets to benefit from all that research, while simultaneously having far more resources (now as well as for the past many years) to apply it, as well as do more of their own.
While you’re correct that some of the knowledge that came out of building the implementation of the JVM has found its way into V8, there’s still cutting edge work being done into extremely sophisticated JIT complication (with graal, arguably the best in the world) and the recent work on GC is frankly stunning.
With recent JVM versions running zgc, it’s typical to see sub-millisecond GC pauses, and that’s only going to improve as they add more collection outside of safepoints and adding generational logic to it.
Net/net, while you’re correct that there’s a lot of innovation and resources behind v8 today and they’re doing fantastic work as well, don’t discount the JVM.
Yes, Java itself isn’t a hugely interesting language, but the JVM is still arguably one of the most impressive bits of software ever produced and continues to be so.
Just wondering why this is the case? Who are the sponsors for GC research?
(HFT outfits?)
By the way does V8 already handle TB sized heaps with 1ms pause?
Or is able to scale down into embedded devices with hundred KB, while respecting real time constraints?
Or able to have an implementation in JS itself?
Or does V8 cache JIT code across sessions and improves it via additional PGO data gathered across the sessions history?
I am not speaking of the same implementation here, rather a taste of what is out there on the Java world.
This is good and all, but splits finite resources even further without a shared benefit, and these variants have as much to do with each other as V8 has to do with Spidermonkey and JScript.