Open Letter to ???22 Apr 2014
I think the interest in transpilers is really a sign that developers want freedom to choose their own programming language for the client side. Devs should not have to use two different codebases for client and server, nor should the web browser dictate the choice of server language. I don't believe in "one language to rule them all" and I am hoping you don't either (indeed, Google and Mozilla are working on multiple programming languages each). However, I do think devs should be allowed to choose one language, and not have the choice dictated "from on high". I want to help create freedom of programming languages on the web, but it's such a major task that I could only do it as part of a Google or Mozilla team.
What I'd like to see is a new VM that is specifically designed to run a wide variety of languages with high performance, in contrast to the Java VM which was designed for one language (and not for high performance), and the CLR which was designed for a few specific languages (C#, VB, C++) but turns out to be unable to handle key features of many other languages. The CLR wouldn't support D or Go very well and probably not Rust either; for example, there are two general-purpose pointer types in the CLR: one type can point to the GC heap and one type can point to non-GC "native" heaps, but you cannot have a pointer that can point "anywhere", which is a feature D requires. So we should create a new VM, which
- should contain a variety of flexible primitives so that the core features of all known languages can be supported in principle
- should be high-performance, like Google NaCl. Some apps need C-like performance, there's no doubt about it or way around it; the good news is that a single VM can offer high performance and power and ease-of-use all at once.
- should use a bytecode that is designed for optimization (LLVM bitcode seems like a reasonable starting point), but is non-obfuscated (fully decompilable) by default.
- should allow and support garbage collection (but not require GC-based memory management)
- should allow multiple threads or some other parallel processing paradigm
- should be designed to allow code from different languages to communicate easily
- should have a standard library of data types to
- promote interoperability between programming languages, and
- avoid the need to download a large standard library from server to client
This entire web site is devoted to cross-language interoperability. But I know that this web site and the solutions I want to build are not the best use of my time. To me it is obvious that language interoperability is an important topic, but the single best place to work on this issue right now is the place where I'm not working: inside the web browser. But I can't create a quality VM by myself, and no one will pay me to do that. Until Google or Mozilla decides that the world needs a fast, flexible, low-level VM with high-level features, it won't happen. (Edit: well, now that MS has open-sourced large parts of the CLR, maybe I actually could accomplish something as one single person. However, it wouldn't interest my current supervisor at my university.)
Thanks for listening. I would love to be a part of a team that creates the VM, but mainly I hope Mozilla or Google will consider moving in this direction. Whether I get to be a part of it or not, the important thing is that somebody makes it happen. Because the software industry needs this.
< Published on CodeProject >