Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
So bright it burns
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
dherman
November 04, 2011
Programming
250
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
So bright it burns
My YUIConf 2011 keynote
dherman
November 04, 2011
More Decks by dherman
See All by dherman
Rust + Node = Neon
dherman
1
380
Evolving the World's Most Popular Programming Language
dherman
0
720
Closing iterators
dherman
0
840
A better future for comprehensions
dherman
0
2.1k
Evolution is Awesome
dherman
0
680
Status Report: ES6 Modules
dherman
16
4.1k
Discussion with TC39 about the semantics of symbols
dherman
1
450
September 2013 Modules Status Update
dherman
2
1.4k
Rust: low-level programming without the segfaults
dherman
13
9.1k
Other Decks in Programming
See All in Programming
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
120
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
170
Oxcを導入して開発体験が向上した話
yug1224
4
320
エージェンティックRAGにAWSで入門しよう!
har1101
8
1.7k
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
720
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
160
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
590
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
400
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
6.8k
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
140
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
150
Featured
See All Featured
How GitHub (no longer) Works
holman
316
150k
Thoughts on Productivity
jonyablonski
76
5.2k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
エンジニアに許された特別な時間の終わり
watany
107
250k
The Curse of the Amulet
leimatthew05
1
13k
Building the Perfect Custom Keyboard
takai
2
800
Navigating Team Friction
lara
192
16k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
630
The Pragmatic Product Professional
lauravandoore
37
7.3k
Transcript
THE FUTURE OF JAVASCRIPT SO BRIGHT IT BURNS
Hi, I’m dherman @littlecalculist
I — JavaScript and I love the language it almost
is...
None
None
tl;dr
TIER 1 AWESOMENESS modules • block scoping • generators •
proxies • binary data • destructuring • rest-args & defaults TIER 2 AWESOMENESS name objects • custom iteration • comprehensions • string templates • hash tables & weak maps
Great languages deserve great libraries and that means modules
None
browser <script></script>
var Collections = (function() { function Dict()
{ ... } return { Dict: Dict }; })();
“The human compiler, at work.” — Paul Graham “The sincerest
form of feature request.” — someone?
module Collections { export function Dict() {
... } }
import { $ } from "jquery.js"; import { map, each
} from "underscore.js";
import { $ } from "jquery.js"; import { map, each
} from "underscore.js"; loaded once, before execution
let is the new var block scoping (at long, long
last)
for (i = 0; i < a.length; i++) {
var x = a[i]; x.onclick = function() { x.toggle() }; }
for (i = 0; i < a.length; i++) {
let x = a[i]; x.onclick = function() { x.toggle() }; }
Generator functions an alternative to callback spaghetti
function* counter() { yield 1;
yield 2; yield 3; } var g = counter(); alert(g.next()); // 1 alert(g.next()); // 2 alert(g.next()); // 3
XHR("foo.txt", function(foo) { XHR("bar.txt", function(bar) {
XHR("baz.txt", function(baz) { setTimeout(function() { status.innerHTML = foo + bar + baz; }, 1000); }); }); });
XHR("foo.txt", function(foo) { XHR("bar.txt", function(bar) {
XHR("baz.txt", function(baz) { setTimeout(function() { status.innerHTML = foo + bar + baz; }, 1000); }); }); }); pyramid of doom
function onTimeout(foo, bar, baz) { status.innerHTML =
foo + bar + baz; } XHR("foo.txt", function(foo) { XHR("bar.txt", function(bar) { XHR("baz.txt", function(baz) { setTimeout(function() { onTimeout(foo, bar, baz); }, 1000); }); }); });
function onTimeout(foo, bar, baz) { status.innerHTML =
foo + bar + baz; } function onBaz(foo, bar, baz) { setTimeout(function() { onTimeout(foo, bar, baz); }, 1000); } XHR("foo.txt", function(foo) { XHR("bar.txt", function(bar) { XHR("baz.txt", function(baz) { onBaz(foo, bar, baz); }); }); });
function onTimeout(foo, bar, baz) { status.innerHTML =
foo + bar + baz; } function onBaz(foo, bar, baz) { setTimeout(function() { onTimeout(foo, bar, baz); }, 1000); } function onBar(foo, bar) { XHR("baz.txt", function(baz) { onBaz(foo, bar, baz); }); } XHR("foo.txt", function(foo) { XHR("bar.txt", function(bar) { onBar(foo, bar); }); });
function onTimeout(foo, bar, baz) { status.innerHTML =
foo + bar + baz; } function onBaz(foo, bar, baz) { setTimeout(function() { onTimeout(foo, bar, baz); }, 1000); } function onBar(foo, bar) { XHR("baz.txt", function(baz) { onBaz(foo, bar, baz); }); } function onFoo(foo) { XHR("bar.txt", function(bar) { onBar(foo, bar); }); } XHR("foo.txt", onFoo);
Pour 1/2 cup water into pan. When you’re done: Bring
water to boil. When that’s done: Lower heat and add rice. After 15 minutes: Turn off heat and serve.
spawn(function*() { var foo = yield read("foo.txt"),
bar = yield read("bar.txt"), baz = yield read("baz.txt"); yield sleep(1000); status.innerHTML = foo + bar + baz; });
Proxies meta-programming for fun and profit
var p = new Proxy(obj, { get:
function(...) { ... }, set: function(...) { ... }, delete: function(...) { ... }, ... });
Bits, bytes and blobs binary file and network I/O
var Point2D = new StructType({ x: uint32,
y: uint32 }); var Color = new StructType({ r: uint8, g: uint8, b: uint8 });
var Pixel = new StructType({ point: Point2D,
color: Color }); var Triangle = new ArrayType(Pixel, 3);
new Triangle([ { point: { x: 0,
y: 0 }, color: { r: 255, g: 255, b: 255 } }, { point: { x: 5, y: 5 }, color: { r: 128, g: 0, b: 0 } }, { point: { x: 10, y: 0 }, color: { r: 0, g: 0, b: 128 } } ])
Destructuring try it, you’ll like it
var { r, g, b } = thing.color; var [x,
y] = circle.center; [a, b] = [b, a];
function div({ width, height, border }) {
... }
Rest-args and defaults death to the arguments object!
function f(i, j, ...rest) { return rest.slice(i,
j); }
array.push(thing1, thing2, ...moarThings); var shape = new Shape(...points);
function img(src, width=320, height=240) { ... }
function img({ src,
width=320, height=240 }) { ... }
Name objects first-class, unique property keys
function Container() { var secret = 3;
this.service = function() { if (secret-‐-‐) { ... } }; }
var key = Name.create("secret"); function Container() { this[key] = 3
} Container.prototype = { service: function() { if (this[key]-‐-‐) { ... } } };
Custom object iteration taming the for-in loop
for (x in [3, 4, 5])
// 0, 1, 2 (d’oh) for (x of [3, 4, 5]) // 3, 4, 5 for (x of keys(o)) // keys in o for (x of values(o)) // values of o for ([k, v] of items(o)) // props of o
import iterate from "@iter"; obj[iterate] = function() {
return { next: function() { ... } } } for (x of obj) { ... }
Comprehensions beautiful array processing
[ x * y for (x of obj1) for (y
of obj2) ] ( x * y for (x of obj1) for (y of obj2) )
String templates untangling string formatting code
"<p>\nohai, " + firstName + " " + lastName +
"\n</p>"
`<p> ohai, ${firstName} ${lastName} </p>`
safeHTML`<p> ohai, ${firstName} ${lastName} </p>`
Object-keyed tables hash tables and weak maps
var scores = new Map(); var player1 = { ...
}; scores.set(player1, 0); scores.get(player1) // 0
var markers = new WeakMap(); var tile = new Tile(...);
var results = [...]; tiles.set(tile, results);
There is a bigger picture.
“Be a better language for: a. complex apps b. libraries
c. code generators”
Motivated by use cases. Solve with simple, general, composable features.
Pieces have to fit together in a cohesive whole.
study the issues study the big picture study the issues
again study the big picture again study the issues again SHIP IT!
Work in the open wiki.ecmascript.org es-discuss
How soon is now?
We (Ecma) are working hard and fast on the spec.
We (vendors) are prototyping and shipping features now. Transpilers as language shims: Traceur, Narcissus
None