Google has released Chrome 14 to the Chrome beta testing channel, which includes, among other new features, the initial beta release of Google’s “Native Client” technology, first announced in 2010 . . . Native Client is a set of open source tools that allow Chrome to run compiled C and C++ code the same way the browser currently runs JavaScript or other common web programming languages. Native Code offers both a security sandbox and a set of interfaces that provide C and C++ bindings to the capabilities of HTML5. That means web application developers will be able to tap into desktop libraries to create faster, more powerful web apps.
ActiveX all over again? Pls don’t mod me down for asking this question, as I’m not intimately familiar with this technology. But running native code on the client side just sounds like a bad idea; not only for portability, but also security; I don’t care whether it’s sandboxed or not. And I don’t even run with NoScript turned on, so there’s a lot of people out there more paranoid than I am.
Edited 2011-08-14 22:58 UTC
From what I understand of the design, Native Client is about as secure as a heavily audited Javascript runtime. They did some pretty clever stuff at the compiler level to sandbox the code at compile time.
My main concern is the fact that this could easily be the new Flash as far as putting closed-source blobs into web pages goes and, unlike Flash, native code isn’t trivial to decompile to a form you can read.
Also it is architecture dependent, so even worse than flash! It will only work for one CPU architecture, so if it’s compiled for x86 it won’t run on your ARM handheld or the yet unknown computer architecture of the future. Also can you get a “a script on this site makes your browser slow. quit the script?” for NaCl? I’d doubt that. After all you can use threads in it. So one could spawn hundreds of threads all doing “while(1);” thus DoSing the client computer.
It would be a better move to invent a new statically typed language for the web that can be properly JITed and optimized. WebGo? But still, someone has to convince me that we really need this.
It’s not that bad.. first, you can cross compile your stuff so it also runs on ARM (there’s nacl for arm), second.. they are working on pnacl, which should be the same but instead pack an intermediate code that compiles to native on each platform..
The real problem is that very few developers/companies will really care to compile and maintain code for architectures (and OSs) other than the most used one.
And the pnacl will be treated as the slow bastard cousin of the package, nothing more than a glorified javascript.
Huh? Not according to Ars:
Ah but probably I have misunderstood. I guess developers will compile for a specific architecture before distribution?
Edited 2011-08-15 08:14 UTC
You can’t really compare it with ActiveX. Both run bitcode granted, but the execution environment is very different.
ActiveX didn’t really have a sandbox and could access system stuff easily (just needed your one-time permission). In contrast, NaCL is a subset of the bitcode that is executed in a sandbox.
Actually, I believe that NaCL will be more secure than JavaScript. Not initially, but the surface of attack should be more or less constant in contrast with JavaScript where the surface expands for every feature that is added to the language.
So now we can not only access the GPU, but also run native C/C++ code in the web browser.
Imagine the possibilities, one day computer will just boot up into a web browser…oh, wait they already can.
This is what Microsoft feared back in the 90’s.
Edited 2011-08-15 05:16 UTC
I for one really like my desktop.
Me too.
Yeah I know the code is supposed to be audited, but then again for that I already have Java, Flash, .Net and Silverlight. All of which are actually more portable across browsers and OS than Chrome’s solution.
I guess Google also wants to join the plugin game.
Since they already have gcc-nacl, they can take advantage by reusing quite a bit of existing C/C++ code.
They have already started a nacl-ports effort that has brought over libraries like SDL, for example.
This opens tons of possibilities like running games in a browser or just different scripting languages without too much penalty.
Right now you need the Unity3d plugin or one plugin per game to do decent 3d graphic (like QuakeLive). The frameworks for NaCL don’t exist yet but they will emerge and make things much easier to build.
And bring new opportunities for C++ plus coders.
If the app is mal or compromised you also have the advantage to kill it app centrally on the cloud without thousands of installs. (if the sandboxing works well)
Also “always have latest patch” software.