Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Chrome Google Programming

Chrome 14 Beta Integrates Native Client 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."
This discussion has been archived. No new comments can be posted.

Chrome 14 Beta Integrates Native Client

Comments Filter:
  • by AdmiralXyz ( 1378985 ) on Friday August 12, 2011 @03:28PM (#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?

    • by epyT-R ( 613989 )

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

    • by shutdown -p now ( 807394 ) on Friday August 12, 2011 @03:51PM (#37073682) Journal

      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.

      • by PCM2 ( 4486 )

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

      • I find myself a little perturbed by the fact that they're using code verification and sandboxing. If the sandboxing is solid --- which isn't actually that hard; any modern operating system already does this as a matter of course as part of the process model --- then the verification shouldn't be necessary.
        • by gmueckl ( 950314 )

          The crazy thing is that process isolation as provided by operating systems is relying heavily on hardware support. Most processors only have a kernel mode and a user mode and the mode switching is a part of what isolates processes. The 80386 was cleverly designed to have 4 modes, called rings, 0 to 3, where each inner ring would have more privileges than the outer rings. This was at a time where most of the OS makers ended up looking at this design and scratching their heads in wonder, having no idea how to

        • The original paper makes an explicit assumption that OS process/sandbox isolation boundary is not foolproof.

  • 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.
    • by zget ( 2395308 )
      It's Visual Studio. Intellisense is the autocompletion feature...
      • 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.
        • 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]

          • 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 handl
            • 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 s

        • by jeremyp ( 130771 )

          Xcode 4.1 has that ability.

        • It has always amazed me that no other compilers do "as you type" compilation, since the difficulties are, while not trivial, quite easy to surmount. You can construct grammar trees and fill them online. During my CS study we built such realtime parsers in one of the courses as an assignment. This was in 1990.

          • I can't know for sure, but I think it's a matter of scope. How many levels of abstraction do you go through? How do you deal with generics? You might be able to do it with C, but when you've got C++/STL/Boost, there's just too much branching to do it real-time (I think...).
    • Comment removed based on user account deletion
    • by bberens ( 965711 )
      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.
    • 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

      • by PCM2 ( 4486 )

        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 kic [infoworld.com]

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

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

      • 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.
        • Given their love for Eclipse in Android development department, I'd expect them to just ship it with Eclipse CDT.

          • 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.
          • That's the first thing I thought as well. Eclipse is a good "delivery system" for their dev projects overall, I'm sure they have plenty of people already working on the general Eclipse project. But I think they might/should go further. Look at Aptana [aptana.com] -- it's specifically designed for web development. They could design Eclipse "variants" that are specific to Android-programming and, possibly, some version that facilitates programming NaCl modules.
    • 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 cod

      • albeit in a custom executable format, and I couldn't find information about the ABI...

        As I understand it, there are two formats. I remember the nexes being derived from ELF, but I can't find it now. There's also the Portable NaCl, which is some form of LLVM bytecode, so that it can be compiled on the client so as to natively support any architecture, without having to ship them C source.

  • by GGardner ( 97375 ) on Friday August 12, 2011 @03:40PM (#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.

    • I have a better check for C++ programmers who write C-spaghetti code with classes: they don't have a favorite IDE.
    • "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).

    • by bberens ( 965711 )
      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.
    • 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.

    • by tyrione ( 134248 )

      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.

      And C99 isn't your C89 equivalent nor is C1x the same as C99. With C99 being the baseline for OpenCL I expect C1x will be a big boon for Parallel Programming.

  • Yo Dawg (Score:2, Funny)

    by Anonymous Coward

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

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

    • 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.
  • 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 o
    • by alexmin ( 938677 )

      to make it work with the new multi-core CPU architectures is a total PITA.

      HFT industry disagrees. But those devs keep quiet, they do need sluggish C-pound lovers on the other side of the trade to make money.

      • HFT is a miniscule drop in the ocean. C++ is sluggish compared to assembler, but that doesn't make assembler a better purpose *general* solution language. Again, you're taking the snobby argument that because C++ is good for your tiny niche that it follows that it is better for all applications and then you proceed to rag on C# guys as if they all sucked. Personally, I'm no C# fan, but I'm not stupid enough to think C++ is better for the general scope of applications. Plus, you ignore the fact that in many
  • 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.

What sin has not been committed in the name of efficiency?

Working...