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
64
Dartの基本
thara
0
87
Dart言語仕様 Pick-up
thara
0
660
Future & Stream in Dart
thara
0
510
Other Decks in Technology
See All in Technology
サーバーフルコンピューティング?AWS Lambda
iwatatomoya
0
150
BedrockとLambdaで作る リアルタイム進行型推理ゲーム
kawametho
0
170
[2026-09-30]ロックンロールは鳴り止まないっ - 信頼性かまってちゃん - 「データ駆動を投げ捨ててまで。」追いかける信頼性改善に向けた取り組みの話
tosite
0
190
Google Cloud Next Tokyo 26登壇時のスクリプト
recruitengineers
PRO
0
130
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
16
120k
検証フェーズはAIの回答を判断するための学習機会
toru_kubota
2
440
Swap and Memory Reclaim - Squeezing Out More RAM
ennael
PRO
1
1.5k
Execution in the Kingdom of Agents: Reflections on Abstraction and Complexity
bcantrill
0
770
The seven pitfalls of AI (revised version)
ufried
0
220
Apache Iceberg が拓く AI 時代のオープンレイクハウス
tomtanaka
0
210
20260929_AmazonGuardDutyの検出通知メールにAWS DevOpsAgentの調査結果を追加する
yhana
1
420
覗いてみよう 関数型ビジュアル言語×2Dグラフィックスの世界
yohyamasaki
0
170
Featured
See All Featured
Joys of Absence: A Defence of Solitary Play
codingconduct
1
530
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Exploring anti-patterns in Rails
aemeredith
4
520
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
My Coaching Mixtape
mlcsv
0
340
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
290
Ruling the World: When Life Gets Gamed
codingconduct
0
380
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