SlideShare a Scribd company logo
1 of 32
JavaScript: The Machine Language of
the Ambient Computing Era
Talk, by Allen Wirfs-Brock
Mozilla Research Fellow
Project Editor, Ecma-262 (The JavaScript Standard)
@awbjs
Front-trends 2013, Warsaw 2011, April 25, 2013
We are well into the transition away from PC centric computing. But the new order isn't just
about mobile phones and tables. It's about all of us living in a world that is augments by the
ambient presence of billions of computing devices. And they're all going to be programming
using JavaScript! Well, at least a lot of them will be. In this presentation I'll be discussing how
JavaScript is changing the world, and how the world is changing JavaScript..
The Rise and Fall of Personal Computing
http://www.asymco.com/2012/01/17/the-rise-and-fall-of-personal-computing/
A New Era of Computing?
1950 1960 2000 2010 2020199019801970
SocietalImpact
Corporate Computing
Personal Computing
Computers
empower/enhance
enterprise tasks
Computers
empower/enhance
individuals’ tasks Ambient
Computing
Computers
empower/enhance
Every Computing Era Has a
Dominant Application Platforms
• Corporate Computing Era: IBM Mainframes
• Personal Conmputing Era: Microsoft/Intel PC
• Ambient Computing Era: The Web is the Platform?
Created by Market Demand,
“Good Enough” Technical Foundation,
and Superior Business Execution
Each Computing Era has had Canonical
Programming Languages
• Corporate Computing Era – COBOL/Fortran
• Personal Computing Era – C/C++ family
• Ambient Computing Era – JavaScript ??
Why JavaScript?
The economics of ubiquity.
 It’s already there
 Widest reach
 Lowest risk
 Write libraries and apps once
 Single knowledge and skill set http://odetocode.com/Blogs/scott/archive/2009/03/18/signs-that-your-javascript-skills-need-updating.aspx
