狠狠撸

狠狠撸Share a Scribd company logo
Smalltalkについて
@sumim
2020/5/4
Smalltalkを学ぶ会(リモート開催)
Smalltalkとは…
プログラミング言語とその処理系?
Smalltalkとは…
プログラミング言語とその処理系だけではなく
それらを含む(いわゆる)“OS”のひとつ
? かなり早い時期に仮想化された─
? オブジェクトベース(not ファイルシステムベース)の─
? グラフィカルなUI付きの─
Smalltalkとは(別の言い方をすると)…
プログラミング言語とその処理系。ただし
? オンメモリ簡易OODB内に構成
? メモリダンプ(ファイル化)して持ち出し可
? プリミティブな描画関数を一つ持ち
簡易OODB内に構成されたGUIを
(ウインドウ内等)ホストPC画面に投影
Smalltalkの系譜(コンセプトの理解に重要)
? Smalltalk-72 … タートル描画が使えるスクリプト言語
? Smalltalk-74 … -72+高速描画ルーチン → GUI
? Smalltalk-76 … -72とは別物。省コスト版メッセージング
? Smalltalk-78 … 8086でも動かせるコンパクト版-76
? Smalltalk-80 … 実験色を排除し商用言語処理系(IDE)へ
Smalltalk-72 Smalltalk-74 Smalltalk-76 Smalltalk-80
Smalltalkに関わりをもった人たち
Smalltalk-72 Smalltalk-76 Smalltalk-80
1973 Hewitt (Actor) 1978-79 Reenskaug (MVC)
1978 Borning (ThingLab)
1979 Jobs (Lisa/Mac/NeXT)
1980-
Joe Armstrong (Erlang)
Dave Thomas
Beck/Cunningham/Fowler
Jeff Sutherland (Scrum)
メッセージングのオブジェクト指向(アラン?ケイ)
? 「コンピューターは“計算機”である以上にメタメディアである」という気づき
? そんなコンピューターの中身(プログラム)を、データ構造、手続き、関数など
のように、コンピューターそれ自体よりも弱いものに分割して構成し、それらの
手のかかる管理に煩わされるのはつまらない。
? オブジェクト → 小さなコンピューター
? すべてをオブジェクトのみで構成 → 再帰的(Turtles All the Way Down)
? それらが非常に高速なネットワークで相互に接続されてメッセージをやりとり。
サーバー指向プログラミング(生命体の細胞とその営みにも例えられる)
? 個々のコンピューターが期待通り正しく動くなら、それらが具体的にどう実装さ
れていようと気にする必要はない。答えが間違っていたり、いくら待っても答え
を返してこなかったら、そのときはどう実装すべきか考えればいい。決定の遅延
Smalltalk考案時のスキーム
? すべてはオブジェクトである。
? すべてのオブジェクトはメモリーを持つ(メモリーもオブジェクト)。
? オブジェクトはメッセージをやりとりし協働する(メッセージもオブジェクト)。
? すべてのオブジェクトはクラスのインスタンスである(クラスもオブジェクト)。
? クラスはそのインスタンスであるオブジェクトに共通する動作をメソッドとして保
持する(コードもオブジェクトにより構成される)。
? コードの評価にあたっては、最初のオブジェクトに制御が渡され、残りのオブジェ
クト群はそれへのメッセージとして扱われる。
Smalltalk考案時のスキーム
? すべてはオブジェクトである。
? すべてのオブジェクトはメモリーを持つ(メモリーもオブジェクト)。
? オブジェクトはメッセージをやりとりし協働する(メッセージもオブジェクト)。
? すべてのオブジェクトはクラスのインスタンスである(クラスもオブジェクト)。
? クラスはそのインスタンスであるオブジェクトに共通する動作をメソッドとして保
持する(コードもオブジェクトにより構成される)。
? コードの評価にあたっては、最初のオブジェクトに制御が渡され、残りのオブジェ
クト群はそれへのメッセージとして扱われる。
メッセージングのアイデアの実現
3 + 4
オブジェクト3 への + 4 というメッセージの送信と解釈すればいい!
? Smalltalk-72
for i ← 1 to 10 do ( i print. user ← 13 )
オブジェクト for への i ← 1 to …の送信として実装
? Smalltalk-76
for? i from: 1 to: 10 do? [ i print. user cr ]
省略されたオブジェクトへの for? i from: 1 to: …の送信で実装
for? from:to:do? メソッドのコール(実体は for:from:to:do:on: )
? Smalltalk-80以降
1 to: 10 do: [:i | Transcript show: i printString; cr; endEntry]
オブジェクト1 への to: 10 do: … の送信として実装
to:do: メソッドのコール(実際はコンパイル時にインライン展開)
Smalltalk変遷の追体験が可能
? Smalltalk-72 … https://lively-web.org/users/Dan/ALTO-Smalltalk-72.html
? Smalltalk-74 … いまのところ無し
? Smalltalk-76 … ContrAltoエミュレーター + resume xmsmall.boot
? Smalltalk-78 … https://lively-web.org/users/bert/Smalltalk-78.html
? Smalltalk-80 … https://squeak.js.org/demo/simple.html#fullscreen
Smalltalk-72 Smalltalk-74 Smalltalk-76 Smalltalk-80
?クラスはJavaScriptと同様に関数(かつif式のネスト)で継承機構は無い
条件 ?(非false時の処理) false時の処理,条件分岐式
?(アイボール),パターンマッチ
?(スマイリー),タートル(クラス turtle のインスタンス)
?(指さし)+文字列,シンボルリテラル表現(主に変数をあらわす)
:(コロン),解釈中メッセージ内の次のオブジェクトの読み込み
?メッセージングはメソッド呼び出しではなくトークン列のパース
非同期ではなかったが「アクター」の着想に大きな影響を与えた
参考:Smalltalk-72で学ぶOOPの原点 Advent Calendar 2019
Smalltalk-72
Smalltalk-76
? Simula67スタイル(つまり現在主流のと同じ)のクラスへの転換
継承機能のサポート
メソッドもパターンマッチからメンバー関数に
メッセージはメソッドの動的呼び出しに → 省コスト版メッセージング
メソッドが存在しないときだけメッセージをハンドリング可能に
? 現在に続くウィジェットやUIパターンを創出
? スクロールバー(ただし左にポップアップしフォーカス明示を兼ねた)
? カラムインターフェース(システムブラウザー)
? 仮想デスクトップ(サブビュー)
? ラジオボタン、ペイントツール、ドット拡大編集
必読文献(ただし追体験とあわせないと難解)
? 構想
1972 - A Personal Computer for Children of All Ages
https://swikis.ddo.jp/abee/74
? 最初の成果報告
1975 - Personal Computing
http://mnielsen.github.io/notes/kay/Personal_Computing_1975.pdf (PDF, 乱丁注意)
? 振り返り
1993 - The Early History Of Smalltalk
http://worrydream.com/EarlyHistoryOfSmalltalk/
? 総括
2003 - “Software Engineering” an Oxymoron?
http://metatoys.org/oxymoron/oxymoron.html
まとめ
? Smalltalkは言語処理系を含む、仮想化されたGUI付きオブジェクトベースOS。
? データ構造や関数ではなく、コンピューターの再帰的定義で(PoC的側面が濃い)
? すべてがオブジェクト。処理系もオブジェクトでオブジェクトストア内に構築。
? 操作はすべてメッセージを介して行われる。疎結合。決定の遅延。
? メッセージングは非同期まで到達せず。パース、動的関数コール…と実装は自由。
? Smalltalk-76以降の現在に至るSmalltalkは、抽象データ型のスーパーセットのオブ
ジェクト指向プログラミングを限定的ながらシミュレート(切り分けが大事)
? コンセプトの理解は現存する当時の処理系の体験と相補的に進めると効率がよい。
? 分かってしまえばシンプル(だが、考え方の切り替えに苦痛やコストを伴う)
? 些細な疑問は気軽に訊いて解決し先に進む!(自力解決、完璧な理解に拘らない)
Ad

