The Cross Platform

With the new range of cross-platform runtime-systems, based on WebKit and Node.js, we developers are once again offered the lure of being able to write one application that, with minor differences, works in the browser as a cloud application, on the desktop PC, and in mobile devices.

If you are already versed in the culture of web-based application development, then you’d probably be attracted to the idea of creating desktop applications in JavaScript, with no webserver involved, but with full access to the local machine. There have been plenty of commercial frameworks in the past that provide this functionality, from Adobe AIR onwards, but now we have a range of open-source examples: bulky perhaps, but usable.

Atom, GitHub’s cross-platform hackable text editor, has been getting plenty of attention over the past year or so. It isn’t yet the obvious IDE for developing code for applications but it already has its more specialized uses. Of more interest is the architecture behind Atom, which relies on a cross-platform runtime system formerly known as Atom Shell, now called Electron. This is similar to NW.js (formerly node-webkit), Brackets-Shell or Tint 2, in that it is designed to allow desktop applications written in JavaScript to render the user-interface in HTML5 on ‘Chromium’-based windows, using the Blink layout engine. It uses Node.JS to grant access to the low-level operating system from web pages.

One obvious goal is portability. Atom is a good case in point, and it isn’t the only application being developed with Electron, for this purpose. Visual Studio Code, which is derived from the editor in Visual Studio Online, is also based on Electron. It is very focused on JavaScript/Typescript/CSS development, though it does allow some C# development. It was created with the aim of providing the IDE that will allow C# code to be developed as easily for all major platforms, using all the conveniences to which users of Visual Studio have grown accustomed.

So why, when we are supposed to be moving applications from the desktop to the cloud, do we, at the same time, need to move in precisely the opposite direction? It isn’t just the portability, the lure of automatic updates, crash reporting, and easy Windows installers, or the ubiquity of the use of JavaScript. It is being able to use web-based applications on occasionally-connected devices, or ‘phones’ to you or me. Now that mobile devices have converged evolutionarily with laptops, sprouting a keyboard and stylus, they are becoming far more important. The market is demanding applications that just work as you’d expect however they are hosted, and however well-connected the device. This type of cross-platform runtime system may well make life easier for application developers who need to meet this sort of demand.