I’ve been reading a lot about programming languages lately. Many exciting new languages have come out in recent years, and the use of multiple specialized languages within a single project has become much more common, thanks largely to the polyglot JVM and .NET platforms. It’s an exciting time to be a programmer.
Unless, of course, you’re programming user interfaces for the web. Which everyone is.
As Jeff Atwood has said, “Everything that can be programmed in JavaScript will be.” That’s because the browser is the most popular operating system on the planet, and JavaScript is its lingua franca. But no one likes JavaScript. Or, more precisely, no one falls in love with JavaScript the way that people fall in love with Ruby or Python or (my favorite of late) Scala.
I never fully understood why JavaScript was so kludgy and inelegant until I read the (highly recommended) interview collection Coders at Work. Long story short, one guy at Netscape (Brendan Eich) threw the language together in ten days, with the stated goals of creating something semantically Scheme–like but syntactically Java-like. Good god!
So why are we still, 14-odd years later, still using the same language for all of our webapps? Because even if some backwards-incompatible NewScript were introduced, standardized and embraced by Microsoft, Mozilla, Google and Apple tomorrow, most people would take years to update to a browser sufficiently newfangled to run it. Heck, most people don’t even know what a browser is. Thus, new webapps have to be written in a half-baked language to be run through decade-old interpreters.
But there is a solution. And for all I know, Sergey Brin and Larry Page are already plotting its execution from their orbital battlestation. (Where did you think those Google Earth pics come from?) What we need is a new language for web browsers (or, better yet, a virtual machine standard that could support multiple languages), along with a compiler that can generate JavaScript for the benefit of old-timers. The project would be insanely difficult, but it’s half-done already. Look at GWT, which lets you write Java that compiles to JavaScript. Now suppose that a browser (say, Chrome 5) could run GWT’s Java bytecode directly, bypassing JavaScript altogether. Chrome 5 users would enjoy a much smoother and potentially richer web experience. Meanwhile, older browsers would still present a perfectly usable webapp. And programmers everywhere would rejoice.
That, I hope, is the future of the web. So please, Google, I urge you: Don’t let my children grow up in a world that runs on JavaScript.
Tags: coding web 2.0No Comments

0 responses so far ↓
Comments are closed.