SlideShare a Scribd company logo
CoffeeScript, ES.next, the JS Language Lab




                                                      mozilla

         1


Wednesday, May 4, 2011
What you should expect in the Future




                                                 mozilla

         2


Wednesday, May 4, 2011
What you should expect in the Future

         • “No fate but what we make.” - Sarah Connor, T2




                                                            mozilla

         2


Wednesday, May 4, 2011
What you should expect in the Future

         • “No fate but what we make.” - Sarah Connor, T2


         • “Leaders can imagine a world that others don’t. Like Thomas Jefferson or that
           kid in the Terminator movies.” - Finn, Glee




                                                                                    mozilla

         2


Wednesday, May 4, 2011
What you should expect in the Future

         • “No fate but what we make.” - Sarah Connor, T2


         • “Leaders can imagine a world that others don’t. Like Thomas Jefferson or that
           kid in the Terminator movies.” - Finn, Glee


         • How to invent the future:




                                                                                    mozilla

         2


Wednesday, May 4, 2011
What you should expect in the Future

         • “No fate but what we make.” - Sarah Connor, T2


         • “Leaders can imagine a world that others don’t. Like Thomas Jefferson or that
           kid in the Terminator movies.” - Finn, Glee


         • How to invent the future:


               • CoffeeScript (and all the languages targeting JS)




                                                                                    mozilla

         2


Wednesday, May 4, 2011
What you should expect in the Future

         • “No fate but what we make.” - Sarah Connor, T2


         • “Leaders can imagine a world that others don’t. Like Thomas Jefferson or that
           kid in the Terminator movies.” - Finn, Glee


         • How to invent the future:


               • CoffeeScript (and all the languages targeting JS)


               • Compile ES.next -> JS of today with a Harmonizr




                                                                                    mozilla

         2


Wednesday, May 4, 2011
What you should expect in the Future

         • “No fate but what we make.” - Sarah Connor, T2


         • “Leaders can imagine a world that others don’t. Like Thomas Jefferson or that
           kid in the Terminator movies.” - Finn, Glee


         • How to invent the future:


               • CoffeeScript (and all the languages targeting JS)


               • Compile ES.next -> JS of today with a Harmonizr


               • Keep iterating...

                                                                                    mozilla

         2


Wednesday, May 4, 2011
The Harmony goals




                             mozilla

         3


Wednesday, May 4, 2011
The Harmony goals

         • Be a better language for writing:




                                               mozilla

         3


Wednesday, May 4, 2011
The Harmony goals

         • Be a better language for writing:

               • complex applications




                                               mozilla

         3


Wednesday, May 4, 2011
The Harmony goals

         • Be a better language for writing:

               • complex applications

               • libraries (including the DOM) shared by those applications




                                                                              mozilla

         3


Wednesday, May 4, 2011
The Harmony goals

         • Be a better language for writing:

               • complex applications

               • libraries (including the DOM) shared by those applications

               • code generators targeting the new edition




                                                                              mozilla

         3


Wednesday, May 4, 2011
The Harmony goals

         • Be a better language for writing:

               • complex applications

               • libraries (including the DOM) shared by those applications

               • code generators targeting the new edition

         • Better tests, if not a testable (executable) specification




                                                                              mozilla

         3


Wednesday, May 4, 2011
The Harmony goals

         • Be a better language for writing:

               • complex applications

               • libraries (including the DOM) shared by those applications

               • code generators targeting the new edition

         • Better tests, if not a testable (executable) specification

         • Adopt de facto standards where possible




                                                                              mozilla

         3


Wednesday, May 4, 2011
The Harmony goals

         • Be a better language for writing:

               • complex applications

               • libraries (including the DOM) shared by those applications

               • code generators targeting the new edition

         • Better tests, if not a testable (executable) specification

         • Adopt de facto standards where possible

         • Keep versioning as simple and linear as possible

                                                                              mozilla

         3


Wednesday, May 4, 2011
The Harmony goals

         • Be a better language for writing:

               • complex applications

               • libraries (including the DOM) shared by those applications

               • code generators targeting the new edition

         • Better tests, if not a testable (executable) specification

         • Adopt de facto standards where possible

         • Keep versioning as simple and linear as possible

         • Support a statically verifiable, object-capability secure subset    mozilla

         3


Wednesday, May 4, 2011
Approved for ES.next




                                mozilla

         4


Wednesday, May 4, 2011
Approved for ES.next

         • let, const, function in block scope




                                                 mozilla

         4


Wednesday, May 4, 2011
Approved for ES.next

         • let, const, function in block scope

         • destructuring: let {x, y} = pt; let [s, v, o] = triple()




                                                                      mozilla

         4


Wednesday, May 4, 2011
Approved for ES.next

         • let, const, function in block scope

         • destructuring: let {x, y} = pt; let [s, v, o] = triple()

         • parameter default values: function f(x, y=1, z=0) {...}




                                                                      mozilla

         4


Wednesday, May 4, 2011
Approved for ES.next

         • let, const, function in block scope

         • destructuring: let {x, y} = pt; let [s, v, o] = triple()

         • parameter default values: function f(x, y=1, z=0) {...}

         • rest, spread: function g(i, j, ...r) { return r.slice(i, j); }
                         let a = [0,1,2,3],
                             o = new any_constructor(...a)




                                                                      mozilla

         4


Wednesday, May 4, 2011
Approved for ES.next

         • let, const, function in block scope

         • destructuring: let {x, y} = pt; let [s, v, o] = triple()

         • parameter default values: function f(x, y=1, z=0) {...}

         • rest, spread: function g(i, j, ...r) { return r.slice(i, j); }
                         let a = [0,1,2,3],
                             o = new any_constructor(...a)


         • proxies, weak maps: Proxy.create(handler, proto), new WeakMap




                                                                      mozilla

         4


