|
|
|
|
|
by mmastrac
5895 days ago
|
|
CLI might be well-defined, but you're going to have to implement this VM from scratch in every browser on top of the existing JS VMs. Alternatively you could ship the same VM code with every browser (unlikely - hasn't happened for JS yet) and now you've got two VMs running in every browser with twice the surface area for bugs and security exploits. Now that you've got the CLR running in the browser, you've got to figure out a way to map it to the existing JS semantics. Microsoft's existing JScript.NET mapping isn't cleanly compatible with the prototype-based inheritance of the Javascript you're writing. Re: legacy baggage, see: - the parts of the basic .NET framework that shipped with 1.x and were effectively deprecated during the switch to 2.0, ie: System.Collections vs. System.Collections.Generic. - the DLL specification, in which .NET assemblies are wrapped. If you're not shipping a framework, what do you win by shoehorning an existing bytecode specification into the browser, except not having to write that bytecode specification again? The web has different requirements than a desktop/server application and needs a runtime built for the web. |
|
I don't see the problem with legacy baggage though - you don't have to ship all classes. Stripped profiles such as Compact Framework for handhelds have been already created - there's nothing stopping people from creating a new one for the web. The DLL point is a bit moot - it's just a wrapper, it works. If it's too much overhead, you can start sharing the CIL itself instead (the content is standardised afair).
You win a common execution environment. You proposed a common bytecode, but there are only so many ways in which you can implement the runtime environment in that case - each opcode has to be precisely defined. Even if each browser implemented their own, it would most likely be a complete engine redesign with very limited current code reuse. They'd have to either create everything from scratch, or reuse (for example) the DLR and CLI and implement the JS -> DLR compiler on top of them. So that's exactly what you win - not doing everything from scratch.