SlideShare a Scribd company logo
Making ES6 available to all with ChakraCore
Chris Heilmann @codepo8, JFokus, Stockholm, February 2015
Of innovation and impatience
Chris Heilmann @codepo8, Future Decoded, London, Nov 2015
CHRIS HEILMANN
@CODEPO8
LET’S TALK
JAVASCRIPT…
• Old issues
• The learning process
• The library/framework issue
• The ES6 buffet
• Standards and interop
• Breaking monopolies
OLD ISSUES OF JAVASCRIPT
JAVASCRIPT CLIENT-
SIDE HAS ISSUES…
• It is not fault-tolerant
• Many different parties mess with it
• You don’t know the environment it
runs in
• It has always been part of the
browser and dependent on its
release and upgrade cycle
JAVASCRIPT THE
LANGUAGE HAS
ISSUES
(OPPORTUNITIES)…
• typeof NaN === number
• No type safety
• No classes
• “it feels rushed”
ENGINE TROUBLE:
JAVASCRIPT IS
HUNGRY
HTTPS:// .WTF
THE JAVASCRIPT LEARNING PROCESS
THE JAVASCRIPT
LEARNING PROCESS
HAS ALWAYS BEEN
INTERESTING…
• Use view source to see what
others are doing…
• Copy and paste the bits that
look like they are responsible
for some things
• Change some numbers around
• Run into errors
• Blame Internet Explorer
THIS, OF COURSE,
WAS WRONG AND
WE GOT MORE
PROFESSIONAL…
• Search for a solution on
Stackoverflow
• Copy and paste the bits that
look like they are responsible
for some things
• Change some numbers around
• Run into errors
• Blame JavaScript for being
terrible and not a real language
• For good measure, blame
Internet Explorer.
IT’S TRUE…
BUT OF COURSE IT CAN
BE IMPROVED…
WITH ES6 WE HAVE
A CLEAN NEW
SLATE…
(AND YOU CAN’T BLAME IE ANY MORE)
SEE THE BABEL.JS DOCS AND TRY IT IN THE BROWSER…
https://babeljs.io/docs/learn-es2015/
350 BULLET POINTS
https://babeljs.io/docs/learn-es2015/
READ THE
EXCELLENT BOOK
EXPLORING ES6
FOR FREE
(OR BUY IT, AXEL DESERVES SUPPORT)
http://exploringjs.com/es6/
THE LIBRARY/FRAMEWORK ISSUE…
JAVASCRIPT ABUSE IS
RAMPANT…
SHOULD WE BUILD
EVERYTHING FROM
SCRATCH?
OLD ISSUES, NOW IN
THE NEXT LANGUAGE…
IS DEPENDENCY HELL
A PROBLEM OF THE
TOO PRIVILEGED?
https://www.youtube.com/watch?v=PA139CERNbc
Stephan Bönnemann (JSConfEU 2015):
Dependency Hell Just Froze Over
WE’RE GOING
FULL SPEED ON
INNOVATION…
• Componentised Web
• Extensible Web Manifesto
• WebGL
• WebAssembly/ASM.js
• PostCSS
• Progressive Apps
• We work around browser issues
• We make web standards of
tomorrow work today.
• We build solutions to clean up
others and make them smaller
• And each of those comes with
a “don’t use in production”
label.
BUILDING LIBRARIES
AND FRAMEWORKS
THAT MAGICALLY
FIX THINGS HAS
BECOME
FASHIONABLE…
NSFW
THAT’S COOL -
GO NUTS AND
PLAY WITH ANY
TECHNOLOGY
YOU WANT…
FRAMEWORKS
ARE GREAT…
• They are fun to use - achieve a
lot very quickly
• You build complex apps in a
matter of minutes
• They work around pesky
browser bugs
• They are good on your CV
…BUT THEY ALSO
COME WITH
DEVELOPER COST
• Learning new frameworks
• Re-learning new frameworks
• Debugging frameworks
• Setting up developer
environments
• Cutting down on possible hires/
adding to onboarding time
AND WE SHOULD
CONSIDER THE
EFFECTS WE HAVE
ON OUR END
USERS…
• Time to load / execute
• Bandwidth used
• CPU usage
• Frame rate (60 fps)
• Memory usage
• Battery hunger
HOMEWORK / SNEAK
PREVIEW OF GREAT
INSIGHTS…
PAUL LEWIS
@AEROTWIST
THE DOM IS SLOW?
Making ES6 available to all with ChakraCore
Making ES6 available to all with ChakraCore
Making ES6 available to all with ChakraCore
ANALYSING
BROWSER RESULTS…
npm install -g bigrig
github.com/GoogleChrome/big-rig
github.com/GoogleChrome/node-big-rig
Making ES6 available to all with ChakraCore
WE USE CODE WE
DON’T UNDERSTAND
TO FIX ISSUES WE
DON’T HAVE…
• Learning libraries and
frameworks beyond “hello
world” costs time and money.
• Time you don’t spend on
looking at optimising your code
• In essence, we value developer
convenience over user
experience.
THE ES6 BUFFET…
1997 2015
1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015
1997
ECMAScript1
1998
ECMAScript2
1999
ECMAScript3
2005 - 2007
ECMAScript4 - Abandoned
2009
ECMAScript5
2015
ECMAScript6
JAVASCRIPT EVOLVES…
1997 2015
1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015
1997
ECMAScript1
1998
ECMAScript2
1999
ECMAScript3
2005 - 2007
ECMAScript4 - Abandoned
2009
ECMAScript5
2015
ECMAScript6
…NOW WE HAVE ES6!
• 5+ years since ES5 ratification
• Significant changes in 15+ years
• Backwards compatible
• Ratified June 2015
http://www.ecma-international.org/publications/standards/Ecma-262.htm
this IS COMPLICATED *** ***
this IS COMPLICATED
*** ***
blog.getify.com/arrow-this/
this IS COMPLICATED
*** ***
blog.getify.com/arrow-this/
this IS COMPLICATED
*** ***
blog.getify.com/arrow-this/
this IS COMPLICATED
*** ***
blog.getify.com/arrow-this/
SAVING KEYSTROKES
• Arrow functions as a short-hand version of an
anonymous function.
• Block-level scope using let instead of var makes
variables scoped to a block (if, for, while, etc.)
• Classes to encapsulate and extend code.
• Constants using the const keyword.
• Default parameters for functions like foo(bar = 3, baz =
2)
• Destructuring to assign values from arrays or objects
into variables.
• Generators that create iterators using function* and
the yield keyword.
• Map, a Dictionary type object that can be used to store
key/value pairs. and Set as a collection object to store
a list of data values.
• Modules as a way of organizing and loading code.
• Promises for async operations avoiding callback hell
• Rest parameters instead of using arguments to access
functions arguments.
• Template Strings to build up string values including
multi-line strings.
ES6 COMES WITH SO
MUCH GOODNESS,
TECHNICALLY IT HAS
TO BE FATTENING…
Library Builders
map, set & weakmap
__proto__
Proxies
Symbols
Sub7classable built7ins
Scalable Apps
let, const & block7
scoped bindings
Classes
Promises
Iterators
Generators
Typed arrays
Modules
Syntactic Sugar
Arrow functions
Enhanced object literals
Template strings
Destructuring
Rest, Spread, Default
String, Math, Number,
Object, RegExp APIs
ALL OF THESE PARTS HAVE DIFFERENT AUDIENCES
SUPPORT IS ENCOURAGING (EDGE, FIREFOX, CHROME, SAFARI (ON 9))
http://kangax.github.io/compat-table/es6/
THE PROBLEM: FOR
NON-SUPPORTING
ENGINES, ES6
FEATURES ARE
SYNTAX ERRORS…
THE SOLUTION: TRANSPILING INTO ES5…
https://babeljs.io
• Converts ES6 to older versions on the server or the client
• In use by Facebook and many others
• Used in editors and tool chains
✘ Extra step between writing code
and running it in the browser.
✘ We don’t run or debug the code
we write.
✘ We hope the transpiler creates
efficient code
✘ We create a lot of code
✘ Browsers that support ES6 will
never get any.
THE PROBLEMS WITH
TRANSPILING:
TRANSPILED CODE…
THE VICIOUS
INNOVATION CYCLE…
https://github.com/samccone/The-cost-of-transpiling-es2015-in-2016
PICK YOUR TRANSPIRATION TOOLCHAIN…
THE ES6
CONUNDRUM…
• We can’t use it safely in the wild
• We can use TypeScript or transpile it
• We can feature test for it, but that can
get complex quickly
• Browsers that support it, will not get
any ES6 that way (but can use it
internally)
• The performance is bad right now
(which is a normal thing). To improve
this, we need ES6 to be used in the
wild…
http://www.sitepoint.com/the-es6-conundrum/
STANDARDS AND INTEROP
WHAT DOES THIS CODE DO?
REPLACING BUILT-IN
FUNCTIONALITY
FOR THE SAKE OF
CONTROL…
SIMPLY BECAUSE WE CAN FIX ANYTHING WITH
JAVASCRIPT DOES NOT MEAN WE SHOULD!
THE COMPATIBILITY RACE…
THE VICIOUS
INNOVATION CYCLE…
OUT OF THE BOX BROWSER
DO NOT SUCK ANY LONGER!
COMPATIBILITY IS ON
EVERY BROWSER
MAKER’S RADAR…
BREAKING MONOPOLIES
NEW BROWSER, NEW JS ENGINE
SPEED COMPARISONS…
SURPRISES HAPPEN…
CHAKRACORE VS CHAKRA
HTTPS:// .WTF
TIME TRAVEL DEBUGGING
https://www.youtube.com/watch?v=1bfDB3YPHFI
NODE USING CHAKRACORE
https://blogs.windows.com/msedgedev/2016/01/19/nodejs-chakracore-mainline/
NODE USING CHAKRACORE
https://blogs.windows.com/msedgedev/2016/01/19/nodejs-chakracore-mainline/
NODE USING CHAKRACORE
https://blogs.windows.com/msedgedev/2016/01/19/nodejs-chakracore-mainline/
https://github.com/Microsoft/ChakraCore
COME AND PLAY
THANKS!
CHRIS HEILMANN
@CODEPO8
CHRISTIANHEILMANN.COM

