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
770
1
Share
tc39_study
Temporal
BinaryAST
Daiki Ihara
October 09, 2019
More Decks by Daiki Ihara
See All by Daiki Ihara
ArrayBufferとBinary
sasurau4
1
650
CLIから見るAngular, React, Vue
sasurau4
1
970
Metro Bundler in Web
sasurau4
0
990
reading-mtc2018-web.pdf
sasurau4
1
570
Other Decks in Programming
See All in Programming
AIを導入する前にやるべきこと
negima
2
340
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
110
AI時代になぜ書くのか
mutsumix
0
210
Road to RubyKaigi: Play Hard(ware)
makicamel
1
550
ハーネスエンジニアリングとは?
kinopeee
13
6.8k
サークル参加から学ぶ、小さな事業の回し方
yuzneri
0
140
GitHubCopilotCLIをはじめよう.pdf
htkym
0
330
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
180
cloudnative conference 2026 flyle
azihsoyn
0
120
Agentic UI in the Frontend: Architectures with Open Standards @JAX 2026 in Mainz
manfredsteyer
PRO
0
100
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
140
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
760
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
180
Ethics towards AI in product and experience design
skipperchong
2
270
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
450
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Producing Creativity
orderedlist
PRO
348
40k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
My Coaching Mixtape
mlcsv
0
120
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.9k
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