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
The Future of JavaScript
Search
dherman
April 20, 2012
Programming
8.6k
52
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
The Future of JavaScript
SFRails, 4/19/12
dherman
April 20, 2012
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
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
780
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.7k
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.7k
LaravelLive Japan の裏方のすべて — 第188回 PHP勉強会@東京 (2026-06-24)
suguruooki
2
150
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
380
The NotImplementedError Problem in Ruby
koic
1
1.1k
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
210
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.7k
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
180
ローカルLLMでどこまでコードが書けるか -縮小版 / How much code can be written on a local LLM Shortened
kishida
2
170
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
210
act1-costs.pdf
sumedhbala
0
160
Featured
See All Featured
Claude Code のすすめ
schroneko
67
230k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
320
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Unsuck your backbone
ammeep
672
58k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
380
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
How GitHub (no longer) Works
holman
316
150k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Designing Powerful Visuals for Engaging Learning
tmiket
1
440
Transcript
THE FUTURE => OF JAVASCRIPT Dave Herman
Hi, I’m dherman @littlecalculist
I — JavaScript and I love the language it almost
is...
None
None
modules • block scoping • generators • proxies • binary
data • destructuring • rest-args & defaults • name objects • custom iteration • comprehensions • string templates • hash tables & weak maps • class syntax • full Unicode • function/object shorthands tl;dr:
Great libraries need modules
var Collections = (function() { function Dict()
{ ... } return { Dict: Dict }; })();
None
browser <script></script>
“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
Generators cleaning up callback spaghetti
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; }); promise
Binary data efficient memory layout and I/O
var Point2D = struct({ x: uint32,
y: uint32 }); var Color = struct({ r: uint8, g: uint8, b: uint8 });
var Pixel = struct({ point: Point2D,
color: Color }); var Triangle = array(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 } } ])
Name objects first-class, unique property keys
function Container() { var secret = 3;
this.service = function() { if (secret-‐-‐) { ... } }; }
var key = new Name("secret"); function Container() { this[key] =
3 } Container.prototype = { service: function() { if (this[key]-‐-‐) { ... } } };
Familiar friends… should be no surprise for Rubyists
Destructuring: var [x, y] = getPair(); Parameter defaults: function(x=0, y=0)
{ } Rest/splat: function(...args) { return args } Iterators: for (x of keys(obj)) { } String interpolation: `Hello ${username}!`
The 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
[email protected]
Work in the open wiki.ecmascript.org
[email protected]
Thank you.