More Related Content

PDF
Making ES6 available to all with ChakraCore and Typescript
PDF
Overboard.js - where are we going with with jsconfasia / devfestasia
PDF
Can we make es6 the baseline of the “modern web”? - BrazilJS 2105
PDF
Old and new perils of open source - Great Wide Open keynote
PDF
Fixing web and JS gaps
PDF
Upgrading JavaScript to ES6 and using TypeScript as a shortcut
PDF
Erase and Rewind - Open Web Camp 2015
PDF
Moore vs. May - everything is faster and better: we can fix that
Making ES6 available to all with ChakraCore and Typescript
Overboard.js - where are we going with with jsconfasia / devfestasia
Can we make es6 the baseline of the “modern web”? - BrazilJS 2105
Old and new perils of open source - Great Wide Open keynote
Fixing web and JS gaps
Upgrading JavaScript to ES6 and using TypeScript as a shortcut
Erase and Rewind - Open Web Camp 2015
Moore vs. May - everything is faster and better: we can fix that

What's hot (20)

PDF
Let’s learn how to use JavaScript responsibly and stay up-to-date.
PDF
The State of the Web - Helsinki meetup
PDF
Firefox OS - HTML5 for a truly world-wide-web
PDF
The ES6 Conundrum - All Things Open 2015
PDF
NodeConfLondon - Making ES6 happen with ChakraCore and Node
PDF
Mind the Gap - State of the Browser 2015
PDF
The image problem of the web and how to solve it…
PDF
All the small things… - Awwwards 2016
PDF
The wheel is spinning but the hamster is almost dead - Smartweb 2015
PDF
Innovating the other web - #wrocsharp keynote
PDF
Turning huge ships - Open Source and Microsoft
PDF
Responsive, adaptive and responsible - keynote at NebraskaJS
PPTX
JavaScript : What is it really? AND Some new features in ES6
PPTX
Advancing JavaScript without breaking the web - MunichJS
PDF
Automating all the wrong things - You Gotta Love Frontend Keynote
PDF
The JavaScript Delusion
PDF
A New Hope – the web strikes back
PPTX
The Final Frontier
PPTX
The State of Frontend
PDF
5 Quick JavaScript Performance Improvement Tips
Let’s learn how to use JavaScript responsibly and stay up-to-date.
The State of the Web - Helsinki meetup
Firefox OS - HTML5 for a truly world-wide-web
The ES6 Conundrum - All Things Open 2015
NodeConfLondon - Making ES6 happen with ChakraCore and Node
Mind the Gap - State of the Browser 2015
The image problem of the web and how to solve it…
All the small things… - Awwwards 2016
The wheel is spinning but the hamster is almost dead - Smartweb 2015
Innovating the other web - #wrocsharp keynote
Turning huge ships - Open Source and Microsoft
Responsive, adaptive and responsible - keynote at NebraskaJS
JavaScript : What is it really? AND Some new features in ES6
Advancing JavaScript without breaking the web - MunichJS
Automating all the wrong things - You Gotta Love Frontend Keynote
The JavaScript Delusion
A New Hope – the web strikes back
The Final Frontier
The State of Frontend
5 Quick JavaScript Performance Improvement Tips
Ad

