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
Dart VM と Optional Typing
Search
Tomochika Hara
September 22, 2013
Technology
0
350
Dart VM と Optional Typing
2013 Dart VM と Optional Typing
Tomochika Hara
September 22, 2013
Tweet
Share
More Decks by Tomochika Hara
See All by Tomochika Hara
Swiftでつくるファミコンエミュレータのススメ
thara
3
2.1k
モバイルゲーム開発と Google App Engine
thara
0
330
GCPとAWSの比較
thara
0
120
Dart in なごやまつり
thara
0
51
Dartの基本
thara
0
58
Dart言語仕様 Pick-up
thara
0
520
Future & Stream in Dart
thara
0
410
Other Decks in Technology
See All in Technology
手を動かしてレベルアップしよう!
maruto
0
200
偏光画像処理ライブラリを作った話
elerac
1
170
EDRの検知の仕組みと検知回避について
chayakonanaika
11
4.8k
Snowflakeの開発・運用コストをApache Icebergで効率化しよう!~機能と活用例のご紹介~
sagara
1
430
"TEAM"を導入したら最高のエンジニア"Team"を実現できた / Deploying "TEAM" and Building the Best Engineering "Team"
yuj1osm
1
130
スキルだけでは満たせない、 “組織全体に”なじむオンボーディング/Onboarding that fits “throughout the organization” and cannot be satisfied by skills alone
bitkey
0
170
IAMのマニアックな話2025
nrinetcom
PRO
1
240
AIエージェント元年@日本生成AIユーザ会
shukob
1
200
急成長する企業で作った、エンジニアが輝ける制度/ 20250227 Rinto Ikenoue
shift_evolve
0
130
Change Managerを活用して本番環境へのセキュアなGUIアクセスを統制する / Control Secure GUI Access to the Production Environment with Change Manager
yuj1osm
0
100
クラウド関連のインシデントケースを収集して見えてきたもの
lhazy
2
240
サイト信頼性エンジニアリングとAmazon Web Services / SRE and AWS
ymotongpoo
7
1.5k
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.6k
Testing 201, or: Great Expectations
jmmastey
42
7.2k
Speed Design
sergeychernyshev
27
810
Embracing the Ebb and Flow
colly
84
4.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Practical Orchestrator
shlominoach
186
10k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
430
Building Your Own Lightsaber
phodgson
104
6.2k
Designing for humans not robots
tammielis
250
25k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
175
52k
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