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
tc39_study
Search
Daiki Ihara
October 09, 2019
Programming
1
770
tc39_study
Temporal
BinaryAST
Daiki Ihara
October 09, 2019
Tweet
Share
More Decks by Daiki Ihara
See All by Daiki Ihara
ArrayBufferとBinary
sasurau4
1
640
CLIから見るAngular, React, Vue
sasurau4
1
970
Metro Bundler in Web
sasurau4
0
980
reading-mtc2018-web.pdf
sasurau4
1
560
Other Decks in Programming
See All in Programming
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
150
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
480
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.1k
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.4k
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
190
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
0
170
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
210
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
8.2k
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
150
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
610
Claude Code Skill入門
mayahoney
0
400
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
220
Featured
See All Featured
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
190
Building AI with AI
inesmontani
PRO
1
800
Building the Perfect Custom Keyboard
takai
2
710
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
74
A designer walks into a library…
pauljervisheath
210
24k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
310
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The Cult of Friendly URLs
andyhume
79
6.8k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
150
What's in a price? How to price your products and services
michaelherold
247
13k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Transcript
tc39_study https://github.com/sasurau4/slides
ABOUT ME { "id": "sasurau4", "name": "Daiki Ihara", "description": "Front-end engineer at CureApp, Inc.", "techs": { "work": ["React Native", "TypeScript", "JavaScript", "MongoDB"], "subwork": ["React Native", "React", "TypeScript"], "hobby": ["React", "TypeScript", "JavaScript", "Deno"] },
"homepage": "https://sasurau4.github.io/profile/" }
What is temporal? Provides standard objects and functions for working with dates and times. This proposal is currently stage 2.
Motivation Fixing JavaScript Date java.util.Date― その悲劇と歴史
Principles All temporal APIs are non-mutating. All temporal objects are effectively immutable. All date values are based on the Proleptic Gregorian Calendar. All time-of-day values are based on a standard 24-hour clock. Leap seconds are not represented.
Specification The documentation is out of date.
Try it with polyfill node --experimental-modules --no-warnings --icu-data-dir ./node_modules/full-icu/ -r ./lib/initialise.js For more details, https://github.com/tc39/proposal-temporal/tree/main/docs
Results > const day = Temporal.Date(2019, 1, 1) undefined > day.day 1 > day.toString() '2019-01-01'
> let d1 = Temporal.DateTime(2019, 2, 1) undefined > d1.toLocaleString() '2019/2/1 0:00:00' > d1.daysInMonth 28 > let onem = Temporal.Duration(0, 1) undefined > onem.toString() 'P1M'
What is binaryAST? Startup performance degrades with larger JS payloads, even if only a fraction of the code is actually executed. Parsing time is a significant component, taking more CPU time than bytecode / initial JIT code generation. For example, on a powerful laptop, Chrome spends 10% to 15% of CPU time parsing JS while loading facebook.com. We propose a new over-the-wire format for JS that is a binary encoding of an AST. We believe this new format would allow for drastically faster parsing. Moreover, web developers are well positioned to adopt a new format as they have embraced build tooling.
Motivation from https://blog.cloudflare.com/binary-ast/
prototype of binAST from https://github.com/binast/binjs-ref As websites become more sophisticated, the amount of JavaScript source code keeps increasing. While depending upon a large JavaScript codebase won't prevent a website from working, it will cause websites to start slowly – often unacceptably slow. This is due to two bottlenecks: parsing and bytecode compiling JavaScript. Unfortunately, browsers have pretty much reached efficiency peak for both operations. We (Mozilla, Bloomberg, Facebook,
CloudFlare) are currently working on a domain-specific encoding for JavaScript, called "BinAST" (short for "JavaScript Binary AST"). The JavaScript Binary AST is designed to break the bottleneck.
Result
Details https://blog.cloudflare.com/binary-ast/
Demo Try it with Firefox nightly! https://serve-binjs.that-test.site
The End