03 January 2011

Other Languages For Web Platform

When one thinks of a development platform one would expect that multiple languages would be able to access the platform APIs. With the web platform this isn't the case. Only JavaScript is supported across most web browsers which means it is the only official language for the web platform. Any other language that wants to access the browser/web APIs must go through JavaScript which isn't an acceptable situation. Increasingly more and more languages are going down the compile to JavaScript route. Hence it provides a clear indication that developers want to develop front end web applications in a language other than JavaScript.

Considering how JavaScript has no real competition since there are no other languages embedded in the web browsers it is time that this changed. I am surprised that the current situation of JavaScript only for web development has gone on for this long. Why are no other major browser makers incorporating other languages? For a start a browser maker like Google or Mozilla could incorporate a language like Visage for instance.

It comes as no surprise that JavaScript has undergone very little change due to the lack of competition (think no languages). When some of the details for JavaScript 2 were released there were few big changes made to the language. Imagine if JavaScript had actual competition, think of how much more improved JavaScript would be with the next major version.

The best way to incorporate other languages in a browser would be to have something similar to byte code running in a virtual machine (VM). As such any language that wants to access the browser/web API would need to be compiled first, unless there is an alternative way. Using a VM instead of embedding each language would help to keep the download size of each browser to a minimum. Naturally compile time would be the main bottleneck unless it is kept to a minimum. Now this would be a worthwhile challenge for Google (a fast performing browser VM)!

By incorporating a VM instead of embedding languages in a browser any language would be able to run in the browser (provided it runs in the VM), without requiring a separate runtime to be installed. For the future of web development this would be the next big evolution (not referring to Web 3.0) moving forward. If this is to work then the same system needs to be used by every major browser maker.

What browser makers will take up the challenge of incorporating other languages by implementing a cross platform virtual machine? Even though the challenge is great all it takes is for one browser maker to get the ball rolling.

No comments:

Post a Comment