SlideShare una empresa de Scribd logo
1 de 15
Native Client

http://code.google.com/p/nativeclient/
Native Client

• open source technology
• running native compiled code in the browser
• maintaining the OS portability and safety
• expands web programming beyond JavaScript
• tied to a specific CPU architecture
•os independent, but not processor independent
• run close to native speed
• multithreaded/multicore
• low-latency audio
• combined with low-level access to networking
  APIs and OpenGL ES
• fit for running a physics engine or artificial
  intelligence module
• Reduce the encoding and decoding data in
  proprietary formats
• sandboxed environment proxies system calls
Native Client module execution




prevents the following unsafe activities:
Manipulating devices or files directly (instead, a special file system API is provided)
Directly accessing the operating system
Using self-modifying code to hide the code's intent (such as attempts to write to
protected memory)
Native Client SDK


  The Native Client SDK includes the following:
  GNU-based toolchain: gcc, as, ld, gdb, and other tools
  API libraries (Pepper, POSIX)
  SCons build scripts and configuration files for building Native Client applications



  The Pepper Plug-in API (PPAPI), a library is written in C, and the SDK also
  provides a set of C++ bindings for it. Native Client modules use the Pepper API
  to communicate with JavaScript and resources managed by the browser. The
  Pepper Library also provides a platform-independent multimedia API that
  Native Client modules can use for audio, video, and 2D graphics (support for 3D
  graphics is coming soon).
Program structure
                    HTML/JavaScript application:
                    •   Provides the user interface and event handling



                    Pepper bridge:
                    •   send messages between JavaScript code and
                        the Native Client module.
                    •   provides interfaces allow NaCl modules to
                        create/use browser resources.


                    Native Client module:
                    • performs numerical computation and other
                      compute-intensive tasks.
                    • Handles large-scale data manipulation.
                    • provides event handling APIs for apps
HTML file


<embed name="nacl_module"
    id="hello_world"
    width=0
    height=0
    src="hello_world.nmf"
    type="application/x-nacl" />
Creating a Native Client web app


     C++ Tutorial: Getting Started
The HTML web page (*.html).

A Native Client module(*.nexe):
written in C or C++. Native Client modules uses the Pepper API, as a bridge between
the browser and the modules.

A manifest file (*.nmf):
 that is used by the browser to determine which compiled Native Client module to
load for a given end-user instruction set ("x86-64" or "x86-32").



Communication between JavaScript and a Native Client module
Communication between JavaScript code in the browser and C++ code in a
Native Client module is two-way:

the browser can send messages to the Native Client module.
The Native Client module can respond to the message from JavaScript, or it can
initiate its own message to JavaScript.


   the communication is asynchronous.
Step 1: install the Native Client SDK and Python.

Step 3: Start a local server.

Step 4: Set up Chrome and verify that Native Client is working.

Step 5: Create a set of template files for your project.


       the directory of the project with the following files:
       •build.scons
       •hello_tutorial.html
       •hello_tutorial.cc
       •scons



•Scons, a driver script that runs the SCons tool to build your application
•build.scons, the build instructions for your application
Step 6: Modify the web page to load and communicate with the Native Client module.


  <embed name="nacl_module"
           id="hello_tutorial"
           width=0 height=0
           src="hello_tutorial.nmf"
           type="application/x-nacl" />


  function moduleDidLoad() {
           HelloTutorialModule = document.getElementById('hello_tutorial');
           HelloTutorialModule.addEventListener('message', handleMessage, false);
           updateStatus('SUCCESS'); //Send a message to the NaCl module.
           HelloTutorialModule.postMessage('hello');
  }
Step 7: Implement a message handler in the Native Client module.


•Implement the HandleMessage() function for the module instance
     (pp::Instance.HandleMessage, in the Pepper Library)

•Use the PostMessage() function to send a message to JavaScript.
    (pp::Instance.PostMessage, in the Pepper Library)


