This week, the Chromium project offered a sneak peak to its Native Client SDK.
This project enables the browser to process C and C++ in the client and interface these methods and encapsulations with HTML and JavaScript. Additionally, the project provides bridges to portable graphics and audio engines in an attempt to further configure the browser for visual processing speed.
Why Do Web Clients Need C++?
It seems particularly appealing to have the ability to have more graphics power and speed by using native libraries for C and C++. From the Chromium blog:
“… the SDK lets you write C/C++ code that works seamlessly in Chromium and gives you access to powerful APIs to build your web app.”
Here, in Google’s video, Henry Bridge, program manager for the SDK shares the scenario of building a video editing application and where native C++ code fits in to the web development paradigm.
This demonstration shows weaving of HTML, JavaScript, and C++ methods in peaceful co-existence. One of the nice things about the interfaces from the native SDK, showing an implementation of NPAPI that implements Open GLS 2.0.
Lower Level Virtualization, Everywhere
We took a quick look at the project comments to see what the initial reaction is from developers.
One of the themes heard from developers want Google to go further with cross compatible libraries and abstract itself with LLVM (Low Level Virtual Machine) approach towards interfacing with specific compiler implementations.
From what we see, Google is planning on enabling additional compilers and plans to support LLVM in time.
The company is inviting developers to start building with the SDK now.
Beyond JavaScript
Dan Lewis, from the Native Client SDK team will be sharing thoughts on when and where it is best to use native code (rather than JavaScript) at the upcoming Google I/O event.
“Although JavaScript performance is rapidly increasing, there are still applications for which native code is a better choice. Learn about Native Client and how you can use it to build rich applications with all of the advantages and power of the web.”
A Few Architecture Musings
Several things come to mind when thinking about the connection of browser, compilers, and the cloud in respect to Native Client SDK.
- Will the adoption of C++ in the core influence implementations in the back-end service design? If you know your client has a native compiler will web service orientated services package lower level objects to the client?
- Will the OS share implementations with the browser in the future for compiling code, or will the browser continue to bring in more OS layers over time?
- Will tools like Flash also implement similar strategies, and/or share libraries such as the one’s being packaged in the Native Client SDK?
- Will this influence web frameworks like PHP and other tools that also have been implementing C and C++ compilers to speed up operations. Will there be tighter coupling of processing and will local clients have options on how much to process locally?
- Is this an prelude to a disrupting the games market, but offering a powerful enough browser to process games today? Can existing game code be ported easily and wrapped in a web view?
Google is making progress in emphasizing the browser the default experience for application frameworks and bringing C and C++ libraries into the mix makes sense for higher-order fun in building compelling tools.
Web developers, are there places in your code that you would want to always default to lower level libraries such as C++?