Wednesday, May 4, 2011
Approved for ES.next

         • let, const, function in block scope

         • destructuring: let {x, y} = pt; let [s, v, o] = triple()

         • parameter default values: function f(x, y=1, z=0) {...}

         • rest, spread: function g(i, j, ...r) { return r.slice(i, j); }
                         let a = [0,1,2,3],
                             o = new any_constructor(...a)


         • proxies, weak maps: Proxy.create(handler, proto), new WeakMap

         • modules: module M { export function fast_sin(x) {...} }


                                                                      mozilla

         4


Wednesday, May 4, 2011
Approved for ES.next

         • let, const, function in block scope

         • destructuring: let {x, y} = pt; let [s, v, o] = triple()

         • parameter default values: function f(x, y=1, z=0) {...}

         • rest, spread: function g(i, j, ...r) { return r.slice(i, j); }
                         let a = [0,1,2,3],
                             o = new any_constructor(...a)


         • proxies, weak maps: Proxy.create(handler, proto), new WeakMap

         • modules: module M { export function fast_sin(x) {...} }

         • iterators, generators: function* gen() { yield 1; yield 2; }
                                                                          mozilla

         4


Wednesday, May 4, 2011
Approved for ES.next

         • let, const, function in block scope

         • destructuring: let {x, y} = pt; let [s, v, o] = triple()

         • parameter default values: function f(x, y=1, z=0) {...}

         • rest, spread: function g(i, j, ...r) { return r.slice(i, j); }
                         let a = [0,1,2,3],
                             o = new any_constructor(...a)


         • proxies, weak maps: Proxy.create(handler, proto), new WeakMap

         • modules: module M { export function fast_sin(x) {...} }

         • iterators, generators: function* gen() { yield 1; yield 2; }
                                                                          mozilla
         • comprehensions: return [a+b for (a in A) for (b in B)]

         4


Wednesday, May 4, 2011
Yet more approved for ES.next




                                         mozilla

         5


Wednesday, May 4, 2011
Yet more approved for ES.next

         • Binary data:




                                         mozilla

         5


Wednesday, May 4, 2011
Yet more approved for ES.next

         • Binary data:

               • const Point2D = new StructType({ x: uint32, y: uint32 }),
                       Color = new StructType({ r: uint8, g: uint8,
                                                b: uint8 }),
                       Pixel = new StructType({ point: Point2D,
                                                color: Color });




                                                                      mozilla

         5


Wednesday, May 4, 2011
Yet more approved for ES.next

         • Binary data:

               • const Point2D = new StructType({ x: uint32, y: uint32 }),
                       Color = new StructType({ r: uint8, g: uint8,
                                                b: uint8 }),
                       Pixel = new StructType({ point: Point2D,
                                                color: Color });

               • const Triangle = new ArrayType(Pixel, 3);




                                                                      mozilla

         5


Wednesday, May 4, 2011
Yet more approved for ES.next

         • Binary data:

               • const Point2D = new StructType({ x: uint32, y: uint32 }),
                       Color = new StructType({ r: uint8, g: uint8,
                                                b: uint8 }),
                       Pixel = new StructType({ point: Point2D,
                                                color: Color });

               • const 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 } }]);
                                                                              mozilla

         5


Wednesday, May 4, 2011
Hot, but not yet in Harmony




                                       mozilla

         6


Wednesday, May 4, 2011
Hot, but not yet in Harmony

         • Arrow function syntax, instead of λ, ƒ, or # (want to save # for later)




                                                                                     mozilla

         6


Wednesday, May 4, 2011
Hot, but not yet in Harmony

         • Arrow function syntax, instead of λ, ƒ, or # (want to save # for later)

               • Just like CoffeeScript: let identity = (x) -> x




                                                                                     mozilla

         6


Wednesday, May 4, 2011
Hot, but not yet in Harmony

         • Arrow function syntax, instead of λ, ƒ, or # (want to save # for later)

               • Just like CoffeeScript: let identity = (x) -> x

               • Expression body: const square = (x) -> (x * x)




                                                                                     mozilla

         6


Wednesday, May 4, 2011
Hot, but not yet in Harmony

         • Arrow function syntax, instead of λ, ƒ, or # (want to save # for later)

               • Just like CoffeeScript: let identity = (x) -> x

               • Expression body: const square = (x) -> (x * x)

               • Statement body: let countUsed = (str) -> {
                                   if (str in usedWords)
                                     usedWords[str]++;
                                   else
                                     usedWords[str] = 1;
                                 }




                                                                                     mozilla

         6


Wednesday, May 4, 2011
Hot, but not yet in Harmony

         • Arrow function syntax, instead of λ, ƒ, or # (want to save # for later)

               • Just like CoffeeScript: let identity = (x) -> x

               • Expression body: const square = (x) -> (x * x)

               • Statement body: let countUsed = (str) -> {
                                   if (str in usedWords)
                                     usedWords[str]++;
                                   else
                                     usedWords[str] = 1;
                                 }


         • Fat arrow too: callback = (msg) => ( this.vmail.push(msg) )


                                                                                     mozilla

         6


Wednesday, May 4, 2011
Hot, but not yet in Harmony

         • Arrow function syntax, instead of λ, ƒ, or # (want to save # for later)

               • Just like CoffeeScript: let identity = (x) -> x

               • Expression body: const square = (x) -> (x * x)

               • Statement body: let countUsed = (str) -> {
                                   if (str in usedWords)
                                     usedWords[str]++;
                                   else
                                     usedWords[str] = 1;
                                 }


         • Fat arrow too: callback = (msg) => ( this.vmail.push(msg) )

         • Binding forms: let f() -> “writable”
                         const K() -> “readonly”                                     mozilla

         6


Wednesday, May 4, 2011
What else?




                         mozilla

         7


Wednesday, May 4, 2011
What else?

         • CoffeeScript classes, for prototypal inheritance sugar

               • Or a different classes as closure pattern sugar proposal?

               • Or (and this is somewhat Coffee-like) extended object initialisers?




                                                                                       mozilla

         7