namespace {
         // The expected string sent by the browser.
         const char* const kHelloString = "hello";
         // The string sent back to the browser upon receipt of a message
         // containing "hello".
         const char* const kReplyString = "hello from NaCl";
} // namespace
virtual void HandleMessage(const pp::Var& var_message) {
        if (!var_message.is_string())
                 return;
        std::string message = var_message.AsString();
        pp::Var var_reply;
        if (message == kHelloString) {
                 var_reply = pp::Var(kReplyString);
                 PostMessage(var_reply);
        }
}
Step 8: Compile the Native Client module.

be sure you are still in the project directory.
run the scons script (orscons.bat on Windows).

cd examples/hello_tutorial ./scons


•hello_tutorial_x86_32.nexe
•hello_tutorial_x86_32_dbg.nexe
•hello_tutorial_x86_64.nexe
•hello_tutorial_x86_64_dbg.nexe
•hello_tutorial.nmf

    {
          "program": {
               "x86-64": {"url":"hello_tutorial_x86_64.nexe"},
              "x86-32": {"url": "hello_tutorial_x86_32.nexe"}
          }
     }
Thanks

Más contenido relacionado

La actualidad más candente

Asynkron programmering i Visual Studio 11
Asynkron programmering i Visual Studio 11Asynkron programmering i Visual Studio 11
Asynkron programmering i Visual Studio 11MortenWennevik
 
Multiple django applications on a single server with nginx
Multiple django applications on a single server with nginxMultiple django applications on a single server with nginx
Multiple django applications on a single server with nginxroskakori
 
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
 Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ... Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...HighSolutions Sp. z o.o.
 
Short introduction - .net core and .net standard 2.0
Short introduction - .net core and .net standard 2.0Short introduction - .net core and .net standard 2.0
Short introduction - .net core and .net standard 2.0Mark Lechtermann
 
Integrating Node.js with PHP
Integrating Node.js with PHPIntegrating Node.js with PHP
Integrating Node.js with PHPLee Boynton
 
Code quality par Simone Civetta
Code quality par Simone CivettaCode quality par Simone Civetta
Code quality par Simone CivettaCocoaHeads France
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleDmytro Semenov
 
CubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption JourneyCubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption JourneyPatrick Steele-Idem
 
Testing cloud and kubernetes applications - ElasTest
Testing cloud and kubernetes applications - ElasTestTesting cloud and kubernetes applications - ElasTest
Testing cloud and kubernetes applications - ElasTestMicael Gallego
 
Livecode widget course
Livecode widget courseLivecode widget course
Livecode widget coursecrazyaxe
 
Microsoft 2014 Dev Plataform - Roslyn -& ASP.NET vNext
Microsoft 2014 Dev Plataform -  Roslyn -& ASP.NET vNextMicrosoft 2014 Dev Plataform -  Roslyn -& ASP.NET vNext
Microsoft 2014 Dev Plataform - Roslyn -& ASP.NET vNextRodolfo Finochietti
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)iFour Technolab Pvt. Ltd.
 
Web Applications with Eclipse RT and Docker in the Cloud
Web Applications with Eclipse RT and Docker in the CloudWeb Applications with Eclipse RT and Docker in the Cloud
Web Applications with Eclipse RT and Docker in the CloudMarkus Knauer
 
Java concurrency
Java concurrencyJava concurrency
Java concurrencyfbenault
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptnohuhu
 
A Whirldwind Tour of ASP.NET 5
A Whirldwind Tour of ASP.NET 5A Whirldwind Tour of ASP.NET 5
A Whirldwind Tour of ASP.NET 5Steven Smith
 

La actualidad más candente (20)

Asynkron programmering i Visual Studio 11
Asynkron programmering i Visual Studio 11Asynkron programmering i Visual Studio 11
Asynkron programmering i Visual Studio 11
 
PHP and node.js Together
PHP and node.js TogetherPHP and node.js Together
PHP and node.js Together
 
