ECMAScript 4:
The Reckoning
John Resig
2007: ShibuyaJS
The Direction
ECMAScript 4
JavaScript 2 ActionScript 4
Tamarin
JScript Etc.
Screaming
Monkey
KJS (Apple)
Opera
A TON of new
features!
Classes
✦ class Programmer {
var name;
var city = “Boston, MA”;
const interest = “computers”;
function work() {}
}
✦ var p = new Programmer;
p.name = “John”;
p.work();
p.work.apply( someotherp );
p.interest = “science”; // Error
p.lastName = “Resig”; // Error
Catch-Alls
✦ dynamic class Programmer {
meta function get(name) { ... }
meta function set(name, value) {
alert(“Setting “ + name + “ to “ + value);
}
}
✦ var p = new Programmer
p.name = “John”;
// alert(“Setting name to John”);
Inheritance
✦ class Artist {
function draw() { alert(“Drawing!”); }
}
class Designer extends Artist {
override function draw() {
alert(“Designing!”);
}
}
✦ var d = new Designer
d.draw();
// alert(“Designing!”);
Interfaces
✦ Verify that a class implements another
✦ interface Artist {
function draw();
}
class Designer implements Artist {
function draw() { alert(“Designing!”); }
}
✦ var d = new Designer();
if ( d is Artist )
alert(“Designers are Artists!”);
Too much?
The new features are important!
They give the language more power and
make large applications easier to create.
Plus applications will be able to get faster!
The new features are important!
They give the language more power and
make large applications easier to create.
(Plus it’s close to what we’ve already
done in ActionScript!)
There are too many new features!
Not enough attention was paid to security.
Not enough attention was paid to security.
We don’t like it.
WAR!
YES NO
The Direction
ECMAScript 4
JavaScript 2 ActionScript 4
Tamarin
JScript Etc.
Screaming
Monkey
KJS (Apple)
Opera
Compromise:
NO SYNTAX CHANGES
Compromise:
LESS NEW FEATURES
ECMAScript 5!!
JSON Parsing
• JSON.parse(“true”) -> true
• JSON.stringify(true) -> “true”
Strict Mode
• (function(){
“use strict”;
// NO eval, with, etc.
})();
Object Properties
• var obj = {};
• Object.defineProperty( obj, "value", {
  value: true,
  writable: false,
  enumerable: true,
  configurable: true
});
• (function(){
  var name = "John";
 
  Object.defineProperty( obj, "name", {
    get: function(){ return name; },
    set: function(value){ name = value; }
  });
})();
HARMONY:
Build off of ES5
What about Tamarin?
Don’t need it!
COMPETITION:
Everyone got faster!
Don’t need a new
language to get
faster.
More about ES5
• http://ejohn.org/blog/ecmascript-5-objects-
and-properties/
• http://ejohn.org/blog/ecmascript-5-strict-
mode-json-and-more/
Processing.js
John Resig
Processing
✦ Data visualization programming language
✦ Built on top of Java
✦ I ported it to JavaScript in 2008!
✦ Crude port of the Processing Language +
✦ Porting the 2D Processing API
✦ All runs in JavaScript on top of HTML 5
Canvas
✦ Works in all browsers (IE with excanvas)
The Language
✦ Strictly typed
✦ Has classes, inheritance
✦ A bunch of globally-accessible functions
✦ (Very flat API)
✦ setup() and draw() methods
✦ Very OpenGL-like
✦ draw() is called continually at a specific
framerate
Draw A Line w/ Mouse
✦ While you hold the mouse down, draw a
line from the previous mouse point
✦ http://ejohn.org/apps/processing.js/
examples/topics/continuouslines.html
✦ void setup() {
size(200, 200);
background(102);
}
void draw() {
stroke(255);
if (mousePressed) {
line(mouseX, mouseY, pmouseX, pmouseY);
}
}
Drawing
✦ Different drawing methods:
✦ line()
✦ rect()
✦ arc()
✦ ellipse()
✦ point()
✦ quad()
✦ triangle()
✦ bezier()
✦ All use stroke(), strokeWeight(), fill()
The Canvas
✦ OpenGL-y
✦ Mutate the canvas rendering:
✦ translate()
✦ scale()
✦ rotate()
✦ Save and Restore the state of the canvas:
✦ pushMatrix()
✦ popMatrix()
✦ http://ejohn.org/apps/processing.js/
examples/basic/arm.html
Shapes
✦ A series of vertices, built into a shape
✦ fill(127);
beginShape();
for (int i=0; i<segments; i++){
vertex(ground[i].x1, ground[i].y1);
vertex(ground[i].x2, ground[i].y2);
}
vertex(ground[segments-1].x2, height);
vertex(ground[0].x1, height);
endShape(CLOSE);
Classes
✦ Hold data, do inheritance
✦ http://ejohn.org/apps/processing.js/
examples/topics/reflection2.html
✦ class Ground {
float x1, y1, x2, y2, x, y, len, rot;
Ground(){ }
Ground(float x1, float y1, float x2, float y2) {
this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
x = (x1+x2)/2;
y = (y1+y2)/2;
len = dist(x1, y1, x2, y2);
rot = atan2((y2-y1), (x2-x1));
}
}
ECMAScript 4??
Processing.js 1.0!
✦ Just released yesterday!
✦ Full API parity with Processing
✦ ALSO
✦ Full WebGL/3D support!
✦ A great API for doing graphical work.
jQuery Mobile
John Resig
The Missing Gap
• Almost all mobile web development
focuses on modern WebKit
• There are far too many other platforms
• Blackberry, Opera,Windows Mobile,
Mobile Firefox, Symbian, etc.
• jQuery Mobile works everywhere - and
without sacrificing experience.
Shibuya.js Lightning Talks
Shibuya.js Lightning Talks
Phase 1: jQuery Core
• We’re working to make jQuery core work
on all the popular mobile browsers.
• Building out our test suite and continuous
integration testing.
• Using TestSwarm to automate our testing
across all platforms.
• Fixing mobile bugs in core.
Shibuya.js Lightning Talks
Phase 2: jQuery Mobile
• A complete framework for building mobile
web sites and applications.
• Provide all the widgets and layout
components necessary to build mobile
sites.
• Built on the principles of progressive
enhancement
Shibuya.js Lightning Talks
Shibuya.js Lightning Talks
Shibuya.js Lightning Talks