Because “Worse is Better”Dick Grabriel
http://www.dreamsongs.com/WorseIsBetter.html
Is it even possible to replace it?
The Web Is the Platform
Rendering
Layout
Styling
Network Local
storage
User
Input
Language Runtime
HTML CSS SVGJavaScript
Frameworks and Libraries
The Web
Application
Platform
Firefox OS on Raspberry Pi
http://www.philipp-wagner.com/ffos-for-
rpi/manual/index.html
http://www.philipp-
wagner.com/blog/2013/04/firefox-os-for-
raspberry-pi-now-available/
http://www.philipp-wagner.com/ffos-for-
rpi/download/rpi-b2g-image-raspberrypi-
20130411092136.rootfs.rpi-sdimg.bz2
But what about…
Answer: Functionality and Performance
Multitouch
Accelerometer
Cameras
Speaker
Microphone
Bluetooth
Hardware Keys Light Sensor
NFC
USB Access
Vibration Motor
Proximity Sensor
Gyro
Functionality
Communication
s APIs
Bluetooth
Mobile Connection
Network Connection
Network Stats
TCO Socket
Telephony
WebSMS
WiFi Info
Push Notification
NFC
WebRTC
Hardware
Access APIs
Ambient Light Sensor
Battery Status
Camera
Pointer Lock
Proximity
Screen Orientation
Vibration
WebFM
GeoLocation
USB
Alarm
App Management
Idle Permissions
Time/Clock
WebPayment
Device Storage
Contacts
Calandar
App Services APIs
Performance: Parallel JS
Data parallelism for JavaScript
• Goal: exploit multiple-cores, vector instructions, GPUs
• Design based upon Intel’s “Rivertrail” prototype
• On standardization track
• Experimental implementation now in Firefox Nightly
http://wiki.ecmascript.org/doku.php?id=strawman:data_parallelism
Parallel JS Example
function averageSavingsAterAge(peopleData, age) {
age = +age;
var peeps = new ParallelArray(peopleData);
var pop = peeps.filter(function(person) {
return person.age>age});
var totalSavings =
pop.reduce(function(subtotal,person) {
return subtotal+person.savings});
return totalSavings / pop.size;
}
• Subset of JavaScript that
approximates a classic Von
Neumann computer
• asm.js code executes
identically on any Javascript
engine
• But a JS engine may
recognize asm.js code and
optimize for it.
• asmjs.org
• https://wiki.mozilla.org/Javascript:Spide
rMonkey:OdinMonkey
asm.js – C level Performance
C++ to JavaScript
C++
source
code
Clang: C++
Compiler
Front-end
LLVM
Bitcode
LLVM
Optimizer
JavaScript
(asm.js)
source
code
JavaScript
Engine (asm.js
aware)
JavaScript
(asm.js)
source
code
Development Time
App Run Time
Emscrpten
Better
LLVM
Bitcode
Source: Alon Zakai (@kripken)
http://kripken.github.com/mloc_emscripten_talk
Why not a web bytecode engine?
asm.js code is just YAIR
(Yet Another Intermediate Representation)
function strlen(ptr) {
ptr = ptr|0;
var curr = 0;
curr = ptr;
while (MEM8[curr]|0 != 0) {
curr = (curr + 1)|0;
}
return (curr - ptr)|0;
}
func strlen
param ptr, int32
local curr, int32, ptr
label loop
index8 indx, heap, curr
read next, indx
bne next, exit
add curr, curr, 1
goto loop
label exit
sub tmp, curr, ptr
return sub
What is ECMAScript?
• ECMAScript is the name of the
international standard that defines
JavaScript
• Developed by Technical Committee 39
(TC-39) of Ecma International
• Issued as a Ecma-262 and ISO/IEC
16262
• Not part of W3C
Google Mozilla Microsoft Webkit
V8 SpiderMonkey Chakra JSCore
JavaScript Implementations
ECMAScript 6 (and beyond)
Goals
http://wiki.ecmascript.org/doku.php?id=harmony:harmony
1. Be a better language for:
A. complex applications;
B. libraries (including the DOM) shared by
those applications;
C. code generators targeting the new edition.
2. …
What Kind of Language Is
JavaScript?• Functional?
• Object-oriented?
• Class-based?
• Prototype-based?
• Permissive?
• Secure?
Photo by crazybarefootpoet @ flickr (CC BY-NC-SA 2.0)
ECMAScript 6
Functional Programming
• Arrow functions
• Comprehensions
• Generators
• Tail calls
Object-oriented Programming
• Class declarations
• Concise methods syntax
• Super calls
• Subclassable built-ins
ES6
Feature complete draft December 2013
Approved Standard December 2014
ES6 Schedule:
Arrow Functions
var pop = peeps.filter(function(person) {
return person.age>age});
var pop = peeps.filter(person => person.age>age);
Becomes:
var self = this;
var pop = peeps.filter(function(person) {
return person.age>self.age});
Arrow Functions
Becomes:
var pop = peeps.filter(person => person.age>this.age);
Classes Today
//define Employee as a subclass of Person
function Employee(name,id) {
Person.call(name);
this.id = id;
}
Employee.prototype=Object.create(Person.prototype);
Object.defineProperty(Employee.prototype, “constructor”,
{value:Employee,enumerable:false,configurable: true});
Employee.__proto__ = Person;
Employee.prototype.hire = function() {…};
Employee.prototype.fire = function () {…};
…
Classes in ES6
//ES6 define Employee as subclass of Person
class Employee extends Person {
constructor(name,id) {
super(name);
this.id = id;
}
hire () {…}
fire () {…}
…
}
Classes Today vs ES6
//define Employee as subclass of Person
function Employee(name,id) {
Person.call(name);
this.id = id;
}
Employee.prototype=Object.create(Person.prototype);
Object.defineProperty(Employee.prototype, “constructor”,
{value:Employee,enumerable:false,configurable: true});
Employee.__proto__ = Person;
Employee.prototype.hire = function() {…};
Employee.prototype.fire = function () {…};
…
//ES6 define Employee as subclass of Person
class Employee extends Person {
constructor(name,id) {
super(name);
this.id = id;
}
hire () {…}
fire () {…}
…
}
The Rise and Fall of Personal Computing
http://www.asymco.com/2012/01/17/the-rise-and-fall-of-personal-computing/
The Rise and Fall of Ambient Computing
2005 2008 2011 2014 2017 2020 2023 2026 2029 2032 2035 2038 2041 2044 2047 2050
We’re all collectively creating
a new era of computing.
Enjoy it!
Own it!
Warsaw
Saturday, June 1, 2013
Apply to attend
http://bit.ly/FxOSAppWorkshop-apply
More info
https://hacks.mozilla.org/2013/03/firefox-os-app-workshops/
• For skilled JavaScript/HTML5 Developers
• Turn your site or webapp into a Firefox OS App
• Take home a phone!

More Related Content

Similar to JavaScript: The Machine Language of the Ambient Computing Era

Is the Browser a Transitional Technology?
Is the Browser a Transitional Technology?Is the Browser a Transitional Technology?
Is the Browser a Transitional Technology?Allen Wirfs-Brock
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop OverviewShubhra Kar
 
모바일 트렌드와 iOS
모바일 트렌드와 iOS모바일 트렌드와 iOS
모바일 트렌드와 iOSJung Kim
 
