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
Purely Functional Smalltalk-72
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Minori Yamashita
December 27, 2012
Programming
11k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Purely Functional Smalltalk-72
SchemeのマクロでSmalltalk-72をシミュレートします。それを踏まえて言語デザインについて考えます。
Minori Yamashita
December 27, 2012
More Decks by Minori Yamashita
See All by Minori Yamashita
Cloxp @ Smalltalk Meetup
ympbyc
0
320
Real World Objects
ympbyc
2
3.4k
ClojureScriptで変わるクライアントサイドWeb
ympbyc
0
980
LittleSmallscript
ympbyc
2
1.5k
Other Decks in Programming
See All in Programming
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
12
10k
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
5
1.1k
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
130
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
220
AIがコードを書いてくれる時代、我々は何を確かめるのか
yosuke_furukawa
PRO
13
5k
dotNET_vulnclicker_intro.pdf
deka_morita
0
150
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
4
3.3k
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
1k
続・コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions-again
handlename
0
130
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
210
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.9k
Featured
See All Featured
WENDY [Excerpt]
tessaabrams
14
40k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
740
Utilizing Notion as your number one productivity tool
mfonobong
4
630
The Cost Of JavaScript in 2023
addyosmani
55
10k
Into the Great Unknown - MozCon
thekraken
41
2.8k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
630
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Rails Girls Zürich Keynote
gr2m
96
14k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Between Models and Reality
mayunak
4
520
Transcript
Purely Functional Smalltalk-72 Dec 2012 Minori Yamashita
自己紹介 山下実則(19) • ハンドル: ympbyc ◦ twitter, github …etc •
代々木の12階でWebとスマホやってます。 • Available for hire 9月の合同勉強会でLittleSmallscriptの発表をさせ て頂きました。今回もよろしくです。
Smalltalk-72
コード例 Smalltalk-72 Manualより
コード例 Smalltalk-72 Manualより
goto ☞ox←mx ☞oy←my
• The first real Smalltalk ◦ -71は仲間内だけ? • 記号がいっぱい •
名前呼び出し。レシーバがトークンを食いながら 実行されて行く • クラスベースオブジェクト指向 ◦ クラスを関数としても呼び出せる ◦ 継承はない (-76から) • 本来は関数型的な思想 ◦ 代入dis • Lispの特殊形式をdisりながら作られた ◦ 全てメッセージングなのが理想 概要だけ…
LispのマクロでSmalltalk-72
コード例
コード例 Smalltalk-72 Manualより
(☝ _ )☝ SO
(☞ _ )☞ COOL (☝ _ )☝ SO
⇑
☞x←y ☞x←:.
(☞ x ← : . (+ x 2)) ☟ (lambda
(x) (+ x 2)) 定義側 ((foo 'bar) 5) ;=> 7 呼び出し側 これは、 (foo 'bar 5) と書きたい。後で出てきます。
None
to
to WAT DA FSCK IS Z
Z Combinator
None
to ⇒!?!?←#☞⇑!???!
(to animal (name) ( 'name ⇒ name '())) (define (animal
name) (Z (lambda (SELF) (lambda (⇒) (if (equal? 'name ⇒) name '()))))) ☟ メソッド名が束 縛される
コード例2
デモ
ここからが本題
アラン ケイは言いました
"take the hardest and most profound thing you need to
do, make it great, and then build every easier thing out of it" Alan Kay 1993
1970年、関数は弱かった。 • LISPしかない • ダイナミックスコープ • 先行評価 • 特殊形式に依存していた
そこでケイは 関数を"Make it great"するのではなく、 "The hardest and most profound thing"
として、オブジェクトとメッセージングを選ん だ。 Smalltalkでこれは成功した。
時は流れ
オブジェクト指向言語は肥大化した。 • C++, Java, Ruby ... • 無節操なAlgol風構文追加 • 副作用ベース
• オブジェクト指向誕生の動機が全く尊 重されていない
It is unfortunate that much of what is called "object-oriented
programming" today is simply old style programming with fancier constructs. Many programs are loaded with "assignment-style" operations now done by more expensive attached procedures. Alan Kay 1993
いっぽうそのころ
関数が強くなっていった! • クロージャ(レキシカルスコープ) • メッセージパッシング(Scheme) • 遅延評価 • カリー化 •
参照透明(副作用は最小) • The most profound thingとして十分 な機能を獲得した
今、Take the most profound thing and make it greatしたらどうなるの か。
一例
Nadeko
遅延評価とカリー化とシンプルなオブジェクトシス テムを積んだ純粋関数型言語. S式を使うけどマク ロはなし。 構文はラムダ抽象と関数定義と関数呼び出しの3 つだけ!
遅延評価とカリー化とオブジェクト指向風メッセー ジングを積んだ純粋関数型言語. S式を使うけどマ クロはなし。 構文はラムダ抽象と関数定義と関数呼び出しの2 つだけ! Haskell, Io Smalltalk Lisp
Smalltalk-72風 使っているのは関 数だけ!
Actor
後置風関数 - リストが高階関数 語順がSmalltalkと同じになる 無限リスト 部分適用
コミット歓迎
おしまい!
The Early History of Smalltalk http://www.esug. org/data/HistoricalDocuments/Smalltalk80/Smalltalk History.pdf Smalltalk-72 Instruction
Manual http://www.textfiles. com/bitsavers/pdf/xerox/alto/Smalltalk72_Manual. pdf Nadeko https://github.com/ympbyc/Nadeko 参考