7

I am confused about the utility of native client in Chrome other than say using the language of your choice and running faster.

Can one accomplish anything in native client that you cannot do in javascript? By anything, I mean functionality, not a better/faster way of doing the same thing. For example, javascript cannot open a UDP socket, but native client can.

software engineer
  • 271
  • 1
  • 4
  • 15
  • From what I just read, it doesn't look like it offers anything more than what's possible with JS/HTML5. But it's better for porting desktop apps to web apps, and it's usually faster. https://developer.chrome.com/native-client/overview – Sam P May 28 '14 at 05:24
  • Thanks, Sam. I just wish there is a clear one-liner answer on their website. – software engineer May 29 '14 at 05:08

1 Answers1

1

Your first line addresses two points where Native Client provides utility. NaCl is good for C/C++/assembly coders to bring an application written in their language of choice to the web, and NaCl helps applications run faster/with better performance/more efficiently (aka with less use of battery). Native Client also provides threaded applications, allowing programming models (and the performance that goes along with threads) to run natively on the web (aka not with web workers).

The Sockets API is available to all chrome packaged apps, the distinction is that the API makes the sockets directly to a NaCl application, which is faster and has the benefit of porting existing native applications to the browser without modifications. There are also a variety of other APIs, like Game controllers, hardware decode (coming soon), and Fullscreen/Mouselock. Find the full list of Pepper APIs that enable NaCl capabilities here: https://developer.chrome.com/native-client/pepper_stable/c/index#pepper-stable-c-index.

For Portable Native Client, the most notable capabilities are the ability to use threading, and portable intrinsics (SIMD). Perhaps writing core logic that can run cross-platform (aka a C/C++ "model" that can interact with different views on different platforms) isn't a strict capability, but it is a benefit of using NaCl, especially for developers also using Objective C/Android NDK to build native mobile versions of their application.

NaClPM
  • 131
  • 1
  • 4
  • I think you are saying "yes, NaCl can do more than javascript" with the socket API and direct support for multithreading. Is that correct? – software engineer May 29 '14 at 05:05