The Universal Runtime
In the coming years another billion people will get online. They will do it with their smartphones instead of what we consider computers. And their experience will be quite different from ours when we initially started using the internet.
Despite its promises, it looks like the post-PC ecosystem will be a lot more restrictive than the PC one was even in the worst days of the wintel duopoly. For a while it looked like software freedom might be one of the cornerstones of the new world, but since then it has been shown that the tech giants Apple and Microsoft, together with the American content industry, will ensure that this new environment is more tightly locked down than anything we've seen before.
These companies will have a say on who gets to create something, who to distribute it, and who to use it. Users will be 'protected from themselves' by enabling these devices to run only code approved by the company. We've already seen that this approval can be declined, or even retroactively withdrawn on a whim, and on grounds more political than technical.
If we want to ensure digital freedoms for ourselves, and for the people only now reaching across the digital divide, we must act. We must find ways to enable creativity to happen on these new devices. We need to find ways to enable people to create, distribute and use any software on their phones, regardless of what locked-down ecosystem their mobile operator pushed them into.
Luckily there is one programming environment, one runtime that even the most restrictive players haven't had the courage to lock down: the web. Web browsers, coupled with the modern, fast JavaScript engines, could be the tool to build the next step of the free software revolution. We must embrace it.
JavaScript is already fairly prominent in free software development. The GNOME Shell has been largely written in it, Qt Quick builds on it, and most of the common JavaScript libraries are free software. There are even ways to run JS as a server or build your own desktop applications with it.
For those looking to get started with JavaScript, here are some useful resources:
- Eloquent JavaScript is a free e-book that provides an introduction to the language. Read especially the chapter on functional programming
- CommonJS is a specification for writing interoperable JS modules. There is a tutorial on writing modules that work both on the browser and the server
- Backbone.js is a useful Model-View-Controller system for JavaScript. We use it with Midgard Create
- For those who dislike the JS syntax, there is CoffeeScript that provides a cleaner way to write your code. It compiles to JavaScript much like Vala compiles to GObject-oriented C
- Cloud9IDE provides a web-based IDE for JavaScript development. It integrates with Git repositories, and you can either run your own instance or use the hosted version
- JSLint is a good way to check your code for hidden problems
- The JavaScript Garden is also a good source of documentation
While there will never be a "one true language" to program in, JavaScript has the potential to be a big thing. And for writing and sharing software across platform boundaries, it may be the only way. It runs even on the most walled of gardens.