the state of javascript

48
The State of JavaScript

Upload: domenic-denicola

Post on 08-May-2015

2.763 views

Category:

Technology


1 download

DESCRIPTION

Our favorite language is now powering everything from event-driven servers to robots to Git clients to 3D games. The JavaScript package ecosystem has quickly outpaced past that of most other languages, allowing our vibrant community to showcase their talent. The front-end framework war has been taken to the next level, with heavy-hitters like Ember and Angular ushering in the new generation of long-lived, component-based web apps. The extensible web movement, spearheaded by the newly-reformed W3C Technical Architecture Group, has promised to place JavaScript squarely at the foundation of the web platform. Now, the language improvements of ES6 are slowly but surely making their way into the mainstream— witness the recent interest in using generators for async programming. And all the while, whispers of ES7 features are starting to circulate… JavaScript has grown up. Now it's time to see how far it can go.

TRANSCRIPT

Page 1: The State of JavaScript

The State of JavaScript

Page 2: The State of JavaScript

form validation

image rollovers

1995

ECMA-262 edition 1

Internet Explorer 4

DHTML

1997

ES3 (function expressions, try/catch/finally, regexps, …)1999

Page 3: The State of JavaScript

WHATWG formed, focusing on web applications2004

Ajax (XMLHttpRequest) appears2005

jQuery 1.02006

Page 4: The State of JavaScript

V8 released, and the speed race begins

JS: The Good Parts released

2008

ES5

ServerJS/CommonJS

Node.js

PhoneGap

JSConf

2009

Backbone.js

RequireJS

2010

Page 5: The State of JavaScript

Windows 8

Nodecopter

2012

Nodebots

Ember

Angular

The Extensible Web Manifesto

asm.js

2013

ES6

ES7

???

2014

Page 6: The State of JavaScript

JS on the front-end

Page 7: The State of JavaScript

In the beginning, there was

Page 8: The State of JavaScript

then we said, i have heard about this “mvc” thing!

and there was

Page 9: The State of JavaScript

then we looked upon data-binding, and saw it was good.

and there was

Page 10: The State of JavaScript

HTML enhanced for web apps!

Page 11: The State of JavaScript

A framework for creating ambitious web applications.

Page 12: The State of JavaScript

but, why let the libraries have all the fun?

Page 13: The State of JavaScript
Page 14: The State of JavaScript

Web components are…

Shadow DOM

Custom Elements

<template>

HTML imports

Page 15: The State of JavaScript

polymer, the web components prolyfill

Page 16: The State of JavaScript

#extendthewebforward

extensiblewebmanifesto.org

Page 17: The State of JavaScript

JS on everything

Page 18: The State of JavaScript
Page 19: The State of JavaScript
Page 20: The State of JavaScript

node repl.js

drone> takeoff()

drone> clockwise(0.5)

drone> front(1)

drone> land()

Page 21: The State of JavaScript
Page 22: The State of JavaScript

var five = require("johnny-five");var board = new five.Board();

board.on("ready", function () { var sonar = new five.Sonar("A2"); sonar.on("data", function() { console.log(this.cm); });});

Page 23: The State of JavaScript

node-serialport

?

Page 24: The State of JavaScript

node-serialport

???

Page 25: The State of JavaScript

node-serialportport.on("open", function () { port.on("data", function (data) { console.log(data); }); port.write("ls\n", function (err, res) { // … });});

Page 26: The State of JavaScript
Page 27: The State of JavaScript
Page 28: The State of JavaScript
Page 29: The State of JavaScript
Page 30: The State of JavaScript
Page 31: The State of JavaScript
Page 32: The State of JavaScript
Page 33: The State of JavaScript
Page 34: The State of JavaScript

JS the language

Page 35: The State of JavaScript

asm.jsan extraordinarily optimizable, low-level subset of JavaScript

Page 36: The State of JavaScript

js as the assembly of the web

Page 37: The State of JavaScript

js as the vm of the web

Page 38: The State of JavaScript

.NET

JVM

Ruby

Python

Haskell

Page 39: The State of JavaScript
Page 40: The State of JavaScript

traceur

Page 41: The State of JavaScript

es6ify

Page 42: The State of JavaScript

es6 goals Be a better language for writing:

- Complex applications

- Libraries (including the DOM) shared by those applications

- Code generators targeting the new edition

Page 43: The State of JavaScript

what’s in es6 anyway: syntax

Class sugar: class, extends, super

Arrow functions: arr.map(x => x * x)

Destructuring: var { x, y } = getPoint()

Rest/spread: var [first, …rest] = els; Math.max(...myArray)

Parameter defaults: function parseInt(x, base = 10) { }

Page 44: The State of JavaScript

what’s in es6 anyway: data structures

Map: object-to-object O(1) access time

Set: O(1) lookup and storage

WeakMap/WeakSet: private state and branding

Iteration protocol: for-of across anything, even user iterables

Typed objects: const Point = new StructType({ x: uint32, y: uint32 });

Page 45: The State of JavaScript

what’s in es6 anyway: game-changers

Generators: lazy sequences and async/await-like syntax

Promises: standardized async; play well with generators

Subclassable builtins: custom arrays, dates, regexps, …

Proxies: virtual objects, no more .get(…)/.set(…, …)!

Template strings: jsx`<a href="${url}">${text}</a>`

Modules: an end to the AMD/CommonJS schism

Page 46: The State of JavaScript

es7 is one more than es6

Page 47: The State of JavaScript

what maybe possibly could be in es7

Weak references: useful for e.g. auto-cleanup of data-binding

Async/await: function^() { var res = await promise; }

Object.observe: no-overhead observation

Value types: both built-in (integers!) and user-defined

Bind operator: var method = ::obj.foo

Page 48: The State of JavaScript