Wednesday, May 4, 2011
What else?

         • CoffeeScript classes, for prototypal inheritance sugar

               • Or a different classes as closure pattern sugar proposal?

               • Or (and this is somewhat Coffee-like) extended object initialisers?

         • Coffee’s @foo for this.foo

               • Or some private names or “soft fields” @ usage?




                                                                                       mozilla

         7


Wednesday, May 4, 2011
What else?

         • CoffeeScript classes, for prototypal inheritance sugar

               • Or a different classes as closure pattern sugar proposal?

               • Or (and this is somewhat Coffee-like) extended object initialisers?

         • Coffee’s @foo for this.foo

               • Or some private names or “soft fields” @ usage?

         • Paren-free syntax: if x > y return x
                              while i < n { a.push(i++); }



                                                                                       mozilla

         7


Wednesday, May 4, 2011
What else?

         • CoffeeScript classes, for prototypal inheritance sugar

               • Or a different classes as closure pattern sugar proposal?

               • Or (and this is somewhat Coffee-like) extended object initialisers?

         • Coffee’s @foo for this.foo

               • Or some private names or “soft fields” @ usage?

         • Paren-free syntax: if x > y return x
                              while i < n { a.push(i++); }


         • More operators: ?? ??= div mod divmod is isnt
                                                                                       mozilla

         7


Wednesday, May 4, 2011
What’s going on here?

         • Remember these Harmony goals:


               • Be a better language for writing:

                    • complex applications

                    • libraries (including the DOM) shared by those applications

                    • code generators targeting the new edition

               • Adopt de facto standards where possible




                                                                                   mozilla

         8


Wednesday, May 4, 2011
Word of the day: Transpiler




                                       mozilla

         9


Wednesday, May 4, 2011
Word of the day: Transpiler

               A transcompiler (also known as transpiler) is a special
               compiler that translates the source code of a programming
               language into the source code of another programming
               language, e.g. from Pascal to C.




                                                                       mozilla

         9


Wednesday, May 4, 2011
Word of the day: Transpiler

               A transcompiler (also known as transpiler) is a special
               compiler that translates the source code of a programming
               language into the source code of another programming
               language, e.g. from Pascal to C.

                    en.wikipedia.org/wiki/Transpiler




                                                                       mozilla

         9


Wednesday, May 4, 2011
Word of the day: Transpiler

               A transcompiler (also known as transpiler) is a special
               compiler that translates the source code of a programming
               language into the source code of another programming
               language, e.g. from Pascal to C.

                    en.wikipedia.org/wiki/Transpiler




                                                                       mozilla

         9


Wednesday, May 4, 2011
Word of the day: Transpiler

               A transcompiler (also known as transpiler) is a special
               compiler that translates the source code of a programming
               language into the source code of another programming
               language, e.g. from Pascal to C.

                    en.wikipedia.org/wiki/Transpiler

         • CoffeeScript, many others



                                                                       mozilla

         9


Wednesday, May 4, 2011
Word of the day: Transpiler

               A transcompiler (also known as transpiler) is a special
               compiler that translates the source code of a programming
               language into the source code of another programming
               language, e.g. from Pascal to C.

                    en.wikipedia.org/wiki/Transpiler

         • CoffeeScript, many others
         • Dave Herman’s module loaders for language polyfills

                                                                       mozilla

         9


Wednesday, May 4, 2011
Word of the day: Transpiler

               A transcompiler (also known as transpiler) is a special
               compiler that translates the source code of a programming
               language into the source code of another programming
               language, e.g. from Pascal to C.

                    en.wikipedia.org/wiki/Transpiler

         • CoffeeScript, many others
         • Dave Herman’s module loaders for language polyfills
         • Debuggable primary source support coming in Firefox
                                                                       mozilla

         9


Wednesday, May 4, 2011
Word of the day: Transpiler

               A transcompiler (also known as transpiler) is a special
               compiler that translates the source code of a programming
               language into the source code of another programming
               language, e.g. from Pascal to C.

                    en.wikipedia.org/wiki/Transpiler

         • CoffeeScript, many others
         • Dave Herman’s module loaders for language polyfills
         • Debuggable primary source support coming in Firefox
                                                                       mozilla

         9


Wednesday, May 4, 2011
Back to Jeremy...




                             mozilla

         10


Wednesday, May 4, 2011

More Related Content

Viewers also liked

Comunicación inetractiva
Comunicación inetractivaComunicación inetractiva
Comunicación inetractiva
kmtg
 
2.b. rse
2.b. rse2.b. rse
2.b. rse
mbetzhold
 
Tercera uni copia
Tercera uni   copiaTercera uni   copia
Tercera uni copia
Jenny Martinez
 
Unit 7 lesson d old friends
Unit 7 lesson d old friendsUnit 7 lesson d old friends
Unit 7 lesson d old friends
pilarquiroga
 
Using the Second Screen (at IFA Medienwoche 2011)
Using the Second Screen (at IFA Medienwoche 2011)Using the Second Screen (at IFA Medienwoche 2011)
Using the Second Screen (at IFA Medienwoche 2011)
Ex Machina
 
Mri taller #2
Mri taller #2Mri taller #2
Mri taller #2
Braiian Medina
 
Corporate Pádel League
Corporate Pádel LeagueCorporate Pádel League
Corporate Pádel League
Javier Portela Hernández
 
exposicion
exposicionexposicion
exposicion
jjgonzalez
 
Dr. Abhishek K. Malakar_CV_EP15
Dr. Abhishek K. Malakar_CV_EP15Dr. Abhishek K. Malakar_CV_EP15
Dr. Abhishek K. Malakar_CV_EP15
Abhishek Kumar Malakar
 