Whats new in .net core 3
Whats new in .net core 3Whats new in .net core 3
Whats new in .net core 3
 
Multiple django applications on a single server with nginx
Multiple django applications on a single server with nginxMultiple django applications on a single server with nginx
Multiple django applications on a single server with nginx
 
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
 Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ... Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
 
Short introduction - .net core and .net standard 2.0
Short introduction - .net core and .net standard 2.0Short introduction - .net core and .net standard 2.0
Short introduction - .net core and .net standard 2.0
 
Integrating Node.js with PHP
Integrating Node.js with PHPIntegrating Node.js with PHP
Integrating Node.js with PHP
 
Code quality par Simone Civetta
Code quality par Simone CivettaCode quality par Simone Civetta
Code quality par Simone Civetta
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
CubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption JourneyCubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption Journey
 
Testing cloud and kubernetes applications - ElasTest
Testing cloud and kubernetes applications - ElasTestTesting cloud and kubernetes applications - ElasTest
Testing cloud and kubernetes applications - ElasTest
 
Livecode widget course
Livecode widget courseLivecode widget course
Livecode widget course
 
Microsoft 2014 Dev Plataform - Roslyn -& ASP.NET vNext
Microsoft 2014 Dev Plataform -  Roslyn -& ASP.NET vNextMicrosoft 2014 Dev Plataform -  Roslyn -& ASP.NET vNext
Microsoft 2014 Dev Plataform - Roslyn -& ASP.NET vNext
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)
 
Web Applications with Eclipse RT and Docker in the Cloud
Web Applications with Eclipse RT and Docker in the CloudWeb Applications with Eclipse RT and Docker in the Cloud
Web Applications with Eclipse RT and Docker in the Cloud
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
 
A Whirldwind Tour of ASP.NET 5
A Whirldwind Tour of ASP.NET 5A Whirldwind Tour of ASP.NET 5
A Whirldwind Tour of ASP.NET 5
 
Groovy and noteworthy
Groovy and noteworthyGroovy and noteworthy
Groovy and noteworthy
 
Composer: Dependency Manager for PHP
Composer: Dependency Manager for PHPComposer: Dependency Manager for PHP
Composer: Dependency Manager for PHP
 

Destacado

โครงงานครั้งที่ 2 (Guava Cake)
โครงงานครั้งที่ 2 (Guava Cake)โครงงานครั้งที่ 2 (Guava Cake)
โครงงานครั้งที่ 2 (Guava Cake)NattAA
 
It activity 6.3 catapults
It activity 6.3 catapultsIt activity 6.3 catapults
It activity 6.3 catapultslibbyheli
 
Dti2143 chap 4 control statement part 2
Dti2143 chap 4 control statement part 2Dti2143 chap 4 control statement part 2
Dti2143 chap 4 control statement part 2alish sha
 
TiemTapHoaSG
TiemTapHoaSGTiemTapHoaSG
TiemTapHoaSGLinh Vo
 
Projects templates
Projects templatesProjects templates
Projects templatesLinh Vo
 
Super moodlers
Super moodlersSuper moodlers
Super moodlersjohnw3600
 
Building Google Authorship Authority
Building Google Authorship AuthorityBuilding Google Authorship Authority
Building Google Authorship AuthorityMarvin Libron
 
Karta uslug doradczych 1
Karta uslug doradczych 1Karta uslug doradczych 1
Karta uslug doradczych 1annamull
 
Câu chuyệ sức khoẻ 21
Câu chuyệ sức khoẻ 21Câu chuyệ sức khoẻ 21
Câu chuyệ sức khoẻ 21vinhtungdk
 
オウンドメディア時代だからこそ! MTクラウド版への期待と不満
オウンドメディア時代だからこそ! MTクラウド版への期待と不満オウンドメディア時代だからこそ! MTクラウド版への期待と不満
オウンドメディア時代だからこそ! MTクラウド版への期待と不満新一 佐藤
 
Assessment to programming for reading
Assessment to programming for readingAssessment to programming for reading
Assessment to programming for readingKrystle Levings
 

