Brian Terlson Program Manager on Chakra & Typescript Editor of the Ecmascript Standard
Total Page:16
File Type:pdf, Size:1020Kb
Brian Terlson Program 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 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 ChakraCore Engine Architecture #msedgesummit Now even faster with minified code! ChakraCore Engine Architecture #msedgesummit ChakraCore Engine Architecture #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) ChakraCore Engine Architecture #msedgesummit ChakraCore Engine Architecture #msedgesummit ChakraCore Engine Architecture #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! ChakraCore Engine Architecture #msedgesummit ChakraCore Engine Architecture #msedgesummit Lower memory usage with function body redeferral ChakraCore Engine Architecture #msedgesummit ChakraCore Engine Architecture #msedgesummit Benchmarks! OCTANE 2.0 JET STREAM 1.1 (higher is better) (higher is better) 35000 250 30000 200 30391 30777 25000 28693 207.12 211.68 20000 26135 150 149.85 15000 100 139.48 10000 5000 50 0 0 Microsoft Microsoft Chrome Firefox Microsoft Edge Microsoft EdgeChrome Canary Firefox Nightly Edge CU Edge FCU Canary 63 Nightly 57.0a1 CU FCU 63 57.0a1 Speedometer 1.0 (higher is better) 120.00 100.00 108 80.00 60.00 67.90 40.00 57.20 20.00 0.00 Microsoft Edge Microsoft Edge Chrome Canary CU FCU 63 #msedgesummit Join us on GitHub! • Keep up with what’s new • Documentation • File bugs & feature requests • Download source and precompiled releases • Send pull requests Github.com/Microsoft/ChakraCore #msedgesummit TypeScript JavaScript that Scales Excellent tooling thanks to static types Latest JS features in any browser #msedgesummit TypeScript JavaScript that Scales Prevent 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 Scales Configurable 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(_ => { ... }) #msedgesummit It always gets better… New in 2.3 --strict: Opts in to the strictest form of type checking --checkJs: Run TypeScript on vanilla JS files New in 2.4 Stricter callback typing New in 2.5 Quick fix JSDoc-style type annotations Extract function & extract method refactorings #msedgesummit Demo: TypeScript Types & Tooling #msedgesummit Join us on GitHub! • Keep up with what’s new • Documentation • File bugs & feature requests • Send pull requests Github.com/Microsoft/typescript #msedgesummit The Future is Bright • ChakraCore & TypeScript continue tracking ECMAScript’s Evolution • WebAssembly, SharedArrayBuffer & Atomics in ChakraCore • TypeScript improving its type system and adding refactorings and quick fixes frequently #msedgesummit See you on GitHub! 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 #msedgesummit.