Gps buddy eğitim dokümanı
Gps buddy eğitim dokümanıGps buddy eğitim dokümanı
Gps buddy eğitim dokümanı
Serkan Ardahanli
 
Channel Empowerment - Social Media Academy
Channel Empowerment - Social Media Academy Channel Empowerment - Social Media Academy
Channel Empowerment - Social Media Academy
Society3
 
Mobeego Presentation
Mobeego PresentationMobeego Presentation
Mobeego Presentation
JP Botha
 
El teléfono & su revolución
El teléfono & su revoluciónEl teléfono & su revolución
El teléfono & su revolución
pbyr
 
Study smart guide iva f-1
Study smart guide   iva f-1Study smart guide   iva f-1
Study smart guide iva f-1
i4ppis
 
Displays
DisplaysDisplays
Displays
Emaser
 
Talk on Conversational Leadership at LCME 2014
Talk on Conversational Leadership at LCME 2014Talk on Conversational Leadership at LCME 2014
Talk on Conversational Leadership at LCME 2014
David Gurteen
 
Concrelight Agregado Ultraligero Manica
Concrelight Agregado Ultraligero Manica Concrelight Agregado Ultraligero Manica
Concrelight Agregado Ultraligero Manica
Manufacturas de Anime C.A. MANICA
 
Cancións para corda, goma e corro
Cancións para corda, goma e corroCancións para corda, goma e corro
Cancións para corda, goma e corro
Chelo Alvarez Veira
 
Gastronomía nórdica
Gastronomía nórdicaGastronomía nórdica
Gastronomía nórdica
Maite Lirio Cisneros
 
Tutorial para activar office 2010 con toolkit and ez
Tutorial para activar office 2010 con toolkit and ezTutorial para activar office 2010 con toolkit and ez
Tutorial para activar office 2010 con toolkit and ez
Tecnojavi
 

Viewers also liked (20)

Comunicación inetractiva
Comunicación inetractivaComunicación inetractiva
Comunicación inetractiva
 
2.b. rse
2.b. rse2.b. rse
2.b. rse
 
Tercera uni copia
Tercera uni   copiaTercera uni   copia
Tercera uni copia
 
Unit 7 lesson d old friends
Unit 7 lesson d old friendsUnit 7 lesson d old friends
Unit 7 lesson d old friends
 
Using the Second Screen (at IFA Medienwoche 2011)
Using the Second Screen (at IFA Medienwoche 2011)Using the Second Screen (at IFA Medienwoche 2011)
Using the Second Screen (at IFA Medienwoche 2011)
 
Mri taller #2
Mri taller #2Mri taller #2
Mri taller #2
 
Corporate Pádel League
Corporate Pádel LeagueCorporate Pádel League
Corporate Pádel League
 
exposicion
exposicionexposicion
exposicion
 
Dr. Abhishek K. Malakar_CV_EP15
Dr. Abhishek K. Malakar_CV_EP15Dr. Abhishek K. Malakar_CV_EP15
Dr. Abhishek K. Malakar_CV_EP15
 
Gps buddy eğitim dokümanı
Gps buddy eğitim dokümanıGps buddy eğitim dokümanı
Gps buddy eğitim dokümanı
 
Channel Empowerment - Social Media Academy
Channel Empowerment - Social Media Academy Channel Empowerment - Social Media Academy
Channel Empowerment - Social Media Academy
 
Mobeego Presentation
Mobeego PresentationMobeego Presentation
Mobeego Presentation
 
El teléfono & su revolución
El teléfono & su revoluciónEl teléfono & su revolución
El teléfono & su revolución
 
Study smart guide iva f-1
Study smart guide   iva f-1Study smart guide   iva f-1
Study smart guide iva f-1
 
Displays
DisplaysDisplays
Displays
 
Talk on Conversational Leadership at LCME 2014
Talk on Conversational Leadership at LCME 2014Talk on Conversational Leadership at LCME 2014
Talk on Conversational Leadership at LCME 2014
 
Concrelight Agregado Ultraligero Manica
Concrelight Agregado Ultraligero Manica Concrelight Agregado Ultraligero Manica
Concrelight Agregado Ultraligero Manica
 
Cancións para corda, goma e corro
Cancións para corda, goma e corroCancións para corda, goma e corro
Cancións para corda, goma e corro
 
Gastronomía nórdica
Gastronomía nórdicaGastronomía nórdica
Gastronomía nórdica
 
Tutorial para activar office 2010 con toolkit and ez
Tutorial para activar office 2010 con toolkit and ezTutorial para activar office 2010 con toolkit and ez
Tutorial para activar office 2010 con toolkit and ez
 

Similar to ES.next

Mozilla's NodeConf talk
Mozilla's NodeConf talkMozilla's NodeConf talk
Mozilla's NodeConf talk
Brendan Eich
 
Rust 101 (2017 edition)
Rust 101 (2017 edition)Rust 101 (2017 edition)
Rust 101 (2017 edition)
Robert 'Bob' Reyes
 
Building Languages for the JVM - StarTechConf 2011
Building Languages for the JVM - StarTechConf 2011Building Languages for the JVM - StarTechConf 2011
Building Languages for the JVM - StarTechConf 2011
Charles Nutter
 
Splash
SplashSplash
Splash
Brendan Eich
 
Mathias Brandewinder, Software Engineer & Data Scientist, Clear Lines Consult...
Mathias Brandewinder, Software Engineer & Data Scientist, Clear Lines Consult...Mathias Brandewinder, Software Engineer & Data Scientist, Clear Lines Consult...
Mathias Brandewinder, Software Engineer & Data Scientist, Clear Lines Consult...
MLconf
 
Jaoo irony
Jaoo ironyJaoo irony
Jaoo irony
Nick Hodge
 
Mozilla + Rust at PCU Manila 02 DEC 2016
Mozilla + Rust at PCU Manila 02 DEC 2016Mozilla + Rust at PCU Manila 02 DEC 2016
Mozilla + Rust at PCU Manila 02 DEC 2016
Robert 'Bob' Reyes
 