Reaktive Programmierung mit den Reactive Extensions (Rx)
Reaktive Programmierung mit den Reactive Extensions (Rx)Reaktive Programmierung mit den Reactive Extensions (Rx)
Reaktive Programmierung mit den Reactive Extensions (Rx)NETUserGroupBern
 
IT TRENDS AND PERSPECTIVES 2016
IT TRENDS AND PERSPECTIVES 2016IT TRENDS AND PERSPECTIVES 2016
IT TRENDS AND PERSPECTIVES 2016Vaidheswaran CS
 
Powerful tools for building web solutions
Powerful tools for building web solutionsPowerful tools for building web solutions
Powerful tools for building web solutionsAndrea Tino
 
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignalBuilding modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignalAlessandro Pilotti
 
PowerPoint
PowerPointPowerPoint
PowerPointVideoguy
 
ITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignal
ITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignalITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignal
ITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignalITCamp
 
Philly ete-2011
Philly ete-2011Philly ete-2011
Philly ete-2011davyjones
 
SLUGUK BUILD Round-up
SLUGUK BUILD Round-upSLUGUK BUILD Round-up
SLUGUK BUILD Round-upDerek Lakin
 
HTML5 Can't Do That
HTML5 Can't Do ThatHTML5 Can't Do That
HTML5 Can't Do ThatNathan Smith
 
The Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceThe Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceIntel® Software
 
Modeling on the Web
Modeling on the WebModeling on the Web
Modeling on the WebIcinetic
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsJames Pearce
 
