SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

โครงงานครั้งที่ 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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 

Dernier (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 

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