Node js techtalksto
Node js techtalkstoNode js techtalksto
Node js techtalksto
Jason Diller
 
Advanced Programming With Notes/DominoCOM Classes
Advanced Programming With Notes/DominoCOM ClassesAdvanced Programming With Notes/DominoCOM Classes
Advanced Programming With Notes/DominoCOM Classes
dominion
 
Large Files without the Trials
Large Files without the TrialsLarge Files without the Trials
Large Files without the Trials
Sally Kleinfeldt
 
IzPack - fOSSa 2009
IzPack - fOSSa 2009IzPack - fOSSa 2009
IzPack - fOSSa 2009
julien.ponge
 
Go - The Power Of Simplicity
Go - The Power Of SimplicityGo - The Power Of Simplicity
Go - The Power Of Simplicity
Eduardo Nunes Pereira
 
Large Files without the Trials
Large Files without the TrialsLarge Files without the Trials
Large Files without the Trials
Jazkarta, Inc.
 
BRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQLBRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQL
Andreas Jung
 
GGUG:Practical DSL Design
GGUG:Practical DSL DesignGGUG:Practical DSL Design
GGUG:Practical DSL Design
Skills Matter
 
Eclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimesEclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimes
Mark Stoodley
 
Why Extension Programmers Should Stop Worrying About Parsing and Start Thinki...
Why Extension Programmers Should Stop Worrying About Parsing and Start Thinki...Why Extension Programmers Should Stop Worrying About Parsing and Start Thinki...
Why Extension Programmers Should Stop Worrying About Parsing and Start Thinki...
David Beazley (Dabeaz LLC)
 
Mozilla Intern Summer 2014 Presentation
Mozilla Intern Summer 2014 PresentationMozilla Intern Summer 2014 Presentation
Mozilla Intern Summer 2014 Presentation
Corey Richardson
 
sete linguagens em sete semanas
sete linguagens em sete semanassete linguagens em sete semanas
sete linguagens em sete semanas
tdc-globalcode
 
LocJAM Japan Presentation - Kyoto Study Group (December 2016)
LocJAM Japan Presentation - Kyoto Study Group (December 2016)LocJAM Japan Presentation - Kyoto Study Group (December 2016)
LocJAM Japan Presentation - Kyoto Study Group (December 2016)
Anthony Teixeira - French Video Game Translator
 

Similar to ES.next (20)

Mozilla's NodeConf talk
Mozilla's NodeConf talkMozilla's NodeConf talk
Mozilla's NodeConf talk
 
Rust 101 (2017 edition)
Rust 101 (2017 edition)Rust 101 (2017 edition)
Rust 101 (2017 edition)
 
Building Languages for the JVM - StarTechConf 2011
Building Languages for the JVM - StarTechConf 2011Building Languages for the JVM - StarTechConf 2011
Building Languages for the JVM - StarTechConf 2011
 
Splash
SplashSplash
Splash
 
Mathias Brandewinder, Software Engineer & Data Scientist, Clear Lines Consult...
Mathias Brandewinder, Software Engineer & Data Scientist, Clear Lines Consult...Mathias Brandewinder, Software Engineer & Data Scientist, Clear Lines Consult...
Mathias Brandewinder, Software Engineer & Data Scientist, Clear Lines Consult...
 
Jaoo irony
Jaoo ironyJaoo irony
Jaoo irony
 
Mozilla + Rust at PCU Manila 02 DEC 2016
Mozilla + Rust at PCU Manila 02 DEC 2016Mozilla + Rust at PCU Manila 02 DEC 2016
Mozilla + Rust at PCU Manila 02 DEC 2016
 
Node js techtalksto
Node js techtalkstoNode js techtalksto
Node js techtalksto
 
Advanced Programming With Notes/DominoCOM Classes
Advanced Programming With Notes/DominoCOM ClassesAdvanced Programming With Notes/DominoCOM Classes
Advanced Programming With Notes/DominoCOM Classes
 
Large Files without the Trials
Large Files without the TrialsLarge Files without the Trials
Large Files without the Trials
 
IzPack - fOSSa 2009
IzPack - fOSSa 2009IzPack - fOSSa 2009
IzPack - fOSSa 2009
 
Go - The Power Of Simplicity
Go - The Power Of SimplicityGo - The Power Of Simplicity
Go - The Power Of Simplicity
 
Large Files without the Trials
Large Files without the TrialsLarge Files without the Trials
Large Files without the Trials
 
BRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQLBRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQL
 
GGUG:Practical DSL Design
GGUG:Practical DSL DesignGGUG:Practical DSL Design
GGUG:Practical DSL Design
 
Eclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimesEclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimes
 
Why Extension Programmers Should Stop Worrying About Parsing and Start Thinki...
Why Extension Programmers Should Stop Worrying About Parsing and Start Thinki...Why Extension Programmers Should Stop Worrying About Parsing and Start Thinki...
Why Extension Programmers Should Stop Worrying About Parsing and Start Thinki...
 
Mozilla Intern Summer 2014 Presentation
Mozilla Intern Summer 2014 PresentationMozilla Intern Summer 2014 Presentation
Mozilla Intern Summer 2014 Presentation
 
sete linguagens em sete semanas
sete linguagens em sete semanassete linguagens em sete semanas
sete linguagens em sete semanas
 
LocJAM Japan Presentation - Kyoto Study Group (December 2016)
LocJAM Japan Presentation - Kyoto Study Group (December 2016)LocJAM Japan Presentation - Kyoto Study Group (December 2016)
LocJAM Japan Presentation - Kyoto Study Group (December 2016)
 

More from Brendan Eich

Int64
Int64Int64
Always bet on JS - Finjs.io NYC 2016
Always bet on JS - Finjs.io NYC 2016Always bet on JS - Finjs.io NYC 2016
Always bet on JS - Finjs.io NYC 2016
Brendan Eich
 