Destacado (20)

โครงงานครั้งที่ 2 (Guava Cake)
โครงงานครั้งที่ 2 (Guava Cake)โครงงานครั้งที่ 2 (Guava Cake)
โครงงานครั้งที่ 2 (Guava Cake)
 
It activity 6.3 catapults
It activity 6.3 catapultsIt activity 6.3 catapults
It activity 6.3 catapults
 
Dti2143 chap 4 control statement part 2
Dti2143 chap 4 control statement part 2Dti2143 chap 4 control statement part 2
Dti2143 chap 4 control statement part 2
 
TiemTapHoaSG
TiemTapHoaSGTiemTapHoaSG
TiemTapHoaSG
 
Projects templates
Projects templatesProjects templates
Projects templates
 
Super moodlers
Super moodlersSuper moodlers
Super moodlers
 
Building Google Authorship Authority
Building Google Authorship AuthorityBuilding Google Authorship Authority
Building Google Authorship Authority
 
Proceso de cambios vip
Proceso de cambios vipProceso de cambios vip
Proceso de cambios vip
 
Karta uslug doradczych 1
Karta uslug doradczych 1Karta uslug doradczych 1
Karta uslug doradczych 1
 
ICA Membership
ICA MembershipICA Membership
ICA Membership
 
Câu chuyệ sức khoẻ 21
Câu chuyệ sức khoẻ 21Câu chuyệ sức khoẻ 21
Câu chuyệ sức khoẻ 21
 
Energy presentation
Energy presentationEnergy presentation
Energy presentation
 
オウンドメディア時代だからこそ! MTクラウド版への期待と不満
オウンドメディア時代だからこそ! MTクラウド版への期待と不満オウンドメディア時代だからこそ! MTクラウド版への期待と不満
オウンドメディア時代だからこそ! MTクラウド版への期待と不満
 
Ideas tema 1
Ideas tema 1Ideas tema 1
Ideas tema 1
 
Apuntes
Apuntes Apuntes
Apuntes
 
Assessment to programming for reading
Assessment to programming for readingAssessment to programming for reading
Assessment to programming for reading
 
γαλιλαIο γαλιλεϊ
γαλιλαIο γαλιλεϊγαλιλαIο γαλιλεϊ
γαλιλαIο γαλιλεϊ
 
Awsをつかってみた
AwsをつかってみたAwsをつかってみた
Awsをつかってみた
 
παρουσιαση 2016
παρουσιαση   2016παρουσιαση   2016
παρουσιαση 2016
 
Biblioteca de MIEDO
Biblioteca de MIEDOBiblioteca de MIEDO
Biblioteca de MIEDO
 

Similar a Native client

Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Ganesh Kondal
 
Building production-quality apps with Node.js
Building production-quality apps with Node.jsBuilding production-quality apps with Node.js
Building production-quality apps with Node.jsmattpardee
 
Learn Electron for Web Developers
Learn Electron for Web DevelopersLearn Electron for Web Developers
Learn Electron for Web DevelopersKyle Cearley
 
Introduction to google endpoints
Introduction to google endpointsIntroduction to google endpoints
Introduction to google endpointsShinto Anto
 
4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트
4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트 4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트
4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트 양 한빛
 
Welcome to the microsoft madness
Welcome to the microsoft madnessWelcome to the microsoft madness
Welcome to the microsoft madness명신 김
 
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with VoltaDaniel Fisher
 
Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Deepak Gupta
 
NCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsNCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsJohn M. Wargo
 
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularNativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularTodd Anglin
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetesBen Hall
 
HHM-3540: The IBM MQ Light API: From Developer Laptop to Enterprise Data Cen...
 HHM-3540: The IBM MQ Light API: From Developer Laptop to Enterprise Data Cen... HHM-3540: The IBM MQ Light API: From Developer Laptop to Enterprise Data Cen...
