Chrome 14 Beta Integrates Native Client
derGoldstein writes "This year Microsoft kept signaling that it's going back to lower-level code with a C++ renaissance. It would give C++ programmers the same priority that was, up until now, reserved for .Net programmers. They even launched a new show about it on their Channel9. Now Google wants to appeal to native programmers with their Native Client for Chrome. It seems the two companies want to cover both the higher-level JavaScript and lower-level C/C++. I dare hope this will give seasoned C/C++ programmers a place alongside JavaScript programmers at the web development table."
AND replacing Javascript? Where do I sign up?
There's a reason there is no "Disagree" mod...
I dare hope this will give seasoned C/C++ programmers a place alongside JavaScript programmers at the web development table.
Yeah, nothing thrills me more than the prospect of a language with absolutely no memory safety or bounds checking being exposed to the public Internet. What could possibly go wrong?
Dislike the Electoral College? Lobby your state to join the National Popular Vote Interstate Compact.
Intellisense is by far the best C++ dev environment. As much as I hate having to work in Windows, homo technicus beats homo sapien any day. And I find that I write faster and better when I have the right tools than when I have a big ego. If Chrome can produce a better environment AND be the first to support all C++11 features, I'll be happy to watch MS slide into history. Until then, I expect MS programmer base to grow.
Any guest worker system is indistinguishable from indentured servitude.
This would be great if all major browsers supported it, but developing web apps only for Chrome is a now-starter for most of us.
C++, especially modern C++, is such a different language from C, that it makes no sense to talk about them as if they are the same. A decent programmer can learn everything they need to know about C in about two weeks. Modern C++ really takes years to really master. When I interview programmers, I'm immediately skeptical of anyone who claims to know "C/C++". Often, this means the most advanced "C++" feature they use is the // comment.
I heard you like programming, so I put some programming in your program so you can program your program while you're programming.
There are just too many architectures capable of browsing the web now, and some of the most important ones will never support a feature like this (read: iOS). This is the new ActiveX, only without a dominating monopoly and OS integration to push it.
First a story about how .Net is being ignored. And now a story whose headline claims MS has been giving priority to .Net.
Ahh, slashdot.
How's the "Native Client" a big step when we've already seen the Javascript PC Emulator:
http://bellard.org/jslinux/
I guess a Chrome browser pulling up that page, the Javascript PC Emulator booting X to run Chrome to run a Native Client PC emulator would be a neat hack...
Dan
" It is not some kind of C++ interpreter or VM"
Actually, everything that's not kernel code "runs in a VM". Operating systens do memory address translation and bounds check (i.e. not violating other processes memory) during runtime.
Wow, that's so meta. How many beowulf clusters will be needed for that?
C++ is useful for some tasks. However to make it work with the new multi-core CPU architectures is a total PITA. Not only do you have to choose a non-standardized threading implementation you also get a lot of headaches as to which thread owns which object (since you don't want to clean up too early or too late). That's one of the reasons Java and C# are so popular and even people with a huge amount of C++ time (like me) will never use C++ as our first choice again. Basically for whatever small percentage of extra speed you get with C++ on *one* core is totally lost when Java/C# uses multiple cores. Even if you make C++ multi-threaded and garbage collected it requires a much larger development time to get what Java/C# has built in. Even worse than the multi-core issues with C++ is the fact that it is generally not multi-platform (at least for non-trivial programs using graphics, networking sound etc) due to the platform dependencies of the libraries. These days the computing environment is becoming more heterogenous, not less. Aside from the supposed bragging rights of C++ programmers (feel they are somehow superior by using it, but fail to realize the more experienced you are the more you wanna get things done in the easiest way, not the hardest/l33t-est way) there is not much to recommend C++ apart from the memory footprint (and only a few people work on systems that are *that* memory constrained these days, most single-board-units have *huge* quantities of memory, eg. 512 MB compared to the old days).
So, Chrome already sandboxes JavaScript in some of the same ways that they'd sandbox NaCl, but it's not the parser. JavaScript is a relatively simple language, syntactically, and any decent implementation isn't going to be fucking around with it on that level.
My guess is that it's a choice of which APIs you expose and when they're allowed to be called. Since JavaScript can't generate code which ultimately does anything other than call methods or access properties, it entirely comes down to which methods or properties you expose.
I don't think this will be better than JavaScript. I do, however, think it will be better than ActiveX. At the very least, it's actually sandboxing stuff.
Don't thank God, thank a doctor!
Looking forward to stack smashing hacks again. Yay!
Just wait until next month when they're in the triple-digits...
Am I using Chrome 143 or 142? ARGH!
For now; though with NaCl now in a non-dev version of Chrome (its been in dev versions since 7 or so, I think) that probably means that there is going to be more focus on getting PNaCl (Portable Native Client) ready for public consumption, which will see code deployed on the web as LLVM bitcode and compiled to native code at the client, at which point you'll have real portability.
A quick googling finds that PNaCl is scheduled for Jan. 1, 2012 Beta release on Mar. 1, 2012 general release.
If you can run compiled C/C++ code in the browser, you can use pretty much any language you want, since "compiled C/C++ code" includes the compilers and interpreters for most other languages as well. I'm sure there will be implementation tweaks needed to many existing language implementations to get them to work in the NaCl environment, but it'll be a lot lower barrier than reimplementing the compiler to target javascript, or reimplementing the interpreter in JavaScript.
History says you can program the same performance and capability as C++ in .NET, Java, C#, Scala, Ada, and Haskell
What does history say about cross-platform support? Or the availability of a huge existing codebase? Or the fact that practically every major software project is developed using C++?
.Net is getting gently walked off the plank by MS itself. The only languages that keep making a comeback (when people need a solid ground to work on) are C and C++. So far there aren't any exceptions.
If you want to put your money on Scala, be my guest. There's always a cool-new-thing, and it's usually fun to play with. But where's your paycheck coming from? If it's Java or C#, then start updating your resume. Java's legal crap (and Oracle crap) is pushing companies away, and
Entomologically speaking, the spider is not a bug, it's a feature.
This is the new ActiveX,
It's got a sandbox. ActiveX didn't. ActiveX is for writing plugins; this is for building faster webpages.
only without a dominating monopoly
Google doesn't dominate search?
and OS integration
Granted, it's not integration into a monopoly OS, but it's integrated into Chrome OS.
Now, on to the real points:
There are just too many architectures capable of browsing the web now,
Really?
I count three that anyone cares about anymore: ARM, x86, and x86_64. If you're feeling generous, PPC and PPC64. And if you compile one nacl binary for, say, x86, that'll run on Windows, Linux, and OS X. Only reason the x86_64 plugin doesn't do the same (yet) is that Chrome, like all browsers, has stuck with 32-bit only for Windows and OS X until various plugins (*cough* Flash) get proper 64-bit support.
There's also an LLVM variant in the works. You compile to LLVM bytecode, the client compiles it to native code when it's downloaded.
and some of the most important ones will never support a feature like this (read: iOS).
Somehow, I think Android is more important than iOS, and for that very reason.
But how do you know this would never be supported on iOS? It already allows alternative browsers, and that's assuming Apple doesn't adopt this idea. You could make a point that Apple has a vested interest in keeping web development limited on iOS, but so far, they seem to have done just the opposite -- Safari is generally recognized as a decently modern browser with decent standards support, and they often introduce new and interesting things of their own (CSS animations, some of them 3D IIRC).
Now, it may never fly for other reasons, like the fact that very few applications need this much of a performance boost over JavaScript without also needing more than NaCl offers yet (like fast 3D -- can I draw from my NaCl library to WebGL without going through the browser and JavaScript?)
Still, it's an interesting enough idea, and this seems to be the direction things are going. Suppose I can deliver a modern game to you in a browser -- with bandwidth getting faster, I bet I could get you into a demo of my game in under a minute, without you having to install it from some random download site. And even if it were Chrome-only, that's still more portable than Steam -- but there's no reason it has to be Chrome-only.
Don't thank God, thank a doctor!
I wrote was in C. My next in C++
It's harder, but the results are faster. Not that it matters anymore, but in 1995 it sure as hell did.
The Kruger Dunning explains most post on
NaCl is not so much about executing C/C++ code as it is about executing native compiled binaries. This has issues:
It's incredible Google is even pushing this. It's so anti-portable and in concept anti-web.
There is a "portable" version of this, called "Portable Native Client". This means, of course, that NaCl is actually "Non-Portable Native Client" and that should itself be a clue. The "portable" version uses LLVM bitcode and a virtual machine. So more than a decade later, we've basically reinvented Java virtual machine applets minus the gigantic runtime (and language of your choice).
The only people who could possibly benefit from NaCl are Google. There's no general case use for this, and pushing it as standard into Chrome is a nasty move. Mozilla also reject the idea of NaCl. I believe Opera rejects it too (lacking a link). So, why is this being pushed?
Or the fact that practically every major software project is developed using C++?
The page you linked to doesn't really back up that claim. It says right at the top that this page lists only software written in C++. Sure, there is a lot of software being developed in C++, but there is also a lot of software being developed in C (e.g. Linux, most of GNU, most projects on Freshmeat), Java (a lot of commercial development, and a growing number of open source projects, too), and don't forget PHP and JavaScript, which are widely used for programming for the Web (e.g. by Google and Facebook).
Of the applications I use on a daily basis, only my web browser (over time, this has been Opera, Mozilla, Konqueror and Firefox) is written in C++. Most of the rest is written in C, with a handful of things written in Perl and a handful in Ruby. Then again, I don't use Windows. It seems to me that C++ and C# are much bigger there than in the Unix world.
Please correct me if I got my facts wrong.
...is to allow the reuse of code that has already been written in C or C++
At the same time, it makes it easier to port applications and games that have already been written in C or C++ to run in a web browser, hosted on a webpage.
With the NaCl port of Qt, it will also be easy to write applications that can be built to run on various platform, including NaCl.
Native Client (NaCl) is an environment for running native code. That means you can run any language you want. There is already a version of Mono for NaCl, Python, and others.
I've been following NaCl, and it worries me that the compiled code only works on a particular version of Chrome. NaCl 0.5 only works with Chrome 14, 0.4 works with Chrome 13, etc.
http://code.google.com/chrome/nativeclient/docs/running.html#browser
I get it. The Google team must have people just out of college in there that never used Netscape. Seriously, this is called Java Applets. They ran in a sandbox too. Netscape 2 or 3 had a bunch of holes in it from escaping the sandbox. It's been done before! Aside from minor security improvements, it's active x too.
Let's find out how insecure it can be. Let adobe write an app for it and then give security researchers a few weeks.
Worst of all, they used C++. LLVM has terrible support for C++. It's getting better, but it's not there yet.
MidnightBSD: The BSD for Everyone
yes, they are the high end of low level languages, one step above assembly langauge. They certainly are not high level languages like Python, or LISP