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
Dart VM と Optional Typing
Search
Tomochika Hara
September 22, 2013
Technology
430
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Dart VM と Optional Typing
2013 Dart VM と Optional Typing
Tomochika Hara
September 22, 2013
More Decks by Tomochika Hara
See All by Tomochika Hara
Swiftでつくるファミコンエミュレータのススメ
thara
3
2.5k
モバイルゲーム開発と Google App Engine
thara
0
420
GCPとAWSの比較
thara
0
140
Dart in なごやまつり
thara
0
65
Dartの基本
thara
0
88
Dart言語仕様 Pick-up
thara
0
660
Future & Stream in Dart
thara
0
510
Other Decks in Technology
See All in Technology
宣言型部分更新は何を解決しどこへ向かうのか
shuta13
1
460
パスキーの自動テストはどこまでいけるのか
teamlab
PRO
0
270
Metadata - Section 1: HTML Basics
mohab1
0
120
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
1
1.8k
S3 Filesで挑む! 八戸せんべい汁の食べ頃問題
usanchuu
0
110
しろおびから始める!ログ活用の第一歩
shumei_ito
0
950
今さら理解するウェブフォントver.2026
takanorip
3
890
AI コーディングと人間の認知スループット / CTO Night & Day 2026 Morning Session / AI Coding and Human Cognitive Throughput
prog893
4
1.2k
オントロジーって 結局なにもの? AI エージェントに「意味」を渡す知識設計の話
greenmidori
0
230
Code for Security プロジェクト紹介 2026年10月
yu23ki14
0
110
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
360
DGX Spark でどこまでハッキングができるのか?
kash1064
3
1.4k
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Building Applications with DynamoDB
mza
96
7.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Building Adaptive Systems
keathley
44
3.2k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Crafting Experiences
bethany
1
380
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Transcript
Dart VMと Optional Typing tomochikahara @zetta1985
Agenda • Source Code VM • Isolates • Optional Typing
※ パフォーマンスもウリだけど、今回は語りません、というか語れません 低レイヤの詳しいことは nothingcosmosさんの Dart VM Advent Calendarが詳しい(2012年末時点である事に注意)
Source Code VM Why not Bytecode VM?
JITコンパイル Source Code VM Source Code アセンブラ 中間表現 抽象構文木 Byte
Code VM JITコンパイル コンパイル Source Code アセンブラ 中間表現 抽象構文木
JITコンパイル Source Code VM Source Code アセンブラ 中間表現 抽象構文木 •
コーディング後のコンパイ ル作業が不要 ◦ LL - likeな開発 • 言語に特化した最適化 ◦ 末尾再帰最適化 • 中間表現のカプセル化 ◦ 進化させやすい ◦ 後方互換性の範囲
Isolates Why not Bytecode VM?
• ErlangのActorが源流? • 共有メモリを持たない ◦ top level variableもisolate単位 ◦ full
GCもisolate単位 ◦ 複数isolate間での状態管理が不要 • Message Passing ◦ Object snapshot ◦ SendPortとReceivePortのみで連携 isolates ?
isolateの簡単な例 import 'dart:isolate'; childIsolate() { port.receive((msg, replyTo) { print('doing some
work'); if (replyTo != null) replyTo.send('shutdown'); }); } main() { var sender = spawnFunction(childIsolate); var receiver = new ReceivePort(); receiver.receive ((msg, _) { if (msg == 'shutdown') { print('shutting down'); receiver.close(); } }); sender.send('do work please', receiver.toSendPort() ); } isolate生成 Message受信時のCallback Message 送信 Message受信時のCallback Message 送信
Optional Typing
Optional Typing = 任意型付け • 型を指定してもいいし、しなくてもいい • 型指定があってもなくても、動作に影響しない • Production
Modeなら、LLとほぼ同じ ◦ 型指定無しで書いて、即実行 ◦ 但しREPLは無い
• コーディングから実行までの時間短縮 ◦ コンパイル手順が不要 & コンパイル自体の時間短縮が必要 ◦ Web(GUI)アプリ開発では特に重要 ▪ GWTでの反省?
なぜ Optional typing なのか? • 言語仕様とType Systemを疎結合に ◦ Type Systemに言語仕様が依存すると 言語自体の進化を妨げる
Optional Typingの背景
Pluggable Type System • 現Dart言語設計者 Gilad Bracha氏の発案(2004) • Gilad Bracha氏
◦ Java言語仕様 ◦ Java仮想マシン仕様 ◦ Smalltalk ◦ Newspeak ※ 他にもJoshua BlochがDartの言語仕様に関わる。 Javaっぽくなるのは必然?
Pluggable Type System • 言語とType System の相互依存性の排除 ◦ 便利なType System
は言語に深く依存する ◦ SemanticsもType Systemに依存すると発展を阻害 ▪ Cast, Overloading, Accessibility • Modularityの向上による言語とType System の独自進化 ◦ Type Systemを進化させやすい ▪ 動作しているコードに型は影響しないため • 最も自然なType System ◦ 型付きラムダ計算 ▪ 型が式の評価に影響を与えない
静的 vs 動的型付け 論争の終焉がここにある ※ 釣りです
そして Multiple Type Systemへ
参考 http://www.dartlang.org/ http://nothingcosmos.github.io/DartVM/index.html http://bracha.org/pluggable-types.pdf