HHM-3540: The IBM MQ Light API: From Developer Laptop to Enterprise Data Cen...Matt Leming
 
Using Eclipse and Lua for the Internet of Things - JAX2013
Using Eclipse and Lua for the Internet of Things - JAX2013Using Eclipse and Lua for the Internet of Things - JAX2013
Using Eclipse and Lua for the Internet of Things - JAX2013Benjamin Cabé
 
When Smalltalk Meets the Web
When Smalltalk Meets the WebWhen Smalltalk Meets the Web
When Smalltalk Meets the WebESUG
 
Nodejs Native Add-Ons from zero to hero
Nodejs Native Add-Ons from zero to heroNodejs Native Add-Ons from zero to hero
Nodejs Native Add-Ons from zero to heroNicola Del Gobbo
 
A164 enterprise javascript ibm node sdk
A164 enterprise javascript ibm node sdkA164 enterprise javascript ibm node sdk
A164 enterprise javascript ibm node sdkToby Corbin
 

Similar a Native client (20)

Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6
 
Building production-quality apps with Node.js
Building production-quality apps with Node.jsBuilding production-quality apps with Node.js
Building production-quality apps with Node.js
 
Learn Electron for Web Developers
Learn Electron for Web DevelopersLearn Electron for Web Developers
Learn Electron for Web Developers
 
Introduction to google endpoints
Introduction to google endpointsIntroduction to google endpoints
Introduction to google endpoints
 
4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트
4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트 4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트
4. RTFM, 나는프로그래머다 Meetup 2016 / 한국마이크로소프트 김명신 기술 에반젤리스트
 
Welcome to the microsoft madness
Welcome to the microsoft madnessWelcome to the microsoft madness
Welcome to the microsoft madness
 
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta
 
Nodejs overview
Nodejs overviewNodejs overview
Nodejs overview
 
Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)
 
NCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsNCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile Apps
 
Signal R 2015
Signal R 2015Signal R 2015
Signal R 2015
 
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularNativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 
Dynamic virtual evironments
Dynamic virtual evironmentsDynamic virtual evironments
Dynamic virtual evironments
 
HHM-3540: The IBM MQ Light API: From Developer Laptop to Enterprise Data Cen...
 HHM-3540: The IBM MQ Light API: From Developer Laptop to Enterprise Data Cen... HHM-3540: The IBM MQ Light API: From Developer Laptop to Enterprise Data Cen...
HHM-3540: The IBM MQ Light API: From Developer Laptop to Enterprise Data Cen...
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 
Using Eclipse and Lua for the Internet of Things - JAX2013
Using Eclipse and Lua for the Internet of Things - JAX2013Using Eclipse and Lua for the Internet of Things - JAX2013
Using Eclipse and Lua for the Internet of Things - JAX2013
 
When Smalltalk Meets the Web
When Smalltalk Meets the WebWhen Smalltalk Meets the Web
When Smalltalk Meets the Web
 
Nodejs Native Add-Ons from zero to hero
Nodejs Native Add-Ons from zero to heroNodejs Native Add-Ons from zero to hero
Nodejs Native Add-Ons from zero to hero
 
A164 enterprise javascript ibm node sdk
A164 enterprise javascript ibm node sdkA164 enterprise javascript ibm node sdk
A164 enterprise javascript ibm node sdk
 

