Google Chrome supports C and C++. Google lately added the Native Client (NaCL) technology to Chrome’s latest version which can execute native C/C++ compiled code inside the browser. HTML5, JavaScript, CSS3 are the programming equipments powered the web (client side) so far, now the list incremented with C and C++.
Why native code is needed for web now? Web and Cloud based computing are more popular today, lets take the example of any online text editor like Google Docs (docs.google.com) or Microsoft’s Docs.com, you can see that those programs are running in your browser, and computes the data locally and then updates it to the server. To build a program that can run in browser the only available programming language is JavaScript. Coding in JavaScript is a very difficult task for programmers. So if the browser supports any other language like C/C++ or Java, the programmers leverage on it to develop applications. Programming in native language is much easier than coding in JavaScript.
How it works? A programmer writes his application in C/C++ and the code is compiled. Now the compiled code is downloaded by the browser and runs in the same. Browser can not run the C/C++ code, here comes the NaCl, in which the program is executed. So more or less this online application works like a desktop application. Refer NaCl developer site.
Next is, interface. The program runs in NaCl and GUI designed in HTML, CSS, and JS rendered in the browser, these two sets are connected by an API called Pepper. The message passing between the web page and Native program running in NaCl are handled by Pepper. NaCl is the chemical formula for Sodium Chloride, which is nothing but a normal table Salt. So its salt and pepper combination makes this working.
Google says that NaCl will be available for every other browsers and in near future it is going to support more languages. NaCl Developer site and Google Code page has NaCl SDK, Demos, C++ tutorials etc.
Written By Sakthi Tharan (tharansakthi)
About Author: Developer and Web Designer, blogs about latest technology and tech news.