More Related Content

PDF
Processing and Processing.js
PDF
History of jQuery
PDF
PhoneGap: Local Storage
PDF
Node meetup feb_20_12
PDF
Prototype & jQuery
PDF
스위프트를 여행하는 히치하이커를 위한 스타일 안내
PDF
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
PDF
HTML5 and CSS3 Refresher
Processing and Processing.js
History of jQuery
PhoneGap: Local Storage
Node meetup feb_20_12
Prototype & jQuery
스위프트를 여행하는 히치하이커를 위한 스타일 안내
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
HTML5 and CSS3 Refresher

What's hot (20)

PDF
Node.js - Demnächst auf einem Server in Ihrer Nähe
PDF
jQuery in 15 minutes
ODP
Introduction to jQuery
PDF
The Future of JavaScript (SXSW '07)
PPTX
Oh, you’re the NY times guy
PDF
Web Components With Rails
PDF
Laziness in Swift
PDF
Learning jQuery in 30 minutes
PDF
画像Hacks
PDF
The jQuery Divide
PDF
Joe Walker Interactivewebsites Cometand Dwr
PPTX
jQuery Foot-Gun Features
PPT
jQuery Loves You
PDF
The Beauty of Java Script
PDF
The Dom Scripting Toolkit J Query
PPTX
Ricky Bobby's World
PPTX
Jquery optimization-tips
PDF
Is HTML5 Ready? (workshop)
PDF
The Beauty Of Java Script V5a
PDF
An Introduction to Jquery
Node.js - Demnächst auf einem Server in Ihrer Nähe
jQuery in 15 minutes
Introduction to jQuery
The Future of JavaScript (SXSW '07)
Oh, you’re the NY times guy
Web Components With Rails
Laziness in Swift
Learning jQuery in 30 minutes
画像Hacks
The jQuery Divide
Joe Walker Interactivewebsites Cometand Dwr
jQuery Foot-Gun Features
jQuery Loves You
The Beauty of Java Script
The Dom Scripting Toolkit J Query
Ricky Bobby's World
Jquery optimization-tips
Is HTML5 Ready? (workshop)
The Beauty Of Java Script V5a
An Introduction to Jquery
Ad

Viewers also liked (6)

KEY
Hacking The Newsroom
KEY
Emergence
KEY
Processing & Dataviz
KEY
Data Representation - Day 2
KEY
ITP Data Rep - Class3
PPTX
Learn Creative Coding: Begin Programming with the Processing Language
Hacking The Newsroom
Emergence
Processing & Dataviz
Data Representation - Day 2
ITP Data Rep - Class3
Learn Creative Coding: Begin Programming with the Processing Language
Ad

Similar to Shibuya.js Lightning Talks (20)

PDF
The Future of JavaScript (Ajax Exp '07)
PDF
JavaScript 1.5 to 2.0 (TomTom)
PDF
JavaScript for PHP developers
PDF
Tamarin And Ecmascript 4
PDF
ECMAScript 6 new features
PPTX
ES6: Features + Rails
PDF
Short intro to ECMAScript
PDF
JavaScript 2016 for C# Developers
PDF
Tamarin and ECMAScript 4
PDF
An Intro To ES6
DOC
Jsphp 110312161301-phpapp02
PDF
Clojure for Java developers - Stockholm
PDF
JavaScript Core
ODP
ES6 PPT FOR 2016
PPTX
ES6, 잘 쓰고 계시죠?
PPTX
ES6 is Nigh
PDF
2013-06-15 - Software Craftsmanship mit JavaScript
PDF
2013-06-24 - Software Craftsmanship with JavaScript
PPTX
AST - the only true tool for building JavaScript
PDF
ES6: The future is now
The Future of JavaScript (Ajax Exp '07)
JavaScript 1.5 to 2.0 (TomTom)
JavaScript for PHP developers
Tamarin And Ecmascript 4
ECMAScript 6 new features
ES6: Features + Rails
Short intro to ECMAScript
JavaScript 2016 for C# Developers
Tamarin and ECMAScript 4
An Intro To ES6
Jsphp 110312161301-phpapp02
Clojure for Java developers - Stockholm
JavaScript Core
ES6 PPT FOR 2016
ES6, 잘 쓰고 계시죠?
ES6 is Nigh
2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-24 - Software Craftsmanship with JavaScript
AST - the only true tool for building JavaScript
ES6: The future is now

More from jeresig (20)

PDF
Does Coding Every Day Matter?
PDF
Accidentally Becoming a Digital Librarian
PDF
2014: John's Favorite Thing (Neo4j)
PDF
Computer Vision as Art Historical Investigation
PDF
Hacking Art History
PDF
Using JS to teach JS at Khan Academy
PDF
Applying Computer Vision to Art History
PDF
NYARC 2014: Frick/Zeri Results
PDF
EmpireJS: Hacking Art with Node js and Image Analysis
PDF
Applying Computer Vision to Art History
PDF
JavaScript Libraries (Ajax Exp 2006)
PDF
Introduction to jQuery (Ajax Exp 2006)
PDF
jQuery Recommendations to the W3C (2011)
PDF
jQuery Open Source Process (RIT 2011)
PDF
jQuery Open Source Process (Knight Foundation 2011)
PDF
jQuery Mobile
PDF
jQuery Open Source (Fronteer 2011)
PDF
Holistic JavaScript Performance
PDF
New Features Coming in Browsers (RIT '09)
PDF
Introduction to jQuery (Ajax Exp 2007)
Does Coding Every Day Matter?
Accidentally Becoming a Digital Librarian
2014: John's Favorite Thing (Neo4j)
Computer Vision as Art Historical Investigation
Hacking Art History
Using JS to teach JS at Khan Academy
Applying Computer Vision to Art History
NYARC 2014: Frick/Zeri Results
EmpireJS: Hacking Art with Node js and Image Analysis
Applying Computer Vision to Art History
JavaScript Libraries (Ajax Exp 2006)
Introduction to jQuery (Ajax Exp 2006)
jQuery Recommendations to the W3C (2011)
jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (Knight Foundation 2011)
jQuery Mobile
jQuery Open Source (Fronteer 2011)
Holistic JavaScript Performance
New Features Coming in Browsers (RIT '09)
Introduction to jQuery (Ajax Exp 2007)

Recently uploaded (20)

PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
sbt 2.0: go big (Scala Days 2025 edition)
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
STKI Israel Market Study 2025 version august
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Five Habits of High-Impact Board Members
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Abstractive summarization using multilingual text-to-text transfer transforme...
PDF
Architecture types and enterprise applications.pdf
PPTX
2018-HIPAA-Renewal-Training for executives
PDF
Two-dimensional Klein-Gordon and Sine-Gordon numerical solutions based on dee...
PDF
A comparative study of natural language inference in Swahili using monolingua...
DOCX
search engine optimization ppt fir known well about this
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPTX
Microsoft Excel 365/2024 Beginner's training
Convolutional neural network based encoder-decoder for efficient real-time ob...
Custom Battery Pack Design Considerations for Performance and Safety
Enhancing emotion recognition model for a student engagement use case through...
sbt 2.0: go big (Scala Days 2025 edition)
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
STKI Israel Market Study 2025 version august
Credit Without Borders: AI and Financial Inclusion in Bangladesh
Developing a website for English-speaking practice to English as a foreign la...
Five Habits of High-Impact Board Members
Taming the Chaos: How to Turn Unstructured Data into Decisions
Zenith AI: Advanced Artificial Intelligence
Abstractive summarization using multilingual text-to-text transfer transforme...
Architecture types and enterprise applications.pdf
2018-HIPAA-Renewal-Training for executives
Two-dimensional Klein-Gordon and Sine-Gordon numerical solutions based on dee...
A comparative study of natural language inference in Swahili using monolingua...
search engine optimization ppt fir known well about this
A review of recent deep learning applications in wood surface defect identifi...
Microsoft Excel 365/2024 Beginner's training

Shibuya.js Lightning Talks

  • 3. The Direction ECMAScript 4 JavaScript 2 ActionScript 4 Tamarin JScript Etc. Screaming Monkey KJS (Apple) Opera
  • 4. A TON of new features!
  • 5. Classes ✦ class Programmer { var name; var city = “Boston, MA”; const interest = “computers”; function work() {} } ✦ var p = new Programmer; p.name = “John”; p.work(); p.work.apply( someotherp ); p.interest = “science”; // Error p.lastName = “Resig”; // Error
  • 6. Catch-Alls ✦ dynamic class Programmer { meta function get(name) { ... } meta function set(name, value) { alert(“Setting “ + name + “ to “ + value); } } ✦ var p = new Programmer p.name = “John”; // alert(“Setting name to John”);
  • 7. Inheritance ✦ class Artist { function draw() { alert(“Drawing!”); } } class Designer extends Artist { override function draw() { alert(“Designing!”); } } ✦ var d = new Designer d.draw(); // alert(“Designing!”);
  • 8. Interfaces ✦ Verify that a class implements another ✦ interface Artist { function draw(); } class Designer implements Artist { function draw() { alert(“Designing!”); } } ✦ var d = new Designer(); if ( d is Artist ) alert(“Designers are Artists!”);
  • 10. The new features are important! They give the language more power and make large applications easier to create. Plus applications will be able to get faster!
  • 11. The new features are important! They give the language more power and make large applications easier to create. (Plus it’s close to what we’ve already done in ActionScript!)
  • 12. There are too many new features! Not enough attention was paid to security.
  • 13. Not enough attention was paid to security.
  • 16. The Direction ECMAScript 4 JavaScript 2 ActionScript 4 Tamarin JScript Etc. Screaming Monkey KJS (Apple) Opera
  • 20. JSON Parsing • JSON.parse(“true”) -> true • JSON.stringify(true) -> “true”
  • 21. Strict Mode • (function(){ “use strict”; // NO eval, with, etc. })();
  • 22. Object Properties • var obj = {}; • Object.defineProperty( obj, "value", {   value: true,   writable: false,   enumerable: true,   configurable: true }); • (function(){   var name = "John";     Object.defineProperty( obj, "name", {     get: function(){ return name; },     set: function(value){ name = value; }   }); })();
  • 25. Don’t need it! COMPETITION: Everyone got faster! Don’t need a new language to get faster.
  • 26. More about ES5 • http://ejohn.org/blog/ecmascript-5-objects- and-properties/ • http://ejohn.org/blog/ecmascript-5-strict- mode-json-and-more/
  • 28. Processing ✦ Data visualization programming language ✦ Built on top of Java ✦ I ported it to JavaScript in 2008! ✦ Crude port of the Processing Language + ✦ Porting the 2D Processing API ✦ All runs in JavaScript on top of HTML 5 Canvas ✦ Works in all browsers (IE with excanvas)
  • 29. The Language ✦ Strictly typed ✦ Has classes, inheritance ✦ A bunch of globally-accessible functions ✦ (Very flat API) ✦ setup() and draw() methods ✦ Very OpenGL-like ✦ draw() is called continually at a specific framerate
  • 30. Draw A Line w/ Mouse ✦ While you hold the mouse down, draw a line from the previous mouse point ✦ http://ejohn.org/apps/processing.js/ examples/topics/continuouslines.html ✦ void setup() { size(200, 200); background(102); } void draw() { stroke(255); if (mousePressed) { line(mouseX, mouseY, pmouseX, pmouseY); } }
  • 31. Drawing ✦ Different drawing methods: ✦ line() ✦ rect() ✦ arc() ✦ ellipse() ✦ point() ✦ quad() ✦ triangle() ✦ bezier() ✦ All use stroke(), strokeWeight(), fill()
  • 32. The Canvas ✦ OpenGL-y ✦ Mutate the canvas rendering: ✦ translate() ✦ scale() ✦ rotate() ✦ Save and Restore the state of the canvas: ✦ pushMatrix() ✦ popMatrix() ✦ http://ejohn.org/apps/processing.js/ examples/basic/arm.html
  • 33. Shapes ✦ A series of vertices, built into a shape ✦ fill(127); beginShape(); for (int i=0; i<segments; i++){ vertex(ground[i].x1, ground[i].y1); vertex(ground[i].x2, ground[i].y2); } vertex(ground[segments-1].x2, height); vertex(ground[0].x1, height); endShape(CLOSE);
  • 34. Classes ✦ Hold data, do inheritance ✦ http://ejohn.org/apps/processing.js/ examples/topics/reflection2.html ✦ class Ground { float x1, y1, x2, y2, x, y, len, rot; Ground(){ } Ground(float x1, float y1, float x2, float y2) { this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; x = (x1+x2)/2; y = (y1+y2)/2; len = dist(x1, y1, x2, y2); rot = atan2((y2-y1), (x2-x1)); } } ECMAScript 4??
  • 35. Processing.js 1.0! ✦ Just released yesterday! ✦ Full API parity with Processing ✦ ALSO ✦ Full WebGL/3D support! ✦ A great API for doing graphical work.
  • 37. The Missing Gap • Almost all mobile web development focuses on modern WebKit • There are far too many other platforms • Blackberry, Opera,Windows Mobile, Mobile Firefox, Symbian, etc. • jQuery Mobile works everywhere - and without sacrificing experience.
  • 40. Phase 1: jQuery Core • We’re working to make jQuery core work on all the popular mobile browsers. • Building out our test suite and continuous integration testing. • Using TestSwarm to automate our testing across all platforms. • Fixing mobile bugs in core.
  • 42. Phase 2: jQuery Mobile • A complete framework for building mobile web sites and applications. • Provide all the widgets and layout components necessary to build mobile sites. • Built on the principles of progressive enhancement