Último

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Último (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Native client

  • 2. Native Client • open source technology • running native compiled code in the browser • maintaining the OS portability and safety • expands web programming beyond JavaScript • tied to a specific CPU architecture •os independent, but not processor independent
  • 3. • run close to native speed • multithreaded/multicore • low-latency audio • combined with low-level access to networking APIs and OpenGL ES • fit for running a physics engine or artificial intelligence module • Reduce the encoding and decoding data in proprietary formats • sandboxed environment proxies system calls
  • 4. Native Client module execution prevents the following unsafe activities: Manipulating devices or files directly (instead, a special file system API is provided) Directly accessing the operating system Using self-modifying code to hide the code's intent (such as attempts to write to protected memory)
  • 5. Native Client SDK The Native Client SDK includes the following: GNU-based toolchain: gcc, as, ld, gdb, and other tools API libraries (Pepper, POSIX) SCons build scripts and configuration files for building Native Client applications The Pepper Plug-in API (PPAPI), a library is written in C, and the SDK also provides a set of C++ bindings for it. Native Client modules use the Pepper API to communicate with JavaScript and resources managed by the browser. The Pepper Library also provides a platform-independent multimedia API that Native Client modules can use for audio, video, and 2D graphics (support for 3D graphics is coming soon).
  • 6. Program structure HTML/JavaScript application: • Provides the user interface and event handling Pepper bridge: • send messages between JavaScript code and the Native Client module. • provides interfaces allow NaCl modules to create/use browser resources. Native Client module: • performs numerical computation and other compute-intensive tasks. • Handles large-scale data manipulation. • provides event handling APIs for apps
  • 7. HTML file <embed name="nacl_module" id="hello_world" width=0 height=0 src="hello_world.nmf" type="application/x-nacl" />
  • 8. Creating a Native Client web app C++ Tutorial: Getting Started
  • 9. The HTML web page (*.html). A Native Client module(*.nexe): written in C or C++. Native Client modules uses the Pepper API, as a bridge between the browser and the modules. A manifest file (*.nmf): that is used by the browser to determine which compiled Native Client module to load for a given end-user instruction set ("x86-64" or "x86-32"). Communication between JavaScript and a Native Client module Communication between JavaScript code in the browser and C++ code in a Native Client module is two-way: the browser can send messages to the Native Client module. The Native Client module can respond to the message from JavaScript, or it can initiate its own message to JavaScript. the communication is asynchronous.
  • 10. Step 1: install the Native Client SDK and Python. Step 3: Start a local server. Step 4: Set up Chrome and verify that Native Client is working. Step 5: Create a set of template files for your project. the directory of the project with the following files: •build.scons •hello_tutorial.html •hello_tutorial.cc •scons •Scons, a driver script that runs the SCons tool to build your application •build.scons, the build instructions for your application
  • 11. Step 6: Modify the web page to load and communicate with the Native Client module. <embed name="nacl_module" id="hello_tutorial" width=0 height=0 src="hello_tutorial.nmf" type="application/x-nacl" /> function moduleDidLoad() { HelloTutorialModule = document.getElementById('hello_tutorial'); HelloTutorialModule.addEventListener('message', handleMessage, false); updateStatus('SUCCESS'); //Send a message to the NaCl module. HelloTutorialModule.postMessage('hello'); }
  • 12. Step 7: Implement a message handler in the Native Client module. •Implement the HandleMessage() function for the module instance (pp::Instance.HandleMessage, in the Pepper Library) •Use the PostMessage() function to send a message to JavaScript. (pp::Instance.PostMessage, in the Pepper Library) namespace { // The expected string sent by the browser. const char* const kHelloString = "hello"; // The string sent back to the browser upon receipt of a message // containing "hello". const char* const kReplyString = "hello from NaCl"; } // namespace
  • 13. virtual void HandleMessage(const pp::Var& var_message) { if (!var_message.is_string()) return; std::string message = var_message.AsString(); pp::Var var_reply; if (message == kHelloString) { var_reply = pp::Var(kReplyString); PostMessage(var_reply); } }
  • 14. Step 8: Compile the Native Client module. be sure you are still in the project directory. run the scons script (orscons.bat on Windows). cd examples/hello_tutorial ./scons •hello_tutorial_x86_32.nexe •hello_tutorial_x86_32_dbg.nexe •hello_tutorial_x86_64.nexe •hello_tutorial_x86_64_dbg.nexe •hello_tutorial.nmf { "program": { "x86-64": {"url":"hello_tutorial_x86_64.nexe"}, "x86-32": {"url": "hello_tutorial_x86_32.nexe"} } }