Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
JavaScriptはコンパイラ型言語か?/Is JavaScript a compiled ...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Akira Morikawa
September 18, 2018
Technology
3.4k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JavaScriptはコンパイラ型言語か?/Is JavaScript a compiled language?
JavaScriptはコンパイラ型言語か?インタプリタ型言語か?を調べてみました
#roppongijs
Akira Morikawa
September 18, 2018
Transcript
27 slides
Sep 18, 2018 #roppongijs @ariaki4dev JavaScript a compiled language ?
Is CC-BY-4.0
[JavaScript] インタプリタですか? コンパイラですか?
自己紹介 ariaki @ariaki4dev #techdo #engineers_lt MEDIA DO Co.,Ltd.
コンパイラ/インタプリタの概要を知る JavaScriptの言語体系を考える 本日の目標 初級者もわかるくらい易しい説明をしたい する #engineers_ltを宣伝する ネタLTなのでエモくやりきる
プログラム言語体系 JavaScript動作の仕組み アジェンダ 1 2
プログラム言語体系 How compiler / interpreter works
コンパイラ型言語 インタプリタ型言語 プログラムをコンピュータが直接的 に実行できる機械語、又は、何らか の効率的な中間表現に変換して実行 する言語体系。 前提条件 プログラムを直接、又は、何らかの 効率的な中間表現に変換しながら実 行する言語体系。
直接実行するかどうか
字句解析 構文解析 意味解析 最適化 コード生成 実行 中間コード オブジェクトプログラム ソースコード
字句解析 let x = “string”; let x = “string” Tokens
構文解析 AST : Abstract Syntax Tree 構文木 (Lexical Analysis) (Syntax Analysis)
https://astexplorer.net JavaScriptをASTに分割して、 グラフィカルに表示するサイト AST Explorer
http://int3.github.io/metajs/ metajs JavaScriptをASTに分割して、 ステップ実行できるサイト
構文木 意味解析 中間コード IR : Intermediate Representation (Semantic Analysis) 最適化
コード生成 (Code Optimization) (Code Generation)
- ESTraverse - babel/traverse - estree-walker - Esrecurse - AST
Types - Acorn - Esprima - babel/parser - espree parser traverseler AST 関連ツール - escodegen - babel/generator code generator - ESLint linter
https://estools.github.io/escodegen/demo/ escodegen demo Esprima / escodegenを使って、 JavaScriptをパース+再生成する
How JavaScript works JavaScript 動作の仕組み
https://mathiasbynens.be/notes/shapes-ics インタプリタ? コンパイラ?
主要JSエンジン # Browser JS Engine 1 Google Chrome V8 2
Apple Safari JavaScriptCore 3 Mozilla Firefox SpiderMonkey 4 Microsoft Edge Chakra 5 KDE Konqueror KJS 6 Mozilla (JVM) Rhino
V8
JavaScriptCore
SpiderMonkey
Chakra
- Just-In-Timeコンパイラの略 (対義語 → AOT : Ahead-Of-Time コンパイラ) - プログラムの実行時にコンパイル
(中間コードからネイティブコードに変換) - Java / .NET 等が有名 JITコンパイラ
- JavaScript エンジンは JIT コンパイラを持つ - インタプリタはバイトコードをすばやく生成 - あまり効率的ではない -
コンパイラは効率の良いマシンコードを生成 - コンパイルに時間がかかる - 複数のコンパイラを使って最適化を制御している 結論
なんか両方もってるし 今日は両者の境界が曖昧なので どっちでもいい という結論に至りました まじか やべー これでええんか
あなたはどっち派?
告知 #engineers_lt / エンジニアの登壇を応援する会 https://engineers.connpass.com/event/100640/
Build Something Amazing written by ariaki4dev
More Decks by Akira Morikawa
See All by Akira Morikawa
コロナ禍だからこそ考えるオフラインコミュニティの意義 / significance of community
ariaki
0
2.3k
アウトプットの始め方/start output 20230121
ariaki
0
380
web-secure-phpcon2020
ariaki
3
3.8k
オブジェクトライフサイクルとメモリ管理を学ぼう / OOC 2020
ariaki
8
4.3k
エンジニアはアウトプットによって成長できるのか? / Grow with your output
ariaki
24
6.9k
アウトプットを始めよう / How to begin output jawsug-bgnr
ariaki
2
4.1k
参加者の安全を守れていますか? / Protecting community safety
ariaki
1
7.8k
タピオカに学ぶ二段階認証 / tapioca-mfa
ariaki
5
1.4k
古に学ぶ個人開発のススメ / My recommendation of personal development
ariaki
1
1.7k
Other Decks in Technology
See All in Technology
さようならSSH鍵、こんにちはゼロトラスト ― AIフレンドリーで快適な自宅鯖SSH
atalie2m
14
7.6k
Del vibe coding a un Desarrollo (agéntico) fiable
jcabot
0
230
Platform Engineering をベースとした Agentic Software Factory の実践
110y
3
1k
社内アプリ基盤「Quartz」による、 非エンジニアとAIに本番デプロイを 任せても壊れないプラットフォームの設計
staka121
PRO
1
250
OCI Artifact による自動運転タクシーに向けた OTA 基盤の構築
biwashi
1
300
OWASP AI Agentic Top10に準拠するクラウドネイティブなガードレールの実践(CNDW 2026)
keitah
1
460
Is the Website Dying?
miriamschwab
0
230
そのイメージ、どのCIが作った? Artifact Attestationsで来歴を固定する / Which CI system created that image? Pinning provenance with Artifact Attestations
chmikata
0
290
Kiro Enterprise Management: 管理者が 1 か所で決め、全員の Kiro に届ける
inariku
PRO
1
160
Fukurou Labo_Engineer_Deck
fukuroulabo
0
110
New Relicのアラート対応をClaude Codeで自動修正するワークフローを作った話
manabuseki
3
740
競馬予想をAIでやってみた話
yoshimura_datam
0
140
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
990
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
680
Become a Pro
speakerdeck
PRO
31
6.4k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
580
What the history of the web can teach us about the future of AI
inesmontani
PRO
3
830
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
370
Designing Experiences People Love
moore
143
24k
My Coaching Mixtape
mlcsv
0
400
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Amusing Abliteration
ianozsvald
1
400