dotJS 2015
dotJS 2015dotJS 2015
dotJS 2015
Brendan Eich
 
Extensible Operators and Literals for JavaScript
Extensible Operators and Literals for JavaScriptExtensible Operators and Literals for JavaScript
Extensible Operators and Literals for JavaScript
Brendan Eich
 
Fluent15
Fluent15Fluent15
Fluent15
Brendan Eich
 
The Same-Origin Saga
The Same-Origin SagaThe Same-Origin Saga
The Same-Origin Saga
Brendan Eich
 
Taysom seminar
Taysom seminarTaysom seminar
Taysom seminar
Brendan Eich
 
Fluent14
Fluent14Fluent14
Fluent14
Brendan Eich
 
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Brendan Eich
 
My dotJS Talk
My dotJS TalkMy dotJS Talk
My dotJS Talk
Brendan Eich
 
Web futures
Web futuresWeb futures
Web futures
Brendan Eich
 
JS Responsibilities
JS ResponsibilitiesJS Responsibilities
JS Responsibilities
Brendan Eich
 
Value objects in JS - an ES7 work in progress
Value objects in JS - an ES7 work in progressValue objects in JS - an ES7 work in progress
Value objects in JS - an ES7 work in progress
Brendan Eich
 
Paren free
Paren freeParen free
Paren free
Brendan Eich
 
Proxies are Awesome!
Proxies are Awesome!Proxies are Awesome!
Proxies are Awesome!
Brendan Eich
 

More from Brendan Eich (15)

Int64
Int64Int64
Int64
 
Always bet on JS - Finjs.io NYC 2016
Always bet on JS - Finjs.io NYC 2016Always bet on JS - Finjs.io NYC 2016
Always bet on JS - Finjs.io NYC 2016
 
dotJS 2015
dotJS 2015dotJS 2015
dotJS 2015
 
Extensible Operators and Literals for JavaScript
Extensible Operators and Literals for JavaScriptExtensible Operators and Literals for JavaScript
Extensible Operators and Literals for JavaScript
 
Fluent15
Fluent15Fluent15
Fluent15
 
The Same-Origin Saga
The Same-Origin SagaThe Same-Origin Saga
The Same-Origin Saga
 
Taysom seminar
Taysom seminarTaysom seminar
Taysom seminar
 
Fluent14
Fluent14Fluent14
Fluent14
 
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
 
My dotJS Talk
My dotJS TalkMy dotJS Talk
My dotJS Talk
 
Web futures
Web futuresWeb futures
Web futures
 
JS Responsibilities
JS ResponsibilitiesJS Responsibilities
JS Responsibilities
 
Value objects in JS - an ES7 work in progress
Value objects in JS - an ES7 work in progressValue objects in JS - an ES7 work in progress
Value objects in JS - an ES7 work in progress
 
Paren free
Paren freeParen free
Paren free
 
Proxies are Awesome!
Proxies are Awesome!Proxies are Awesome!
Proxies are Awesome!
 

