NEW IN ES2016 JAVASCRIPT'S FIRST YEARLY RELEASE Brian Terlson @bterlson [email protected].
Brian Terlson - video.ch9.msvideo.ch9.ms/.../06ChakraCoreTypeScript.pdf · Benchmarks!...
Transcript of Brian Terlson - video.ch9.msvideo.ch9.ms/.../06ChakraCoreTypeScript.pdf · Benchmarks!...
#msedgesummit
Brian TerlsonProgram Manager on Chakra & TypeScript
Editor of the ECMAScript Standard
@bterlson
bterlson
#msedgesummit
JavaScript that Scales with
ChakraCore & TypeScript
#msedgesummit
ChakraCore:
An open source, cross platform, blazing fast,
standards-compliant JavaScript engine
#msedgesummit
Chakra & ChakraCore
#msedgesummit
#msedgesummit
Node-ChakraCore:
Node.js using the ChakraCore engine
github.com/nodejs/node-chakracore
Easily switch between Node versions & flavors
github.com/jasongin/nvs
#msedgesummit
ChakraCore Engine Architecture
#msedgesummit
#msedgesummit
ChakraCore Engine Architecture
#msedgesummit
#msedgesummit
ChakraCore Engine Architecture
#msedgesummit
Now even faster withminified code!
#msedgesummit
ChakraCore Engine Architecture
#msedgesummit
#msedgesummit
ChakraCore Engine Architecture
#msedgesummit
#msedgesummit
ChakraCore Engine Architecture
#msedgesummit
ChakraCore’s Profiling Interpreter
• Gathers information used later by the JIT
• Low latency execution
• Pretty fast, actually!
• Just C++, compile on any platform
• Useful when JITing is impossible
• Hardware constraints (low memory, IoT)
• Software constraints (iOS)
#msedgesummit
ChakraCore Engine Architecture
#msedgesummit
#msedgesummit
ChakraCore Engine Architecture
#msedgesummit
#msedgesummit
ChakraCore Engine Architecture
#msedgesummit
#msedgesummit
ChakraCore Engine Architecture
#msedgesummit
ChakraCore’s Just In Time (JIT) Compiler
• Multiple tiers ensure low latency & high throughput
• Fully cross-platform, supported on Mac OS X and Linux
• Runs out-of-process
• Constantly getting smarter and faster!
#msedgesummit
ChakraCore Engine Architecture
#msedgesummit
#msedgesummit
ChakraCore Engine Architecture
#msedgesummit
Lower memory usage withfunction body redeferral
#msedgesummit
ChakraCore Engine Architecture
#msedgesummit
Benchmarks!
#msedgesummit
30391 3077728693
26135
0
5000
10000
15000
20000
25000
30000
35000
Microsoft
Edge CU
Microsoft
Edge FCU
Chrome
Canary 63
Firefox
Nightly 57.0a1
OCTANE 2.0
(higher is better)
207.12 211.68
149.85 139.48
0
50
100
150
200
250
Microsoft Edge
CU
Microsoft Edge
FCU
Chrome Canary
63
Firefox Nightly
57.0a1
JET STREAM 1.1
(higher is better)
57.2067.90
108
0.00
20.00
40.00
60.00
80.00
100.00
120.00
Microsoft Edge
CU
Microsoft Edge
FCU
Chrome Canary
63
Speedometer 1.0
(higher is better)
Join us on GitHub!
#msedgesummit
• Keep up with what’s new
• Documentation
• File bugs & feature requests
• Download source and precompiled releases
• Send pull requests
Github.com/Microsoft/ChakraCore
#msedgesummit
Excellent tooling thanks to static types
Latest JS features in any browser
TypeScript
JavaScript that Scales
#msedgesummit
TypeScript
JavaScript that ScalesPrevent bugs & mistakes at compile time
Automatically fix some mistakes ( “Quick Fix” )
Refactor entire programs with ease
Works in any editor and thousands of libraries & frameworks
#msedgesummit
TypeScript
JavaScript that ScalesConfigurable target language (ES3, ES5, ES2015, … )
Supports “Stage 3+” ECMAScript proposals
Async generators & iterators
async function* iter() { yield 1; await fetch(); yield 2; }
Optional catch clauses
try { … } catch { … } // no e!
Dynamic import
import(‘lodash.js’).then(_ => { ... })
It always gets better…
#msedgesummit
New in 2.3--strict: Opts in to the strictest form of type checking--checkJs: Run TypeScript on vanilla JS files
New in 2.4Stricter callback typing
New in 2.5Quick fix JSDoc-style type annotationsExtract function & extract method refactorings
Demo: TypeScript Types & Tooling
#msedgesummit
Join us on GitHub!
#msedgesummit
• Keep up with what’s new
• Documentation
• File bugs & feature requests
• Send pull requests
Github.com/Microsoft/typescript
The Future is Bright
#msedgesummit
• ChakraCore & TypeScript continue tracking
ECMAScript’s Evolution
• WebAssembly, SharedArrayBuffer &
Atomics in ChakraCore
• TypeScript improving its type system and
adding refactorings and quick fixes
frequently
See you on GitHub!
#msedgesummit
ChakraCore
GitHub: github.com/Microsoft/ChakraCore
node-chakracore: github.com/node/node-chakracore
nvs: github.com/jasongin/nvs
TypeScript
GitHub: github.com/Microsoft/TypeScript
Typescriptlang.org
@bterlson
bterlson