An Update on Google Native Client
Beside C/C++, Google Native Client has added support for runtimes such as Mono, and a richer set of Pepper interfaces: accelerated 3D, full-screen, File IO, debugging, and others. New languages -Lua, TCL, OCaml- are being ported, and several major producers have ported their game engines or their games to NaCl.
Google Native Client (NaCl) represents an interesting case. When the whole industry shifts towards HTML5, trying to get rid of plug-ins in browsers, when Flash is abandoned and Silverlight’s fate is uncertain, to say the least, Google is creating a new plug-in meant to bring legacy and non-web applications to the browser. This may have something to do with enlarging Chrome’s market share and especially with Chrome OS’ adoption. (NaCl is currently supported on Windows, Mac and Linux, but it will be soon supported on Chrome OS.) Many have complained about Google OS’ lack of support for legacy applications, and the inability to work offline. Both these issues are close to be solved with NaCl and GDocs Offline.
Started more than a year ago, NaCl made its debut in Chrome 14 beta in August this year with support for C/C++ native code and a subset of Pepper interfaces including 2D graphics and audio. Since then, Google added support for hardware-accelerated 3D graphics via OpenGL ES 2.0, full-screen, mouse lock, File IO, URL loading, debugging, and others.
Recently, Google held an event with several game producers, including Square Enix, Unity Technologies, and Bungie, showing off some of their games running inside Chrome via NaCl. Unity and Zipline (Moai) have ported their game engines to NaCl, while Spacetime Studios ported Star Legends, a half a million lines of code, to NaCl in two weeks. This is meant to show the capabilities of NaCl: if large games can run in Chrome, then many legacy applications can.
A notable case is represented by Supergiant Games’ game, Bastion. Bastion is originally a XNA game and it was ported to Mono, and Mono 2.10 was released in October and added support for NaCl, but the code is currently not ready for prime time, according to Elijah Taylor, a Mono developer who forked Mono back in 2010 to make it work on Chrome’s plug-in. Initially Mono applications needed to be compiled AOT in order to run inside NaCl, but Google added support for runtimes, including JIT and garbage collection.
Other languages and frameworks are currently being ported to NaCl, such as: TCL, OCaml, Qt, Lua, Google Excacycle (a research tool used by Google internally), plus a number of classic games including Star Wars, Duke Nukem, Descent, Indiana Jones, Falcon, and several others which have been already been ported with more games in the works.
Although NaCl has had some success with several major games, the plug-in is still not a production-ready product, so developers should expect some limitations. Although development can be done in Eclipse/C/C++ or Xcode, there is no IDE debugger yet, no support for hardware exceptions, inline assembly, process creation, networking sockets, high performance timers, and a few other features. Also, Visual Studio is not supported yet, but Google plans a plug-in for it.
NaCl is not recommended for web applications doing high-intensive DOM manipulation, but otherwise being suitable for CPU-intensive apps that are intended to run in the browser across multiple operating systems. It remains to see if Chrome with NaCl will bring to life more legacy games and apps, and if new apps will be developed.
Srini Penchikala Aug 21, 2014