ES.next

  • 1. CoffeeScript, ES.next, the JS Language Lab mozilla 1 Wednesday, May 4, 2011
  • 2. What you should expect in the Future mozilla 2 Wednesday, May 4, 2011
  • 3. What you should expect in the Future • “No fate but what we make.” - Sarah Connor, T2 mozilla 2 Wednesday, May 4, 2011
  • 4. What you should expect in the Future • “No fate but what we make.” - Sarah Connor, T2 • “Leaders can imagine a world that others don’t. Like Thomas Jefferson or that kid in the Terminator movies.” - Finn, Glee mozilla 2 Wednesday, May 4, 2011
  • 5. What you should expect in the Future • “No fate but what we make.” - Sarah Connor, T2 • “Leaders can imagine a world that others don’t. Like Thomas Jefferson or that kid in the Terminator movies.” - Finn, Glee • How to invent the future: mozilla 2 Wednesday, May 4, 2011
  • 6. What you should expect in the Future • “No fate but what we make.” - Sarah Connor, T2 • “Leaders can imagine a world that others don’t. Like Thomas Jefferson or that kid in the Terminator movies.” - Finn, Glee • How to invent the future: • CoffeeScript (and all the languages targeting JS) mozilla 2 Wednesday, May 4, 2011
  • 7. What you should expect in the Future • “No fate but what we make.” - Sarah Connor, T2 • “Leaders can imagine a world that others don’t. Like Thomas Jefferson or that kid in the Terminator movies.” - Finn, Glee • How to invent the future: • CoffeeScript (and all the languages targeting JS) • Compile ES.next -> JS of today with a Harmonizr mozilla 2 Wednesday, May 4, 2011
  • 8. What you should expect in the Future • “No fate but what we make.” - Sarah Connor, T2 • “Leaders can imagine a world that others don’t. Like Thomas Jefferson or that kid in the Terminator movies.” - Finn, Glee • How to invent the future: • CoffeeScript (and all the languages targeting JS) • Compile ES.next -> JS of today with a Harmonizr • Keep iterating... mozilla 2 Wednesday, May 4, 2011
  • 9. The Harmony goals mozilla 3 Wednesday, May 4, 2011
  • 10. The Harmony goals • Be a better language for writing: mozilla 3 Wednesday, May 4, 2011
  • 11. The Harmony goals • Be a better language for writing: • complex applications mozilla 3 Wednesday, May 4, 2011
  • 12. The Harmony goals • Be a better language for writing: • complex applications • libraries (including the DOM) shared by those applications mozilla 3 Wednesday, May 4, 2011
  • 13. The Harmony goals • Be a better language for writing: • complex applications • libraries (including the DOM) shared by those applications • code generators targeting the new edition mozilla 3 Wednesday, May 4, 2011
  • 14. The Harmony goals • Be a better language for writing: • complex applications • libraries (including the DOM) shared by those applications • code generators targeting the new edition • Better tests, if not a testable (executable) specification mozilla 3 Wednesday, May 4, 2011
  • 15. The Harmony goals • Be a better language for writing: • complex applications • libraries (including the DOM) shared by those applications • code generators targeting the new edition • Better tests, if not a testable (executable) specification • Adopt de facto standards where possible mozilla 3 Wednesday, May 4, 2011
  • 16. The Harmony goals • Be a better language for writing: • complex applications • libraries (including the DOM) shared by those applications • code generators targeting the new edition • Better tests, if not a testable (executable) specification • Adopt de facto standards where possible • Keep versioning as simple and linear as possible mozilla 3 Wednesday, May 4, 2011
  • 17. The Harmony goals • Be a better language for writing: • complex applications • libraries (including the DOM) shared by those applications • code generators targeting the new edition • Better tests, if not a testable (executable) specification • Adopt de facto standards where possible • Keep versioning as simple and linear as possible • Support a statically verifiable, object-capability secure subset mozilla 3 Wednesday, May 4, 2011
  • 18. Approved for ES.next mozilla 4 Wednesday, May 4, 2011
  • 19. Approved for ES.next • let, const, function in block scope mozilla 4 Wednesday, May 4, 2011
  • 20. Approved for ES.next • let, const, function in block scope • destructuring: let {x, y} = pt; let [s, v, o] = triple() mozilla 4 Wednesday, May 4, 2011
  • 21. Approved for ES.next • let, const, function in block scope • destructuring: let {x, y} = pt; let [s, v, o] = triple() • parameter default values: function f(x, y=1, z=0) {...} mozilla 4 Wednesday, May 4, 2011
  • 22. Approved for ES.next • let, const, function in block scope • destructuring: let {x, y} = pt; let [s, v, o] = triple() • parameter default values: function f(x, y=1, z=0) {...} • rest, spread: function g(i, j, ...r) { return r.slice(i, j); } let a = [0,1,2,3], o = new any_constructor(...a) mozilla 4 Wednesday, May 4, 2011
  • 23. Approved for ES.next • let, const, function in block scope • destructuring: let {x, y} = pt; let [s, v, o] = triple() • parameter default values: function f(x, y=1, z=0) {...} • rest, spread: function g(i, j, ...r) { return r.slice(i, j); } let a = [0,1,2,3], o = new any_constructor(...a) • proxies, weak maps: Proxy.create(handler, proto), new WeakMap mozilla 4 Wednesday, May 4, 2011
  • 24. Approved for ES.next • let, const, function in block scope • destructuring: let {x, y} = pt; let [s, v, o] = triple() • parameter default values: function f(x, y=1, z=0) {...} • rest, spread: function g(i, j, ...r) { return r.slice(i, j); } let a = [0,1,2,3], o = new any_constructor(...a) • proxies, weak maps: Proxy.create(handler, proto), new WeakMap • modules: module M { export function fast_sin(x) {...} } mozilla 4 Wednesday, May 4, 2011
  • 25. Approved for ES.next • let, const, function in block scope • destructuring: let {x, y} = pt; let [s, v, o] = triple() • parameter default values: function f(x, y=1, z=0) {...} • rest, spread: function g(i, j, ...r) { return r.slice(i, j); } let a = [0,1,2,3], o = new any_constructor(...a) • proxies, weak maps: Proxy.create(handler, proto), new WeakMap • modules: module M { export function fast_sin(x) {...} } • iterators, generators: function* gen() { yield 1; yield 2; } mozilla 4 Wednesday, May 4, 2011
  • 26. Approved for ES.next • let, const, function in block scope • destructuring: let {x, y} = pt; let [s, v, o] = triple() • parameter default values: function f(x, y=1, z=0) {...} • rest, spread: function g(i, j, ...r) { return r.slice(i, j); } let a = [0,1,2,3], o = new any_constructor(...a) • proxies, weak maps: Proxy.create(handler, proto), new WeakMap • modules: module M { export function fast_sin(x) {...} } • iterators, generators: function* gen() { yield 1; yield 2; } mozilla • comprehensions: return [a+b for (a in A) for (b in B)] 4 Wednesday, May 4, 2011
  • 27. Yet more approved for ES.next mozilla 5 Wednesday, May 4, 2011
  • 28. Yet more approved for ES.next • Binary data: mozilla 5 Wednesday, May 4, 2011
  • 29. Yet more approved for ES.next • Binary data: • const Point2D = new StructType({ x: uint32, y: uint32 }), Color = new StructType({ r: uint8, g: uint8, b: uint8 }), Pixel = new StructType({ point: Point2D, color: Color }); mozilla 5 Wednesday, May 4, 2011
  • 30. Yet more approved for ES.next • Binary data: • const Point2D = new StructType({ x: uint32, y: uint32 }), Color = new StructType({ r: uint8, g: uint8, b: uint8 }), Pixel = new StructType({ point: Point2D, color: Color }); • const Triangle = new ArrayType(Pixel, 3); mozilla 5 Wednesday, May 4, 2011
  • 31. Yet more approved for ES.next • Binary data: • const Point2D = new StructType({ x: uint32, y: uint32 }), Color = new StructType({ r: uint8, g: uint8, b: uint8 }), Pixel = new StructType({ point: Point2D, color: Color }); • const 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 } }]); mozilla 5 Wednesday, May 4, 2011
  • 32. Hot, but not yet in Harmony mozilla 6 Wednesday, May 4, 2011
  • 33. Hot, but not yet in Harmony • Arrow function syntax, instead of λ, ƒ, or # (want to save # for later) mozilla 6 Wednesday, May 4, 2011
  • 34. Hot, but not yet in Harmony • Arrow function syntax, instead of λ, ƒ, or # (want to save # for later) • Just like CoffeeScript: let identity = (x) -> x mozilla 6 Wednesday, May 4, 2011
  • 35. Hot, but not yet in Harmony • Arrow function syntax, instead of λ, ƒ, or # (want to save # for later) • Just like CoffeeScript: let identity = (x) -> x • Expression body: const square = (x) -> (x * x) mozilla 6 Wednesday, May 4, 2011
  • 36. Hot, but not yet in Harmony • Arrow function syntax, instead of λ, ƒ, or # (want to save # for later) • Just like CoffeeScript: let identity = (x) -> x • Expression body: const square = (x) -> (x * x) • Statement body: let countUsed = (str) -> { if (str in usedWords) usedWords[str]++; else usedWords[str] = 1; } mozilla 6 Wednesday, May 4, 2011
  • 37. Hot, but not yet in Harmony • Arrow function syntax, instead of λ, ƒ, or # (want to save # for later) • Just like CoffeeScript: let identity = (x) -> x • Expression body: const square = (x) -> (x * x) • Statement body: let countUsed = (str) -> { if (str in usedWords) usedWords[str]++; else usedWords[str] = 1; } • Fat arrow too: callback = (msg) => ( this.vmail.push(msg) ) mozilla 6 Wednesday, May 4, 2011
  • 38. Hot, but not yet in Harmony • Arrow function syntax, instead of λ, ƒ, or # (want to save # for later) • Just like CoffeeScript: let identity = (x) -> x • Expression body: const square = (x) -> (x * x) • Statement body: let countUsed = (str) -> { if (str in usedWords) usedWords[str]++; else usedWords[str] = 1; } • Fat arrow too: callback = (msg) => ( this.vmail.push(msg) ) • Binding forms: let f() -> “writable” const K() -> “readonly” mozilla 6 Wednesday, May 4, 2011
  • 39. What else? mozilla 7 Wednesday, May 4, 2011
  • 40. What else? • CoffeeScript classes, for prototypal inheritance sugar • Or a different classes as closure pattern sugar proposal? • Or (and this is somewhat Coffee-like) extended object initialisers? mozilla 7 Wednesday, May 4, 2011
  • 41. What else? • CoffeeScript classes, for prototypal inheritance sugar • Or a different classes as closure pattern sugar proposal? • Or (and this is somewhat Coffee-like) extended object initialisers? • Coffee’s @foo for this.foo • Or some private names or “soft fields” @ usage? mozilla 7 Wednesday, May 4, 2011
  • 42. What else? • CoffeeScript classes, for prototypal inheritance sugar • Or a different classes as closure pattern sugar proposal? • Or (and this is somewhat Coffee-like) extended object initialisers? • Coffee’s @foo for this.foo • Or some private names or “soft fields” @ usage? • Paren-free syntax: if x > y return x while i < n { a.push(i++); } mozilla 7 Wednesday, May 4, 2011
  • 43. What else? • CoffeeScript classes, for prototypal inheritance sugar • Or a different classes as closure pattern sugar proposal? • Or (and this is somewhat Coffee-like) extended object initialisers? • Coffee’s @foo for this.foo • Or some private names or “soft fields” @ usage? • Paren-free syntax: if x > y return x while i < n { a.push(i++); } • More operators: ?? ??= div mod divmod is isnt mozilla 7 Wednesday, May 4, 2011
  • 44. What’s going on here? • Remember these Harmony goals: • Be a better language for writing: • complex applications • libraries (including the DOM) shared by those applications • code generators targeting the new edition • Adopt de facto standards where possible mozilla 8 Wednesday, May 4, 2011
  • 45. Word of the day: Transpiler mozilla 9 Wednesday, May 4, 2011
  • 46. Word of the day: Transpiler A transcompiler (also known as transpiler) is a special compiler that translates the source code of a programming language into the source code of another programming language, e.g. from Pascal to C. mozilla 9 Wednesday, May 4, 2011
  • 47. Word of the day: Transpiler A transcompiler (also known as transpiler) is a special compiler that translates the source code of a programming language into the source code of another programming language, e.g. from Pascal to C. en.wikipedia.org/wiki/Transpiler mozilla 9 Wednesday, May 4, 2011
  • 48. Word of the day: Transpiler A transcompiler (also known as transpiler) is a special compiler that translates the source code of a programming language into the source code of another programming language, e.g. from Pascal to C. en.wikipedia.org/wiki/Transpiler mozilla 9 Wednesday, May 4, 2011
  • 49. Word of the day: Transpiler A transcompiler (also known as transpiler) is a special compiler that translates the source code of a programming language into the source code of another programming language, e.g. from Pascal to C. en.wikipedia.org/wiki/Transpiler • CoffeeScript, many others mozilla 9 Wednesday, May 4, 2011
  • 50. Word of the day: Transpiler A transcompiler (also known as transpiler) is a special compiler that translates the source code of a programming language into the source code of another programming language, e.g. from Pascal to C. en.wikipedia.org/wiki/Transpiler • CoffeeScript, many others • Dave Herman’s module loaders for language polyfills mozilla 9 Wednesday, May 4, 2011
  • 51. Word of the day: Transpiler A transcompiler (also known as transpiler) is a special compiler that translates the source code of a programming language into the source code of another programming language, e.g. from Pascal to C. en.wikipedia.org/wiki/Transpiler • CoffeeScript, many others • Dave Herman’s module loaders for language polyfills • Debuggable primary source support coming in Firefox mozilla 9 Wednesday, May 4, 2011
  • 52. Word of the day: Transpiler A transcompiler (also known as transpiler) is a special compiler that translates the source code of a programming language into the source code of another programming language, e.g. from Pascal to C. en.wikipedia.org/wiki/Transpiler • CoffeeScript, many others • Dave Herman’s module loaders for language polyfills • Debuggable primary source support coming in Firefox mozilla 9 Wednesday, May 4, 2011
  • 53. Back to Jeremy... mozilla 10 Wednesday, May 4, 2011