May 19, 2010 - Comments Off on Live blogging Google I/O: Beyond JavaScript: programming the web with native code

Live blogging Google I/O: Beyond JavaScript: programming the web with native code

David Springer
Ian Lewis

http://en.wikipedia.org/wiki/Google_Native_Client
http://code.google.com/p/nativeclient/

Agenda

[]

Non-agenda

* Internals and technical details
* Security model

Talked about this last year.

Native Client = NaCl (na-kkle)

Overview: What is NaCl

* A portable system for verifying and executing untrusted native code in the browser.
** High performance like C++
** Safe and portable like JS
* A runtime sandbox
** "Virtual Mini-POSIX"
** Standard operating system services
*** Kernel (Chrome)
*** Window manager
*** Media layer (Pepper)
** Identical on every supported platform (Mac, Windows, Linux)

NaCl: What is it good for?

* Port desktop applications to the web
** Zero install
** Native performance
* Enchance web apps with...
** Existing C/C++ libraries (libcrypt, CGAL, etc)
** New high-performance compiled code
* Sandbox existing plugin code
** Stop asking users to trust your code

Lunch ain't free

* Must compile verifiable code
** Minor performance penalty
** Generally large executables
* Some *nix syscalls are unavailable
** Process creation
** Direct network/file access
* Still some rough edges

How does this make my life better?

* Native performance
* Platform-independent multimedia
* Your choice of language
* Low-level system services
* The end of: The "do you trust this publisher" confirm installation box. Asks user to make an impossible choice.

Demo: unity

Unity game Lego Starwars. Four guys ported game in four weeks. Not super difficult thing to do.

The NaCl SDK

SDK goodies

* C/C++ toolchain
* Standard GNU libraries
* "Pepper"
** NPAPI-like interface
** Audio/video
** OpenGL ES 2.0
* JavaScript interop
* Sample code and build scripts

Using the SDK

* Build with standard GNU toolchain
* Run in web browser
** Server required
* Debug with GDB-compatible debugger
** via GDB stub

Demo

Anatomy of a NaCl application

(Diagram)

  1. Install the SDK
  2. Organize project directories and files:
    • application
    • nacl
    • c_salt

The HTML and CSS is straightforward.


Coming attractions

* Full debugger support
** GDB
** Visual Studio
* IDE plugins
** Eclipse
** Visual Studio
** Xcode
* Easy to use interop library
* P-NaCl (portable NaCl) (pinnacle)

nativeclient.googlecode.com
nativeclient-sdk.google.com.com
native-client-discuss@google.com

Published by: jeffreybarke in The Programming Mechanism

Comments are closed.