Similar to Making ES6 available to all with ChakraCore (20)

PDF
ES2015 / ES6: Basics of modern Javascript
PDF
A call to JS Developers - Let’s stop trying to impress each other and start b...
PPTX
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
PDF
Choosing Javascript Libraries to Adopt for Development
PPTX
ES6 - JavaCro 2016
PDF
Quo vadis, JavaScript? Devday.pl keynote
PPTX
JS digest. Mid-Summer 2017
PDF
Progressive transpilation and the road to ES2015 in production
PDF
Of innovation and impatience - Future Decoded 2015
PDF
Breaking out of the endless callback look - #jsday Italy keynote
PPTX
Intro to ES6 and why should you bother !
PPTX
Using JavaScript ES2015 (ES6), ES2016, ES2017 in production
PDF
ES6, A Look Into Your Future
PDF
The Present and Future of JavaScript: ES2015 and Beyond
PDF
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
PDF
three_software_development_trends_to_follow_in_2016
PDF
Javascript-lenguaje-conceptos-basicos.pdf
PDF
The Present and Future of the Web Platform
PDF
Ecma6 in the wild
ES2015 / ES6: Basics of modern Javascript
A call to JS Developers - Let’s stop trying to impress each other and start b...
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
Choosing Javascript Libraries to Adopt for Development
ES6 - JavaCro 2016
Quo vadis, JavaScript? Devday.pl keynote
JS digest. Mid-Summer 2017
Progressive transpilation and the road to ES2015 in production
Of innovation and impatience - Future Decoded 2015
Breaking out of the endless callback look - #jsday Italy keynote
Intro to ES6 and why should you bother !
Using JavaScript ES2015 (ES6), ES2016, ES2017 in production
ES6, A Look Into Your Future
The Present and Future of JavaScript: ES2015 and Beyond
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
three_software_development_trends_to_follow_in_2016
Javascript-lenguaje-conceptos-basicos.pdf
The Present and Future of the Web Platform
Ecma6 in the wild
Ad