(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe(In)Security Implication in the JS Universe
(In)Security Implication in the JS UniverseStefano Di Paola
 
Designing Powerful Web Applications - Monterey
Designing Powerful Web Applications - MontereyDesigning Powerful Web Applications - Monterey
Designing Powerful Web Applications - MontereyDave Malouf
 
There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014jbandi
 

Similar to JavaScript: The Machine Language of the Ambient Computing Era (20)

Is the Browser a Transitional Technology?
Is the Browser a Transitional Technology?Is the Browser a Transitional Technology?
Is the Browser a Transitional Technology?
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
모바일 트렌드와 iOS
모바일 트렌드와 iOS모바일 트렌드와 iOS
모바일 트렌드와 iOS
 
Reaktive Programmierung mit den Reactive Extensions (Rx)
Reaktive Programmierung mit den Reactive Extensions (Rx)Reaktive Programmierung mit den Reactive Extensions (Rx)
Reaktive Programmierung mit den Reactive Extensions (Rx)
 
IT TRENDS AND PERSPECTIVES 2016
IT TRENDS AND PERSPECTIVES 2016IT TRENDS AND PERSPECTIVES 2016
IT TRENDS AND PERSPECTIVES 2016
 
Powerful tools for building web solutions
Powerful tools for building web solutionsPowerful tools for building web solutions
Powerful tools for building web solutions
 
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignalBuilding modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
 
PowerPoint
PowerPointPowerPoint
PowerPoint
 
ITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignal
ITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignalITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignal
ITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignal
 
Philly ete-2011
Philly ete-2011Philly ete-2011
Philly ete-2011
 
SLUGUK BUILD Round-up
SLUGUK BUILD Round-upSLUGUK BUILD Round-up
SLUGUK BUILD Round-up
 
HTML5 Can't Do That
HTML5 Can't Do ThatHTML5 Can't Do That
HTML5 Can't Do That
 
The Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceThe Next Leap in JavaScript Performance
The Next Leap in JavaScript Performance
 
Service worker API
Service worker APIService worker API
Service worker API
 
Modeling on the Web
Modeling on the WebModeling on the Web
Modeling on the Web
 
Modeling on the Web
Modeling on the WebModeling on the Web
Modeling on the Web
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applications
 
(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe
 
Designing Powerful Web Applications - Monterey
Designing Powerful Web Applications - MontereyDesigning Powerful Web Applications - Monterey
Designing Powerful Web Applications - Monterey
 
There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014
 

Recently uploaded

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

JavaScript: The Machine Language of the Ambient Computing Era

  • 1. JavaScript: The Machine Language of the Ambient Computing Era Talk, by Allen Wirfs-Brock Mozilla Research Fellow Project Editor, Ecma-262 (The JavaScript Standard) @awbjs Front-trends 2013, Warsaw 2011, April 25, 2013 We are well into the transition away from PC centric computing. But the new order isn't just about mobile phones and tables. It's about all of us living in a world that is augments by the ambient presence of billions of computing devices. And they're all going to be programming using JavaScript! Well, at least a lot of them will be. In this presentation I'll be discussing how JavaScript is changing the world, and how the world is changing JavaScript..
  • 2. The Rise and Fall of Personal Computing http://www.asymco.com/2012/01/17/the-rise-and-fall-of-personal-computing/
  • 3. A New Era of Computing? 1950 1960 2000 2010 2020199019801970 SocietalImpact Corporate Computing Personal Computing Computers empower/enhance enterprise tasks Computers empower/enhance individuals’ tasks Ambient Computing Computers empower/enhance
  • 4.
  • 5. Every Computing Era Has a Dominant Application Platforms • Corporate Computing Era: IBM Mainframes • Personal Conmputing Era: Microsoft/Intel PC • Ambient Computing Era: The Web is the Platform? Created by Market Demand, “Good Enough” Technical Foundation, and Superior Business Execution
  • 6. Each Computing Era has had Canonical Programming Languages • Corporate Computing Era – COBOL/Fortran • Personal Computing Era – C/C++ family • Ambient Computing Era – JavaScript ??
  • 7. Why JavaScript? The economics of ubiquity.  It’s already there  Widest reach  Lowest risk  Write libraries and apps once  Single knowledge and skill set http://odetocode.com/Blogs/scott/archive/2009/03/18/signs-that-your-javascript-skills-need-updating.aspx Because “Worse is Better”Dick Grabriel http://www.dreamsongs.com/WorseIsBetter.html Is it even possible to replace it?
  • 8. The Web Is the Platform Rendering Layout Styling Network Local storage User Input Language Runtime HTML CSS SVGJavaScript Frameworks and Libraries The Web Application Platform
  • 9.
  • 10. Firefox OS on Raspberry Pi http://www.philipp-wagner.com/ffos-for- rpi/manual/index.html http://www.philipp- wagner.com/blog/2013/04/firefox-os-for- raspberry-pi-now-available/ http://www.philipp-wagner.com/ffos-for- rpi/download/rpi-b2g-image-raspberrypi- 20130411092136.rootfs.rpi-sdimg.bz2
  • 11. But what about… Answer: Functionality and Performance
  • 12. Multitouch Accelerometer Cameras Speaker Microphone Bluetooth Hardware Keys Light Sensor NFC USB Access Vibration Motor Proximity Sensor Gyro Functionality
  • 13. Communication s APIs Bluetooth Mobile Connection Network Connection Network Stats TCO Socket Telephony WebSMS WiFi Info Push Notification NFC WebRTC Hardware Access APIs Ambient Light Sensor Battery Status Camera Pointer Lock Proximity Screen Orientation Vibration WebFM GeoLocation USB Alarm App Management Idle Permissions Time/Clock WebPayment Device Storage Contacts Calandar App Services APIs
  • 14. Performance: Parallel JS Data parallelism for JavaScript • Goal: exploit multiple-cores, vector instructions, GPUs • Design based upon Intel’s “Rivertrail” prototype • On standardization track • Experimental implementation now in Firefox Nightly http://wiki.ecmascript.org/doku.php?id=strawman:data_parallelism
  • 15. Parallel JS Example function averageSavingsAterAge(peopleData, age) { age = +age; var peeps = new ParallelArray(peopleData); var pop = peeps.filter(function(person) { return person.age>age}); var totalSavings = pop.reduce(function(subtotal,person) { return subtotal+person.savings}); return totalSavings / pop.size; }
  • 16. • Subset of JavaScript that approximates a classic Von Neumann computer • asm.js code executes identically on any Javascript engine • But a JS engine may recognize asm.js code and optimize for it. • asmjs.org • https://wiki.mozilla.org/Javascript:Spide rMonkey:OdinMonkey asm.js – C level Performance
  • 17. C++ to JavaScript C++ source code Clang: C++ Compiler Front-end LLVM Bitcode LLVM Optimizer JavaScript (asm.js) source code JavaScript Engine (asm.js aware) JavaScript (asm.js) source code Development Time App Run Time Emscrpten Better LLVM Bitcode
  • 18. Source: Alon Zakai (@kripken) http://kripken.github.com/mloc_emscripten_talk
  • 19. Why not a web bytecode engine? asm.js code is just YAIR (Yet Another Intermediate Representation) function strlen(ptr) { ptr = ptr|0; var curr = 0; curr = ptr; while (MEM8[curr]|0 != 0) { curr = (curr + 1)|0; } return (curr - ptr)|0; } func strlen param ptr, int32 local curr, int32, ptr label loop index8 indx, heap, curr read next, indx bne next, exit add curr, curr, 1 goto loop label exit sub tmp, curr, ptr return sub
  • 20. What is ECMAScript? • ECMAScript is the name of the international standard that defines JavaScript • Developed by Technical Committee 39 (TC-39) of Ecma International • Issued as a Ecma-262 and ISO/IEC 16262 • Not part of W3C Google Mozilla Microsoft Webkit V8 SpiderMonkey Chakra JSCore JavaScript Implementations
  • 21. ECMAScript 6 (and beyond) Goals http://wiki.ecmascript.org/doku.php?id=harmony:harmony 1. Be a better language for: A. complex applications; B. libraries (including the DOM) shared by those applications; C. code generators targeting the new edition. 2. …
  • 22. What Kind of Language Is JavaScript?• Functional? • Object-oriented? • Class-based? • Prototype-based? • Permissive? • Secure? Photo by crazybarefootpoet @ flickr (CC BY-NC-SA 2.0)
  • 23. ECMAScript 6 Functional Programming • Arrow functions • Comprehensions • Generators • Tail calls Object-oriented Programming • Class declarations • Concise methods syntax • Super calls • Subclassable built-ins ES6 Feature complete draft December 2013 Approved Standard December 2014 ES6 Schedule:
  • 24. Arrow Functions var pop = peeps.filter(function(person) { return person.age>age}); var pop = peeps.filter(person => person.age>age); Becomes:
  • 25. var self = this; var pop = peeps.filter(function(person) { return person.age>self.age}); Arrow Functions Becomes: var pop = peeps.filter(person => person.age>this.age);
  • 26. Classes Today //define Employee as a subclass of Person function Employee(name,id) { Person.call(name); this.id = id; } Employee.prototype=Object.create(Person.prototype); Object.defineProperty(Employee.prototype, “constructor”, {value:Employee,enumerable:false,configurable: true}); Employee.__proto__ = Person; Employee.prototype.hire = function() {…}; Employee.prototype.fire = function () {…}; …
  • 27. Classes in ES6 //ES6 define Employee as subclass of Person class Employee extends Person { constructor(name,id) { super(name); this.id = id; } hire () {…} fire () {…} … }
  • 28. Classes Today vs ES6 //define Employee as subclass of Person function Employee(name,id) { Person.call(name); this.id = id; } Employee.prototype=Object.create(Person.prototype); Object.defineProperty(Employee.prototype, “constructor”, {value:Employee,enumerable:false,configurable: true}); Employee.__proto__ = Person; Employee.prototype.hire = function() {…}; Employee.prototype.fire = function () {…}; … //ES6 define Employee as subclass of Person class Employee extends Person { constructor(name,id) { super(name); this.id = id; } hire () {…} fire () {…} … }
  • 29. The Rise and Fall of Personal Computing http://www.asymco.com/2012/01/17/the-rise-and-fall-of-personal-computing/
  • 30. The Rise and Fall of Ambient Computing 2005 2008 2011 2014 2017 2020 2023 2026 2029 2032 2035 2038 2041 2044 2047 2050
  • 31. We’re all collectively creating a new era of computing. Enjoy it! Own it!
  • 32. Warsaw Saturday, June 1, 2013 Apply to attend http://bit.ly/FxOSAppWorkshop-apply More info https://hacks.mozilla.org/2013/03/firefox-os-app-workshops/ • For skilled JavaScript/HTML5 Developers • Turn your site or webapp into a Firefox OS App • Take home a phone!

Editor's Notes

  1. From this perspective, I think we’ve only had two computing era so for.The first era of computing started with in invention of stored program computer in the late 1940’s and really began to take of in the mid-1950’s. The first computers were large and expensive and could only be bought and operated by the largest private and government enterprises. Much of the focus of the early computing industry was on discovering how computers could be used to improve organization efficiency. The payback from such improvements were necessary to justify the great expensing of acquiring, programming, and operating such machine. Many such uses were found and by the late 1970’s virtually every enterprise with more than a few dozen employees either had an in-house computer or were making extensive use of external computing services. The first Era of computing was about were made corporations more efficient.Starting in the late 1970s the use of computer began to shift to supporting individual tasks. People would go to “their” computer and use it to accomplish some task. Note that the end of a computing era doesn’t means that we stop using computer for that era’s goals. Those uses continue on into the new era. A new era is about as shift in the primary focus and use cases of computing. So, if we are really entering a new computing era there must be a new focus for coputing. It must be empower something new. What is it?
  2. Be a better language for writing:complex applications;libraries (including the DOM) shared by those applications;code generators targeting the new edition.Testable specification and implementations.Improve interoperation, adopting de facto standards where possible.Keep versioning as simple and linear as possible.Support a statically verifiable, object-capability secure subset.