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
Contextとはなにか
chiroruxx
1
380
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
420
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.5k
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.5k
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
200
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
800
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
9.1k
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
260
ふつうのFeature Flag実践入門
irof
8
4.2k
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
200
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.7k
Webフレームワークの ベンチマークについて
yusukebe
0
180
Featured
See All Featured
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
160
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
Building Adaptive Systems
keathley
44
3.1k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
990
How to train your dragon (web standard)
notwaldorf
97
6.7k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
160
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
380
Producing Creativity
orderedlist
PRO
348
40k
The Invisible Side of Design
smashingmag
301
52k
Music & Morning Musume
bryan
47
7.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
450
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