More from Christian Heilmann (20)

PPTX
Develop, Debug, Learn? - Dotjs2019
PDF
Hinting at a better web
PDF
Taking the "vile" out of privilege
PDF
Seven ways to be a happier JavaScript developer - NDC Oslo
PDF
Artificial intelligence for humans… #AIDC2018 keynote
PDF
Killing the golden calf of coding - We are Developers keynote
PDF
Progressive Web Apps - Techdays Finland
PDF
Taking the "vile" out of privilege
PDF
Five ways to be a happier JavaScript developer
PDF
Taking the P out of PWA
PDF
Sacrificing the golden calf of "coding"
PDF
You learned JavaScript - now what?
PDF
Sacrificing the golden calf of "coding"
PDF
Progressive Web Apps - Covering the best of both worlds - DevReach
PDF
Progressive Web Apps - Covering the best of both worlds
PPTX
Non-trivial pursuits: Learning machines and forgetful humans
PDF
Progressive Web Apps - Bringing the web front and center
PDF
CSS vs. JavaScript - Trust vs. Control
PDF
Leveling up your JavaScipt - DrupalJam 2017
PDF
The Soul in The Machine - Developing for Humans (FrankenJS edition)
Develop, Debug, Learn? - Dotjs2019
Hinting at a better web
Taking the "vile" out of privilege
Seven ways to be a happier JavaScript developer - NDC Oslo
Artificial intelligence for humans… #AIDC2018 keynote
Killing the golden calf of coding - We are Developers keynote
Progressive Web Apps - Techdays Finland
Taking the "vile" out of privilege
Five ways to be a happier JavaScript developer
Taking the P out of PWA
Sacrificing the golden calf of "coding"
You learned JavaScript - now what?
Sacrificing the golden calf of "coding"
Progressive Web Apps - Covering the best of both worlds - DevReach
Progressive Web Apps - Covering the best of both worlds
Non-trivial pursuits: Learning machines and forgetful humans
Progressive Web Apps - Bringing the web front and center
CSS vs. JavaScript - Trust vs. Control
Leveling up your JavaScipt - DrupalJam 2017
The Soul in The Machine - Developing for Humans (FrankenJS edition)