Recommended

Smalltalk ~ ユーザーイリュージョンの黎明
Smalltalk ~ ユーザーイリュージョンの黎明
sumim
?
The Emergence of the Illusion of Smalltalk Users in Its Early Days
The Emergence of the Illusion of Smalltalk Users in Its Early Days
MasatoSumi
?
Why!? Smalltalk
Why!? Smalltalk
Masashi Umezawa
?
厂尘补濒濒迟补濒办と型について
厂尘补濒濒迟补濒办と型について
Masashi Umezawa
?
Smalltalk勉強会 - 過去、現在、そして未来へ
Smalltalk勉強会 - 過去、現在、そして未来へ
Masashi Umezawa
?
今日から使おう厂尘补濒濒迟补濒办
今日から使おう厂尘补濒濒迟补濒办
Sho Yoshida
?
アラン?ケイ氏の未来の创り方
アラン?ケイ氏の未来の创り方
sumim
?
オブジェクト指向とは何ですか?
オブジェクト指向とは何ですか?
sumim
?
2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
?
Storytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
?
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
?
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
?
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
?
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
?
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
?
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
?
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
?
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
?
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
?
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
?
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
?
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
?
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
?
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
?
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
?
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
?
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
?
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
?

More Related Content

Featured (20)

2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
?
Storytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
?
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
?
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
?
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
?
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
?
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
?
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
?
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
?
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
?
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
?
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
?
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
?
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
?
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
?
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
?
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
?
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
?
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
?
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
?
2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
?
Storytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
?
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
?
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
?
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
?
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
?
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
?
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
?
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
?
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
?
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
?
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
?
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
?
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
?
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
?
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
?

20200504 Smalltalkを学ぶ会 (リモート開催) - Smalltalkについて