Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Chrome 14 Beta Integrates Native Client

Soulskill posted more than 3 years ago | from the going-native dept.

Chrome 209

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."

cancel ×

209 comments

Sorry! There are no comments related to the filter you selected.

C++ Making its way to the web? (1)

trunicated (1272370) | more than 3 years ago | (#37073324)

AND replacing Javascript? Where do I sign up?

Re:C++ Making its way to the web? (0)

zget (2395308) | more than 3 years ago | (#37073376)

Why would it be replacing Javascript? It's just for those situations where you want to run something that needs better hardware access, like games. Judging by the documentation it doesn't even have access to the DOM. Besides, I don't think other browsers will be implementing it anytime soon. It's just another Chrome-only thing they're adding to try to break compatibility.

Re:C++ Making its way to the web? (3, Insightful)

YodasEvilTwin (2014446) | more than 3 years ago | (#37073508)

There is no native client standard. They can't break compatibility by adding completely new features unrelated to anything else. They'll just result in web games etc. that only work in Chrome. It's like saying that Apple is "breaking compatibility" by making apps that don't work in Windows.

Re:C++ Making its way to the web? (0)

zget (2395308) | more than 3 years ago | (#37073592)

There also weren't any ActiveX standards, but people still seemed to hate when Microsoft added non-standard features to IE. Just when we seemed to get a standard web browsing experience Google comes in and starts adding its own features. Soon were back to the web where one site works with one browser and another site works with other and you have to switch between browsers.

Re:C++ Making its way to the web? (1)

bragr (1612015) | more than 3 years ago | (#37073628)

At least Chrome is cross platform and open source(ish). So its not quite the same thing.

Re:C++ Making its way to the web? (1)

SanityInAnarchy (655584) | more than 3 years ago | (#37074056)

Chromium is open source.

And yes, it's cross-platform and actually sandboxed. Unlike ActiveX, this actually would be a reasonable alternative to JavaScript.

Re:C++ Making its way to the web? (1)

PCM2 (4486) | more than 3 years ago | (#37074362)

Note that NaCl code is only cross-platform in the sense that it's OS-independent. Being true native code, it's not processor-independent; if you want NaCl modules to run on x86, x64, and ARM, for example, you need to have compiled three separate versions of your NaCl binary, one for each architecture.

PNaCl addresses this concern (1)

DragonWriter (970822) | more than 3 years ago | (#37074644)

Note that NaCl code is only cross-platform in the sense that it's OS-independent. Being true native code, it's not processor-independent; if you want NaCl modules to run on x86, x64, and ARM, for example, you need to have compiled three separate versions of your NaCl binary, one for each architecture.

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 [chromium.org] for Jan. 1, 2012 Beta release on Mar. 1, 2012 general release.

Re:C++ Making its way to the web? (2)

Riceballsan (816702) | more than 3 years ago | (#37074480)

I do believe the point is they are trying to make their changes as something plausible for the competition to follow. Google's goal is to ensure that they can do what they want to do on their web pages, they couldn't care less if the user is looking through chrome, Firefox or even IE, that is if they can make their software work in that format. The difference between active X and C++, is Google WANTS Microsoft and IE to follow suit and add C++, while active X was designed as something that Netscape couldn't do if they wanted to.

Re:C++ Making its way to the web? (1)

shutdown -p now (807394) | more than 3 years ago | (#37073664)

Just when we seemed to get a standard web browsing experience

We did? I still see a lot of "-webkit-" etc in CSS for those new and shiny HTML5 websites.

Re:C++ Making its way to the web? (1)

derGoldstein (1494129) | more than 3 years ago | (#37074136)

Yes, but it's not nearly as bad as when you had to accommodate IE6. The "-webkit-/-moz-/-ms-" hacks are usually just to add extra graphical detail, not actual functionality. Then there's the DOM and XHR stuff, to which there are plenty of solid, fast solutions that are plug-and-forget. You no longer have to make a chart of "browser capabilities" before starting to design a web app. HTML5 is still in Draft/Working Draft status, but in practice things aren't nearly as bad as they were ~3 years ago.

Re:C++ Making its way to the web? (2)

bragr (1612015) | more than 3 years ago | (#37073614)

I don't see it that way. There is no argument that Google is web company, and people can only experience the web through the browser, which means that the features that the "average" browser supports is a limiting factor in what Google can do.

I've always seen Chrome as a way for Google to stimulate other browsers to be better and drive innovation. Every since Chrome came onto the scene, showing off its fast rendering and javascript engine, other browser companies have had to step up their game, which is good not only for Google, but the internet as a whole.

Will other browsers support it? Maybe? If it turns out to useful, and programmers like it, I bet you can expect to see this in Firefox fairly soon. If not, it was an interesting experiment.

Re:C++ Making its way to the web? (1)

derGoldstein (1494129) | more than 3 years ago | (#37074012)

I've always seen Chrome as a way for Google to stimulate other browsers to be better and drive innovation. Every since Chrome came onto the scene, showing off its fast rendering and javascript engine, other browser companies have had to step up their game

That's true, and that may have been the initial intent, but they've been pushing the Chrome browser like practically no other product of theirs. A Chrome ad appears on Youtube pages very frequently, in several formats, and "types" of ads (some are animated, some are still images saying something like "browser faster"), and they keep making oddball viral-ish Chrome campaigns. I can't think of any product they push this hard (although Google+ may change that).

Chrome market share has [gigaom.com] been [arstechnica.com] rising inexorably since its release.

It's not just a tech demo anymore. They want the browser market.

Re:C++ Making its way to the web? (2)

PCM2 (4486) | more than 3 years ago | (#37074226)

It's not just a tech demo anymore. They want the browser market.

Ah, yes... that lucrative, lucrative browser market.

Re:C++ Making its way to the web? (0)

Anonymous Coward | more than 3 years ago | (#37073738)

It's just for those situations where you want to run something that needs better hardware access, like games.

No, it's for those situations where someone else wants to run something that needs better access, like malware. JS was supposed to be a locked-down scripting language without FS access (beyond browser-managed cookies) or any way of getting your filthy fingers into chaste and pure memory that didn't belong to you. JS knew you were an asshole from the beginning and kept you at arm's length from all that was important; the flaws in JS were usually just bounds-checking errors in specific engine implementations or DOM problems that didn't allow access to the OS, just to a web page (although later people started using the web for Serious Business like banking, and XSS started to really suck). C/C++, on the other hand, gave you the keys to the kingdom. Unless the sandboxing on this is incredible, web-based C/C++ is going to open up potential problems; hardware access is going to open up all sorts of battery- and GPU-lurking rootkit bootstrappers and websites promising free candy (i.e. games) operating out of a van parked under some Russian bridge.

Re:C++ Making its way to the web? (1)

mswhippingboy (754599) | more than 3 years ago | (#37073962)

Judging by the documentation it doesn't even have access to the DOM..

Sure it does.

The Native Client module. This module uses the Pepper Library, included in the SDK, which provides the bridge between the Native Client module code and the web page JavaScript and DOM. Currently, the SDK supports the C and C++ languages. When compiled, the extension for this filename is .nexe.

Re:C++ Making its way to the web? (1)

PCM2 (4486) | more than 3 years ago | (#37074426)

NaCl has access to the DOM via the "bridge" you mention, but in practice what that means is that NaCl's access to the DOM is handled through inter-process communication calls. Google has said that games that rely on a lot of DOM access would probably be better off being written in JavaScript for this reason. The two technologies are clearly meant to be complementary.

Re:C++ Making its way to the web? (1, Insightful)

sqlrob (173498) | more than 3 years ago | (#37073546)

C++ on the web. That worked so well last time [wikipedia.org]

Re:C++ Making its way to the web? (4, Interesting)

shutdown -p now (807394) | more than 3 years ago | (#37073634)

The original ActiveX in IE was designed with practically complete disregard for security. NaCl is the opposite of that - it's a very cleverly designed sandbox for native code.

Re:C++ Making its way to the web? (1)

sqlrob (173498) | more than 3 years ago | (#37073782)

Making sure there's no problems with Javascript is easier than checking native code. Yet there's still flaws with that parser, enough so that most browsers have a "workaround" of "disable JavaScript". Why do you think this will be better?

Re:C++ Making its way to the web? (2)

shutdown -p now (807394) | more than 3 years ago | (#37073906)

Of course, verifying and sandboxing JS is easier. However, JS is not high-perf enough for many real-world applications. The question then becomes whether it is possible to sandbox native code without some mindboggingly complicated scheme. And the answer is yes - and I invite you to read the NaCl research paper [chromium.org] for details. The scheme is, in fact, surprisingly simple - less so than e.g. bytecode verifier for CLR.

Re:C++ Making its way to the web? (0)

Anonymous Coward | more than 3 years ago | (#37074064)

JavaScript is used on every website, and despite that the JS-sandbox environments in IE & Chrome haven't been defeated once by a real-world example of malware. Native Client will be used by a handful of game developers or established companies.

Is it really the parser? (1)

SanityInAnarchy (655584) | more than 3 years ago | (#37074142)

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.

Re:C++ Making its way to the web? (1)

drpimp (900837) | more than 3 years ago | (#37073890)

C++ is over-rated ... we used VB as well and it's the bestest EVAR (shreeeeeek, music stops) /runs for cover

Re:C++ Making its way to the web? (1)

farrellj (563) | more than 3 years ago | (#37074088)

Let me know when they replace Javascript with Forth! :-) ....I'm not holding my breath! :-)

ttyl
          Farrell

Re:C++ Making its way to the web? (0)

Anonymous Coward | more than 3 years ago | (#37074246)

Let me know when they replace Javascript with Forth! :-) ....I'm not holding my breath! :-)

ttyl

          Farrell

It's a way to run native code. If your Forth interpreter or compiled program is native code and can access the necessary ABIs, it'll work. There are various ways to call foreign functions [rosettacode.org] .

Re:C++ Making its way to the web? (1)

Rhys (96510) | more than 3 years ago | (#37074230)

Yes, because what I really want to do is use a language that is terrible at string processing! If this were perl, python, or ruby, I might care. I'd rather learn javascript from scratch, than do string processing in C/C++.

Yeah, I'm so excited (2, Insightful)

AdmiralXyz (1378985) | more than 3 years ago | (#37073390)

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?

Re:Yeah, I'm so excited (1)

epyT-R (613989) | more than 3 years ago | (#37073512)

you mean like when the browser itself is exploited in the same manner by crafted javascript?

the only way to truly secure 'the web' is to remove the ability to script browsers beyond basic formatting that can be done in html.

honestly if we're gonna keep javascript, I wouldn't mind seeing C++ as well..

You're Responding To A Karma Whoring Idiot (0)

Anonymous Coward | more than 3 years ago | (#37073740)

The idiot obviously frantically banged out his inane post in desperate hope that equally stupid Slashdot posters with Mod points would give him knee jerk upvotes.

No wonder every says Slashdot has been circling the bowl for years.

Re:Yeah, I'm so excited (0)

Anonymous Coward | more than 3 years ago | (#37073644)

So, they compromise the sandboxed environment, not a big deal.

Sure, the sandboxing code could have a bug, but then it wouldn't be limited to the Native Client code, it would also be compromised for JavaScript too.

(But yes, I'm mixed - I'd love to see some old C programs made into a web-app, but it's gonna be scary getting there...)

Dan

Re:Yeah, I'm so excited (1)

derGoldstein (1494129) | more than 3 years ago | (#37074294)

It's scary *now*. There are new exploits daily -- search Google News for "new browser exploit". I wouldn't be browsing without NoScript on a computer with any information I care about. I use Chrome only on sites that I know and trust (basically a whitelist). I'd probably use Chrome more if it had a reliable script blocking add-on.

Re:Yeah, I'm so excited (0)

Anonymous Coward | more than 3 years ago | (#37074624)

No, not really. JS hasn't been used as a viable system-exploitation means since the days of Firefox and IE6-7. Since then it's been about the plugins. And plugins like Adobe Flash are inherently weak even when sandboxed because they rely on privileged access for basic functionality, unlike the JS interpreter.

Re:Yeah, I'm so excited (0)

Anonymous Coward | more than 3 years ago | (#37073656)

NaCl code (x86, ARM, LLVM) is being executed in a sandbox, in a separate process, with all of its privileges stripped.

Re:Yeah, I'm so excited (5, Informative)

shutdown -p now (807394) | more than 3 years ago | (#37073682)

I suggest that you read about how NaCl actually works before commenting. It is a sandbox for native code. It doesn't run just any code, either - there are certain constraints in place which make it possible to verify the result for safety. "Safety" here means that code cannot break out of the sandbox - it can, of course, still crash itself, but that would be fully isolated, and cannot be used in the usual manner as a privilege escalation exploit.

Re:Yeah, I'm so excited (1)

PCM2 (4486) | more than 3 years ago | (#37073976)

"Safety" here means that code cannot break out of the sandbox - it can, of course, still crash itself, but that would be fully isolated, and cannot be used in the usual manner as a privilege escalation exploit.

Or that's the idea, [google.com] anyway.

Re:Yeah, I'm so excited (1)

DemonGenius (2247652) | more than 3 years ago | (#37074398)

The walls of a weak sandbox can break, both in real life and in code.

Re:Yeah, I'm so excited (-1)

Anonymous Coward | more than 3 years ago | (#37073770)

"... a language with absolutely no memory safety or bounds checking..."

That's a really astonishing thing to say. STL has bounds checking built in from a variety of standpoints (iterators, anyone?). Basic use of boost::{shared/scoped}_ptr will eliminate 99% of memory issues in unmanaged C++; C++/CLI does the same thing in the managed world.

C++ is a truly wonderful language. Anything that Microsoft and Google can do to get programmers interested in what's going on at a deeper level is fine in my book.

Re:Yeah, I'm so excited (1)

siride (974284) | more than 3 years ago | (#37074190)

I'm guessing you haven't used any languages other than C++. Aside from having a lot of libraries (not all of them good, mind you), the benefit of time (to understand all of the inane quirks of the language and make compilers that are almost halfway decent) and its performance (which other languages are catching up to), it's not a pretty language, it's not elegant, it's not easy, it's not orthogonal. It has a lot of warts and misfeatures. If it weren't for the fact that you can write fast code in C++, I doubt it'd be used nearly as much as it is.

Re:Yeah, I'm so excited (1)

derGoldstein (1494129) | more than 3 years ago | (#37074492)

It's the nature of digital logic. If you want memory management, you need more cycles. If you want "better" (more flexible and succinct) syntax, you need more cycles. C++ is popular because it's the highest abstraction you'll get that's still fast. As long as there isn't some insane quantum leap in computing power, C++ is the best option you have for creating "compute-intensive" software.

Now for my subjective viewpoint: I program using whatever language has better support for the task. I wouldn't use C++ for general server-side development when PHP will do most of the work for me. I use JavaScript on the browser because that's the only option. I use Perl and Python for housekeeping scripts, since they have countless libraries that will serve most of my needs. Having said that -- if there's no specific requirement from the environment, I choose C++ whenever I can. If there was a widely supported scripting language that was basically C++/STL, I'd use it instead of other interpreted languages. C++ is an explicit, flexible, OO language with fewer warts than most other languages. Yes, there's a long "here's what you shouldn't do" list, but once you have that down it's probably the language you have to "hack" the least to achieve your goal.

Re:Yeah, I'm so excited (0)

Anonymous Coward | more than 3 years ago | (#37074050)

Pfft, that's just a myth... Pretty much all C++ code today runs with memory safety and bounds checking, except a bit of kernel-space code and such.

Re:Yeah, I'm so excited (0)

Anonymous Coward | more than 3 years ago | (#37074112)

The fact that this has been modded +5 insightful just goes to show how little the average /. reader understands about (i) C++, (ii) sandboxing, and (iii) basic programming concepts.

Fuck me, this place was bad five years ago but it's absolutely awful now.

well... (1)

superwiz (655733) | more than 3 years ago | (#37073420)

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.

Re:well... (1)

zget (2395308) | more than 3 years ago | (#37073466)

It's Visual Studio. Intellisense is the autocompletion feature...

Re:well... (1)

superwiz (655733) | more than 3 years ago | (#37073498)

Intellisense is also automated syntax checking. There is no other environment which is able to do a full parse of C++ without compilation and determine the errors. There are environment which PARTIALLY accomplish the task, but none do it fully.

Re:well... (1)

JonySuede (1908576) | more than 3 years ago | (#37073624)

netbeans is a quite powerful c++ IDE and contrary to VS it is multi-platform. Have a look at that http://netbeans.org/images_www/v7/screenshots/cnd.png [netbeans.org]

Re:well... (1)

superwiz (655733) | more than 3 years ago | (#37073742)

Netbeans is 2nd best. VS is still #1. But that is not to say that Netbeans is bad. It's really good. It's just not Intellisense. It has it small problems and long-term problems. The small one is that it is too Java-centric. It attempts to use an AST for C++. Which is all fine and good except it doesn't know how to handle "friend". So it ends up not being aware of the methods which are visible in the friended scope. It's long-term problem is that it's in Java. And given how poorly Oracle has handled Java as a platform, it's future is becoming questionable. I certainly would not commit any large project to Java at this point -- not as my first choice. One rarely succeeds on the web by burning bridges as fast as Oracle has been doing it with Java. There is a lot of inertia built into it because the programmer base is so large, but if you look at any of their latest development, it's down-right depressing. They are slashing modules and language support from Netbeans (7.0 doesn't have Python support anymore). They are just an overall mess that brings more headaches than it solves.

Re:well... (0)

Anonymous Coward | more than 3 years ago | (#37074340)

#1 in your opinion. When VS stops being a slow PoS and crashing every 3 hours or so, maybe I'll consider it... But probably not, since almost everything I do runs on Unix or Linux anyhow. Why would I want to make the extra effort to use VS as my IDE when I'd have to write my own make files to use it? Why would I want to subject myself to hourly crashes?

Re:well... (1)

derGoldstein (1494129) | more than 3 years ago | (#37074570)

VS is "slow"? Setting aside the other arguments, I've never heard of VS being called "slow". Compared to what? Not Netbeans, and certainly not Eclipse. Unless you're running it on a netbook, it's the fastest IDE out there -- certainly for C++.

Re:well... (1)

JonySuede (1908576) | more than 3 years ago | (#37074486)

And given how poorly Oracle has handled Java as a platform, it's future is becoming questionable.

That is so true, they shipped Java 7 with a shipload of bugs, I stumble upon one today. And I am pretty sure that i am not the only one as there was a guy in a Minecraft complaining about the same exception.

They have killed a lots of cool research project that I cared about, Microsoft would have funded them as they would have originated from there Microsoft Research Labs. I miss Sun; I might switch to the Microsoft completely and byte the C# apple. Almost all the good library from Java are ported. And it seems that since Windows 7 they have taken the conscious decision to stop sucking.

But that is not to say that Netbeans is bad. It's really good. It's just not Intellisense. It has it small problems and long-term problems. The small one is that it is too Java-centric. It attempts to use an AST for C++. Which is all fine and good except it doesn't know how to handle "friend".

According to this https://netbeans.org/bugzilla/show_bug.cgi?id=179205 [netbeans.org] it is supposed to be fixed since 6.7 but I did not test it so... I hate Oracle so much that I would not be surprised that they reintroduce it on purpose.

Re:well... (1)

jeremyp (130771) | more than 3 years ago | (#37073700)

Xcode 4.1 has that ability.

Re:well... (1)

superwiz (655733) | more than 3 years ago | (#37073944)

Xcode is still GCC 4.2. MSVC 10 has most of the nice features of C++11:

http://wiki.apache.org/stdcxx/C++0xCompilerSupport [apache.org]

Re:well... (0)

Anonymous Coward | more than 3 years ago | (#37074514)

Don't make the mistake of assuming your favourite features are the same as everyone else's. MSVC's support for C++11 is quite far behind GCC (versions later than what's apparently included in Xcode, at least) and misses, for example, variadic templates. Having had a taste of that, I'm not going back to a compiler that doesn't support them.

Also, I think Kdevelop actually has the syntax checking you're looking for. Well, except for C++11 features (last time I looked, anyway). I find that feature rather overrated, though, whether it be the visual studio version or the kdevelop version.

Re:well... (0)

Anonymous Coward | more than 3 years ago | (#37074006)

Eclipse CDT has done this for a long time.

Re:well... (1)

derGoldstein (1494129) | more than 3 years ago | (#37074614)

Intellisense isn't just an autocomplete, it models the entire structure of the code. Classes, methods, function overloading, operator overloading -- it'll catch "deep" errors before you compile. Eclipse has a pretty good general autocomplete, but it's no intellisense.

Re:well... (1)

YodasEvilTwin (2014446) | more than 3 years ago | (#37073476)

You mean Visual Studio. Intellisense is a small component of it, not a dev environment.

Re:well... (1)

bberens (965711) | more than 3 years ago | (#37073704)

Rumor has it MSFT is about to ditch .net developers in favor of HTML 5 + Javascript for "native" applications. Windows 8 allows you to run HTML 5 + Javascript "natively" (at least, as native as .net). The conferences MSFT has thrown lately have been light on .net love. So I expect the MS programmer base to grow, but not C++. C++ and likely always will but that place is shrinking.

Re:well... (0)

Anonymous Coward | more than 3 years ago | (#37074062)

That is for the UI only - I hope people are not using HTML in the backend... .Net/C++, etc...would be used for backend processing and hardcore UI requirement (games, etc...) - yes, yes I know you can do some games in HTML+JS but they are not quite the same yet...

Re:well... (1)

zlogic (892404) | more than 3 years ago | (#37074586)

Javascript may be OK for small applications, but it's using Java+HTML5 to write complex enterprisey stuff is insane.

Re:well... (1)

shutdown -p now (807394) | more than 3 years ago | (#37073722)

I think you misunderstand what NaCl is. It is not some kind of C++ interpreter or VM; it does not "support C++ features". It runs native code. Said native code can be the output of a compiler of any language - there are some restrictions on what the output can look like (e.g. opcodes must be aligned), but there's no inherent restriction on languages. Today, Google supplies a C++ compiler (modded Clang? not sure what it is) that respects those constraints, but anyone can do so as well, including VC++.

And, of course, you can use VS to edit code while compiling it with a different compiler - .vcxproj files are MSBuild scripts, and so you can completely override the default build process and hook up g++ or whatever - and still have your intellisense (though no debugging).

Re:well... (1)

PCM2 (4486) | more than 3 years ago | (#37073908)

Said native code can be the output of a compiler of any language - there are some restrictions on what the output can look like (e.g. opcodes must be aligned), but there's no inherent restriction on languages. Today, Google supplies a C++ compiler (modded Clang? not sure what it is) that respects those constraints, but anyone can do so as well, including VC++.

I guess in theory there's nothing stopping any compiler from outputting NaCl binaries, but at present none does, except for the aforementioned Google toolchain that comes with the NaCl SDK (which is a modded version of GCC). Code output for NaCl carries the extension ".nexe" -- technically it is native machine language, but the binary won't execute anywhere but inside NaCl. The SDK and its APIs are also changing a lot; .nexes compiled with earlier versions of the SDK won't work with Chrome 14 or later. [google.com]

I kicked the tires on NaCl [infoworld.com] for InfoWorld earlier this year.

Re:well... (1)

shutdown -p now (807394) | more than 3 years ago | (#37074078)

I actually suspect it may be possible to write a translator that'd take a PE or ELF binary compiled with a normal compiler, and convert it to NaCl - replacing instructions and padding them as necessary.

Re:well... (0)

Anonymous Coward | more than 3 years ago | (#37074484)

lea ecx, [code_offset+2h]
jne ecx

code_offset:
xor eax, eax
push eax


How do you insure ecx is correct when the xor becomes larger than 2 bytes?

interpreter/VM (1)

sourcerror (1718066) | more than 3 years ago | (#37073912)

" 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.

Re:well... (1)

superwiz (655733) | more than 3 years ago | (#37074002)

No, I didn't misunderstand. I know it's not a tool. I just expect that once Google adapts a language on its platform, it will put some effort into producing some good tools.

Re:well... (1)

shutdown -p now (807394) | more than 3 years ago | (#37074092)

Given their love for Eclipse in Android development department, I'd expect them to just ship it with Eclipse CDT.

Re:well... (1)

superwiz (655733) | more than 3 years ago | (#37074622)

I don't think so. I think they are preparing for a long-term separation from Java. And Eclipse is, of course, written in Java. Actually, I am mostly hoping that they are. I am just thinking that a company which managed accurate identification of web-wide unstructured text should have no problems producing a tool which would be superb at assisting in production of structured text like C++ code.

Re:well... (1)

loufoque (1400831) | more than 3 years ago | (#37073996)

Intellisense is by far the best C++ dev environment.

I guess it's a matter of taste.
I find that Visual Studio is very unintuitive and impractical for the way I code in C++.

In that category, I've had better experience with Eclipse.

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.

With some work, you can probably use any compiler you want, since it directly executes machine code (albeit in a custom executable format, and I couldn't find information about the ABI).
The reference compiler is GCC.

Would be great (1)

mcl630 (1839996) | more than 3 years ago | (#37073460)

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.

Re:Would be great (1)

mcl630 (1839996) | more than 3 years ago | (#37073468)

Non-starter that is

Re:Would be great (1)

shutdown -p now (807394) | more than 3 years ago | (#37073728)

Right now, this seems to be intended for "Chrome web apps" (which also run on Chromebooks), not as a general purpose extensibility mechanism.

Re:Would be great (1)

binarylarry (1338699) | more than 3 years ago | (#37074016)

It's BSD open source though, so someone could write a firefox plugin to support NACL apps.

Please don't use C/C++ (2)

GGardner (97375) | more than 3 years ago | (#37073534)

The phrase "C/C++", that is.

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.

Re:Please don't use C/C++ (1)

superwiz (655733) | more than 3 years ago | (#37073636)

I have a better check for C++ programmers who write C-spaghetti code with classes: they don't have a favorite IDE.

Re:Please don't use C/C++ (0)

Anonymous Coward | more than 3 years ago | (#37073830)

I have a better check for C++ programmers who write C-spaghetti code with classes: they don't have a favorite IDE.

I'd rather use cscope and gvim and my shell any day than an IDE for C or C++. Java, however, begs for IDE assistance, and Eclipse is fantastic at saving me time.

Re:Please don't use C/C++ (0)

Anonymous Coward | more than 3 years ago | (#37073670)

C and C++ are not different languages. C++ is a superset of C. That's it. It adds lots of other useful libraries and features, but C is not fundamentally different from C++. If you know c++ you basically know C.
I also enjoy your different standards. For knowing C it's "everything you need to know," but for C++ you look at how long it takes "to master." Hmm, holding them to different standards much? Fun fact for ya, you can learn everything you need to know about c++ in two weeks as well, and it would takes years to "master" C.

If you say you know C/C++, you probably mean you know C++, and therefor basically know C. Not that you know C and therefor understand all of c++'s OO goodness. Still, they are not different languages. That strikes me as a comment made by someone who hasn't actually used truly different languages.

Re:Please don't use C/C++ (1)

oursland (1898514) | more than 3 years ago | (#37073794)

Quit spouting your ignorance. There are features in C that are still not supported in C++. A commonly used one is VLAs.

So, no, C++ is not a superset of C.

Re:Please don't use C/C++ (0)

Anonymous Coward | more than 3 years ago | (#37073916)

There are also subtleties such as different linkage semantics for the same syntax. C++ is *close* to being a superset of C, but the distinctions are important, especially for those writing headers intended to be used by compiler for both languages.

- T

Re:Please don't use C/C++ (1)

mswhippingboy (754599) | more than 3 years ago | (#37074126)

It doesn't? Granted, it's not pretty, but "not supported" is a bit strong.

#include
using std::va_list;

.
.
.

va_list list; // for storing information needed by va_start

va_start( list, count );

for ( int i = 1; i <= count; i++ )

total += va_arg( list, double );

va_end( list );

Re:Please don't use C/C++ (1)

mswhippingboy (754599) | more than 3 years ago | (#37074156)

That #include should have been

#include <cstdarg>

Re:Please don't use C/C++ (1)

clampolo (1159617) | more than 3 years ago | (#37073872)

Well. Once guy judges programmers based on whether they say "C/C++" or "C and C++". The other one judges them by what development environment they use. That is all you need to know to see how skilled those 2 are.

Re:Please don't use C/C++ (1)

shutdown -p now (807394) | more than 3 years ago | (#37073746)

"C/C++" is not meant to imply that the languages are almost the same, or anything like that. Rather, it's the recognition that these two are the most popular languages that are compiled directly to native code, by a very large margin. Another aspect of this is that many C++ programs use C libraries (SDL, zlib etc).

Re:Please don't use C/C++ (1)

bberens (965711) | more than 3 years ago | (#37073764)

I feel the same way about people who claim that since they know C and/or C++ they could learn Java in a snap. Yes, it's very likely that you will not have great difficulty picking up the Java syntax, since it's C-esque. That doesn't mean you'll be a "Java programmer" in 6 months.

Re:Please don't use C/C++ (0)

Anonymous Coward | more than 3 years ago | (#37073998)

That doesn't mean you'll be a "Java programmer" in 6 months.

You are right. It takes longer than 6 months for Alzheimers to cripple people's brains.

Re:Please don't use C/C++ (1)

JonySuede (1908576) | more than 3 years ago | (#37073806)

that is so true. I know C99 and C++ (but I did use C++ since 2001) and they are quite different.

And C++ only takes year to master if you try to know all the obscure corner case. If you don't abuse the template system as a turning complete language interpreted by the compiler, use operator overloading in a limited way, avoid reinterpret_cast, use variable scope for memory allocation and shared_ptr from boost when you really have to have a new, it is a fine language.

Re:Please don't use C/C++ (1)

JonySuede (1908576) | more than 3 years ago | (#37073828)

I meant did not use c++ since 2001

Yo Dawg (2, Funny)

Anonymous Coward | more than 3 years ago | (#37073580)

I heard you like programming, so I put some programming in your program so you can program your program while you're programming.

Will never fly (1)

Have Blue (616) | more than 3 years ago | (#37073672)

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.

Consistancy! (1)

wasabii (693236) | more than 3 years ago | (#37073688)

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.

Re:Consistancy! (1)

derGoldstein (1494129) | more than 3 years ago | (#37074186)

Check the timeline. Up until this year, .Net *has* been getting priority, to the point where they dropped intellisense for c++/cli in VS2010. Now MS is starting to push JavaScript for Windows 8, and Native(non-managed code) is starting to get better treatment. This isn't a contradiction, it's a change over time.

*yawn* More impressed with Javascript PC Emulator. (1)

dan_linder (84060) | more than 3 years ago | (#37073716)

How's the "Native Client" a big step when we've already seen the Javascript PC Emulator:

        http://bellard.org/jslinux/ [bellard.org]

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

Re:*yawn* More impressed with Javascript PC Emulat (1)

Windwraith (932426) | more than 3 years ago | (#37073988)

Wow, that's so meta. How many beowulf clusters will be needed for that?

Good luck, you'll need it. (0)

Anonymous Coward | more than 3 years ago | (#37073812)

MS is exposing the core problem with general development today.

A lot of [older] hard code programmers learned C++, and only skimmed the newer higher level languages in the beginning--which they deemed inferior and went back to C++. Since we're talking hard code programmers, we're talking solid knowledge of development, algorithm & data structures, and performance.

Now granted a lot of newer higher level programmers lack the breath of development I described above (let's face it, it's a fact) due to the great APIs and frameworks developed using higher level languages, newer [younger] programmers are really API, Application devs. That is who MS sells to, but doesn't want internally unless they "change the game" (namely move the Windows core into .NET and force Intel to write a higher level instruction set API for their CPUs). With the boat load of C++ programmers out there, it's too costly to move to .NET for a kernel.... much like why COBOL and FORTRAN are still around: alive and kicking. The only best example I can think of gaming the kernel game is none other than AndroidOS (a hybrid).

Then there's the fact the higher level languages have evolved to be just as good or even better than C++ [debian.org] , but only the few that jumped the C++ bandwagon in the late 90's in favor of the newer languages and retain excellent development skills can exploit those advantages. That's a small circle of folks. Since no employer is willing to train employees out of C++ into another language, we are still stuck with a huge C++ base of devs. This is no different from the early C++ days, when the best devs went back to C (Linux comes to mind). And this will happen to Java as well with its huge dev base.

History says you can program the same performance and capability as C++ in .NET, Java, C#, Scala, Ada, and Haskell, and more likely win in the maintenance game long term. And with the pace of development, cost and feature set needs, higher level wins hands down as long as Moore's law applies. That why I say, "Good luck with that MS", this architecture decision could be the nail in the coffin.

CHROME 14?! (0)

Anonymous Coward | more than 3 years ago | (#37074010)

Firefox 4... IE 9... Chrome 14?!

Chrome 14 better do stuff more futuristic or I will be disappoint.

Re:CHROME 14?! (1)

aardwolf64 (160070) | more than 3 years ago | (#37074238)

Just wait until next month when they're in the triple-digits...

Am I using Chrome 143 or 142? ARGH!

I love C (0)

Anonymous Coward | more than 3 years ago | (#37074096)

Anything that uses or encourages the use of C (or C99) is more than welcome in my book. But...in browsers...

I think I will stay with my native desktop apps instead. Javascript is AOK, but bringing C/C++ into the browser just like that...doesn't it feel a bit like bringing a large hadron collider into a knife fight?

C++ blows on multi-core and multi-platform (1)

SplashMyBandit (1543257) | more than 3 years ago | (#37074118)

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).

Re:C++ blows on multi-core and multi-platform (0)

Anonymous Coward | more than 3 years ago | (#37074256)

No it doesn't.

End of .net ? (0)

Anonymous Coward | more than 3 years ago | (#37074192)

Sounds odd to me, the VM model (Java and then .net) represents a huge step forward in the programing paradigm, why are we going back to a language that still force you to manage the memory manually !

After removing the .net suffix on all its product line, removing the CLR made "the ms" reference platform... are they just saying that C# is no more the preffered MS language ? If so, this is definitivelly the end of .net .... What are they just doing then !?!

By the way IMHO, most "resource constrainted" element should not be handled manualy by the programmer, but instead the programmer should indicate the runtime its constraints/priorities/wishes so that the machine just does it. I am still wondering why with so much complex chips, the manufacturer are stil not able to brin you out of the box : automagic memory management (gc) , thread virtualization (realtime constraint & best effort constraint) ?

Resource mangement at chip level is the next step, then we can talk back of oldies such as C++ ;-)
(hairy troll made on purpose)

Looking forward to it (1)

sproketboy (608031) | more than 3 years ago | (#37074202)

Looking forward to stack smashing hacks again. Yay!

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?