Recently uploaded (20)

PDF
Volvo ecr58 plus Service Manual Download
PPTX
Fire Fighting Unit IV industrial safety.pptx
PDF
Delivers.ai: 2020–2026 Autonomous Journey
PDF
EC300D LR EC300DLR - Volvo Service Repair Manual.pdf
PDF
Todays Technician Automotive Heating & Air Conditioning Classroom Manual and ...
PDF
Volvo ecr145cl specs Service Manual Download
PPTX
Chapter-1.pptxhhhhhhhhhhhhhhhhhhhhhhhhhh
PPTX
Intro to ISO 9001 2015.pptx for awareness
PDF
Renesas R-Car_Cockpit_overview210214-Gen4.pdf
PPTX
Materi Kuliah Umum Prof. Hsien Tsai Wu.pptx
PDF
Caterpillar Cat 315C Excavator (Prefix CJC) Service Repair Manual Instant Dow...
PDF
Volvo ecr88 battery location Service Repair Manual.pdf
DOCX
lp of food hygiene.docxvvvvvvvvvvvvvvvvvvvvvvv
PDF
higher edu open stores 12.5.24 (1).pdf forreal
PPTX
TOEFL ITP Grammar_ Clausessssssssssssssssss.pptx
PPT
Kaizen for Beginners and how to implement Kaizen
PDF
Volvo EC300D L EC300DL excavator weight Manuals.pdf
PDF
3-REasdfghjkl;[poiunvnvncncn-Process.pdf
PDF
Volvo EC290C NL EC290CNL engine Manual.pdf
PPTX
Gayatri Cultural Educational Society.pptx
Volvo ecr58 plus Service Manual Download
Fire Fighting Unit IV industrial safety.pptx
Delivers.ai: 2020–2026 Autonomous Journey
EC300D LR EC300DLR - Volvo Service Repair Manual.pdf
Todays Technician Automotive Heating & Air Conditioning Classroom Manual and ...
Volvo ecr145cl specs Service Manual Download
Chapter-1.pptxhhhhhhhhhhhhhhhhhhhhhhhhhh
Intro to ISO 9001 2015.pptx for awareness
Renesas R-Car_Cockpit_overview210214-Gen4.pdf
Materi Kuliah Umum Prof. Hsien Tsai Wu.pptx
Caterpillar Cat 315C Excavator (Prefix CJC) Service Repair Manual Instant Dow...
Volvo ecr88 battery location Service Repair Manual.pdf
lp of food hygiene.docxvvvvvvvvvvvvvvvvvvvvvvv
higher edu open stores 12.5.24 (1).pdf forreal
TOEFL ITP Grammar_ Clausessssssssssssssssss.pptx
Kaizen for Beginners and how to implement Kaizen
Volvo EC300D L EC300DL excavator weight Manuals.pdf
3-REasdfghjkl;[poiunvnvncncn-Process.pdf
Volvo EC290C NL EC290CNL engine Manual.pdf
Gayatri Cultural Educational Society.pptx

Making ES6 available to all with ChakraCore