ããã20å¹´åã«Alan Kay の講演ãããããã¨ããããå°è±¡ã«æ®ã£ãã®ã¯ãå½¼ãå¼ãåãã«åºãã McLuhan ã®è¨èã ã
I don't know who discovered water, but it wasn't a fish.
(æ訳)誰ãæ°´ãçºè¦ãããã¯ç¥ããªãããçºè¦è ãéã§ãªãã£ããã¨ã¯ç¢ºãã ã
誰ãã信念ã¨ããæ°´ã®ä¸ãæ³³ãéã®ãããªåå¨ã ãæãåã£ã¦é£ã³è·³ã空æ°ã«è§¦ãã¦ã¿ãªãã°ãèªåã信念ã¨ããæ°´ã®ä¸ã«ãããã¨ã«æ°ä»ããªãã
ããææ³ã®å©ç¹ãèªãã«ã¯ããã®ææ³ã®æ¬ ç¹ããä»ã®ææ³ã®å©ç¹ãæ¬ ç¹ã¨ã§ããã ã客観çã«æ¯è¼ããªããã°èª¬å¾åããªãããã ããããå®è·µããã®ã¯é£ããããã®è¨äºã§ã¯ã客観çã«ãªãã¦ãããèªåèªçããªãããåçåä»ãè¨èªã¨éçåä»ãè¨èªã«ã¤ãã¦æ¯è¼ãã¦ã¿ããã¨æãã
åã¯éç㪠C è¨èªãããåç㪠PerlãLispãJavaScript ãçµã¦ãç¾å¨ã§ã¯éç㪠Haskell ã主ã«ä½¿ã£ã¦ãããã ããéçåä»ãè¨èªããåçåä»ãè¨èªã«ç§»ã£ã人ã®æ°æã¡ãåããã¤ããã ãããã®éãåããã¤ããã ã(ãããåãããªããã¨ãå¤ããã ãããã©ã)
ä¸å£ã«åçåä»ãè¨èªãéçåä»ãè¨èªã¨ãã£ã¦ãå®ã«ãã¾ãã¾ã§ãæ¬å½ã¯åæä¸çµ¡ãã«è°è«ãããã¨ã¯ã§ããªããããããç´°é¨ã«ãã ããã¨è¨ããããã¨ãä¼ãããªããªãã¨æãã®ã§ãç´°ããç¹ã«ã¯ç®ãã¤ã¶ã£ã¦é ããã¨å¬ããã
以ä¸ã§ã¯åã®ç«å ´ä¸ãåçåä»ãè¨èªã®ããã°ã©ãã主張ããåçåä»ãè¨èªã®å©ç¹ãéçåä»ãè¨èªã®æ¬ ç¹ããéçåä»ããé¢æ°åãè¨èªã®ããã°ã©ãããã©ããã風ã«è¦ããã®ãã¨ãã話ã«ãªãã
ãã¹ã¦ã®åçåä»ãè¨èªã®ããã°ã©ãããããã主張ããã¦ããã¨ã¯æã£ã¦ããªãããéçåä»ãé¢æ°åè¨èªãä¸æ¬ãã«ããã®ãä¹±æ´ãªã®ã¯æ¿ç¥ãã¦ãããããªããéããªãã¨æãããã建è¨çãªããã°è¨äºããªã©ãæ¸ãã¦è°è«ãã¦é ããã¨ãããããã
ã¹ã¯ãªãã
ãåçåä»ãè¨èªã¯ã³ã³ãã¤ã«ããã«ã¹ã¯ãªããã¨ãã¦èµ°ããããã¨ãã§ãã¦æ¥½ã ã
éçåä»ãè¨èªã§ãã£ã¦ãã³ã³ãã¤ã«ãã¦å®è¡ããã¨ããã©ããã¼ããã°ã©ã ãæ¸ãã°ãã¹ã¯ãªããã®ããã«å®è¡ã§ãããå®éãéçåä»ãé¢æ°åè¨èªã§ã¯ããããã©ããã¼ããã°ã©ã ãæä¾ãã¦ãããã®ãå¤ããããã使ããã¦ããã
以ä¸ã¯ Haskell ã®ä¾ï¼
% runhaskell HelloWorld.hs Hello, world!
è¨è¿°é
ãåçåä»ãè¨èªã§ã¯å注éãæ¸ããªãã¦ãããã®ã§è¨è¿°éãæ¸ã£ã¦æ¥½ã ã
ãã¾ãè¨è¨ãããéçåä»ãè¨èªã§ã¯ãå注éã¨å®ç¾©ãåé¢ããã¦ããã以ä¸ã¯ Haskell ã®ä¾ï¼
repl :: Int -> Char -> [Char] -- ãããå注é repl 0 _ = [] -- ãã以éãé¢æ°ã®å®ç¾© repl n c = c : repl (n-1) c
ã ãããå注éã¯çç¥ãã¦æ¸ããã
repl 0 _ = [] repl n c = c : repl (n-1) c
éçåä»ãé¢æ°åè¨èªã®å¤ãã¯ãåæ¨è«ã¨ããæ©è½ãæã¡ãå®ç¾©ããåãæ¨æ¸¬ãããããã§å¿ è¦ã§ããã°ã³ã³ãã¤ã©ãæ¨è«ããåãããã°ã©ãã³ã°ç°å¢ãèªåçã«æ¿å ¥ãã¦ãããã
éã«ãHaskell ã§ã¯åãå ã«æ¸ãã¦ãåã¬ãã«ã§è¨è¨ãããã¨ããã(ã¡ããã©ãªãã¸ã§ã¯ãæåã®ããã°ã©ãã UML ãæ¸ãããã«)ã
repl :: Int -> Char -> [Char] -- ãããå注é repl = undefined -- åæ¤æ»ããã¾ããé¢æ°å®ç¾©
åã®å ´åã¯
- ç°¡åãªé¢æ°ã¯ãã¡ãã¡å注éãæ¸ããããªãã®ã§ãå®ç¾©ããæ¸ãã¦å注éã¯èªåæ¿å ¥
- é£ããé¢æ°ã¯å注éãæ¸ãã¦åã®ã¬ãã«ã§è¨è¨ããå¾ããå®ç¾©ãæ¸ã (ãã®å ´åãåãå®è£ ãå°ãã¦ããã)
ã®ããã«ä½¿ãåãã¦ããã
対話ç°å¢
ãåçåä»ãè¨èªã§ã¯å¯¾è©±ç°å¢ãããã®ã§éçºå¹çãããã
対話ç°å¢ãããã°éçºå¹çãããã¨ãã主張ã«ã¯å®å ¨ã«åæãã§ããéçåä»ãé¢æ°åè¨èªã®å¤ãã«ã対話ç°å¢ããããå人çãªæè¦ã§ã¯ã対話ç°å¢ãããè¨èªã§ããªãã©ã«ãå å®ãã¦ãªãã®ã§ããã°ã対話ç°å¢ã®å©ç¹ãåæ¸ãã¦ããã¨æãã
ãã¨ãã°ãHaskell ã§å®ç¾©ããããã¼ã¿ã¯ãããããã®ã¾ã¾ãªãã©ã«ã¨ãªããé¢æ°ã®å ¥åã«ã使ããããåºåã®éããã®ã¾ã¾ã®å½¢ã§è¡¨ç¤ºããããä»¥ä¸ Haskell ã§æ¨ãå®ç¾©ããä¾ï¼
data Tree a = Leaf a | Node (Tree a) (Tree a) deriving (Show,Functor)
以ä¸ã¯ãå®ç¾©ããæ¨ã対話ç°å¢ GHCi ã§ä½¿ãä¾ï¼
% ghci Tree.hs > fmap (+1) (Node (Leaf 1) (Leaf 2)) Node (Leaf 2) (Leaf 3)
å ¥åãåºåãå®ç¾©ããã®ã¾ã¾ãªãã©ã«ã«ãªã£ã¦ãããã¨ãåããã ããã
ãã¹ã
ãåçåä»ãè¨èªã¯ãã¹ãããããã
ããã¯æå³ãåãããªãã£ãã®ã ãããã¨ãã°ãå¼ã³åºãã¡ã½ãããå®è¡æã«æ±ºå®ããæ©è½ã使ã£ã¦ã¢ãã¯ãå·®ãè¾¼ããã¨ããããããããã¨ãªã©è¨ã£ã¦ããã®ã§ã¯ãªããã¨æãã¦é ããã
ãããã«éçåä»ãè¨èªã®ãªãã¸ã§ã¯ãããã¹ãããã®ã«æ¯ã¹ãã°ãåçåä»ãè¨èªã®ãªãã¸ã§ã¯ãããã¹ãããæ¹ããããããã ãããã§ããããã¯ãªãã¸ã§ã¯ãæåã§èãã¦ããããã§ã¯ãªãã(åæä¸çµ¡ãã«ãã¦ããã¾ãã)ï¼
é¢æ°ããã°ã©ãã³ã°ã®å ´åã¯ãå·®ãæ¿ãããé¨åããããªããããã¯å¼æ°ã«ãã¦ãããã ããããã¹ãã®ããã«ãå®è¡æã«å¼ã³åºãã¡ã½ãããå¤ããããã¨ã¯æããªããå¼æ°ãå¤ããã°ããããã ã
å°ã話ããããããã©ãé¢æ°åè¨èªã§ã¯å¯ä½ç¨ã®ããé¢æ°ã¨ãªãé¢æ°ãåãã¦æ¸ãç¿æ £ã身ã«ã¤ãã¦ããããã°ã©ããå¤ããå¯ä½ç¨ã®ãªãé¢æ°ã¯ãå¼æ°ã ãããçµæã決ã¾ãã®ã§ãã¹ããããããå¯ä½ç¨ã®ããé¢æ°ã§ããä¸è¨ã®ããã«åä½ãå¤ãããé¨åã¯ãå¼æ°ã«ãã¦ãã¹ãããããããã«å·¥å¤«ããã
ä¸ã®ä¸ã®ã³ã¼ãã¯ãã¾ãè¨è¨ããã¦ãããã®ã°ãããããªãããã¾ãè¨è¨ããã¦ãªãã³ã¼ããæ渡ãããã¨ãã«ãå®è¡æã«å¼ã³åºãã¡ã½ãããå¤ããããã®ã§ãã¹ããããããããããæè¦ã«ã¯ä¸çããã¨æããã©ãåã ã¨(å¤æ´ã許ããããªã)ãªãã¡ã¯ã¿ãªã³ã°ãã¦ãã¹ãããããå¤æ´ããã¨æãããã®æ¹ãä¿å®ãããããªããããã
ã¡ãªã¿ã«ãå¯ä½ç¨ã®ãªãé¢æ°ã«é¢ãã¦ã¯ããã¹ãã±ã¼ã¹ãèªåçã«çæããã¨ãããã¹ãææ³ããã£ã¦ãéçåä»ãé¢æ°åè¨èªã§ã¯ãã使ããã¦ããããã®ç¨®ã®ãã¹ãã§ã¯ãé¢æ°ãæã¤ã¹ããæ§è³ªããè¨è¿°ããã以ä¸ãããæ¹æ³ã§ç¬¦å·åãã¦å¾©å·åããã°ãå ã«æ»ãã¨ããæ§è³ªã®ä¾ï¼
prop_encodeDecode :: String -> Bool prop_encodeDecode xs = decode (encode xs) == xs
対話çã«ãã¹ããã¦ã¿ãï¼
> quickCheck prop_encodeDecode OK, passed 100 tests.
100åã®ä¹±æ°ãçæããã¦ããã¹ã¦ãã¹ããééãããã¨ãåãããå¤ã®çææ¹æ³ã«ããä¹±æ°çã«çæããæ¹æ³ã®ä»ã«ããã大ãããç¶²ç¾ ããæ¹æ³ãªã©ãããã
ãã¹ãã®ä¸çã¯åºãã¦æ·±ããããå±é¢ã§ããã¹ããããããã¨è¨ããã¦ããããªãã®å ´åã ã¨ãããªãã§ãããããã¨ããææ³ã«ãªããã¨ãå¤ãã
ã¡ã¿ããã°ã©ãã³ã° (追è¨)
ãåçåä»ãè¨èªã¯ãå®è¡æã«ç°å¢ã«å¿ããã¡ã¿ããã°ã©ãã³ã°ãã§ããã
ããã¯ããã¨ãã°å®è¡æã« DB ã®ã¹ãã¼ããåã£ã¦ãã¦ãå¿ è¦ãªã¡ã½ãããã¡ã¿ããã°ã©ãã³ã°ã§èªåçæãããã¨ãªã©ãè¨ã£ã¦ãããããããéçåä»ãè¨èªã§ããã³ã³ãã¤ã«æã« DB ã®ã¹ãã¼ããåã£ã¦ãã¦å¿ è¦ãªé¢æ°/ã¡ã½ãããèªåçæã§ããã
ã¹ãã¼ããå¤ãã度ã«ã³ã³ãã¤ã«ããã®ã¯é¢åã¨æããããã³ã³ãã«ãã¦ããç¨åº¦ã®å質ãä¿è¨¼ãããã¨æããã¯ãããã°ã©ã次第ã ã
ä¸å®å ¨
ãåçåä»ãè¨èªã¯ä¸å®å ¨ãªã³ã¼ããå®è¡ã§ããã
ããããåçåä»ãè¨èªã®å©ç¹ã¯ããã®è¨èã«éç´ãããã¨æãããã ãããã¯ããªã大éæãªè¡¨ç¾ãªã®ã§ãããå°ãå³å¯ã«è°è«ãããã
ã¾ããéçåä»ãè¨èªã§ãä¸å®å ¨ãªã³ã¼ãã¯å®è¡ã§ããããã¨ãã°ããã® C è¨èªã®ã³ã¼ãï¼
#include <stdio.h> void main () { }
ä½ãå®è£ ãã¦ãªããã(ä»æ§ãæºãããªãã¨ããæå³ã§)ä¸å®å ¨ã ãã©ãã³ã³ãã¤ã«ãã§ããããå®è¡ãã§ãããå¥ã®ä¾ã¨ã㦠undefined ã使ã£ãä¸å®å ¨ã§ãå®è¡ã§ãã Haskell ã³ã¼ããæåã®æ¹ã§ç¤ºããã
ã¨ãã訳ã§ãè¨ããããã¨ã¯åãããã ããã©ãããå°ãç確ãªè¡¨ç¾ã使ãæ¹ãããã¨æãã以ä¸ã§ã¯ããã®ãã¼ããç´°ååãã¦è°è«ãã¦ããã
å°ãªãæéã§ä¸å®å ¨
ãåçåä»ãé¢æ°åè¨èªã§ã¯ãå°ãªãæéã§ä¸å®å ¨ãªã³ã¼ããè¨è¿°ã§ããã
ãå°ãªãæéãã¨ã¯ãããé¨åã§ããã¡ã½ãããå¼ã³åºãã¦ããã®ã«ããã®ã¡ã½ããã®å®ç¾©ã¯ä¸æåãæ¸ããã¦ããªããªã©ãè¨ã£ã¦ããã
ãã ãéçåä»ãè¨èªã§ã¯ãå®ç¾©ããã¦ãªãã¡ã½ãããé¢æ°ãããã°ãããã°ã©ãã³ã°ç°å¢ãé¢æ°å®ç¾©ã®éå½¢ãèªåæ¿å ¥ã§ããã®ã§ãåçåä»ãè¨èªã®å©ç¹ã¨ã¯è¨ããªãã¨æãã
ã¤ã³ã¿ã¼ãã§ã¤ã¹ã®æè»ãªå¤æ´
ãåçåä»ãé¢æ°åè¨èªã§ã¯ãå ¬éãã¦ããã¤ã³ã¿ã¼ãã§ã¤ã¹ã®äºææ§ãä¿ã¡ãªãããæ°ããä»æ§ã«å¤æ´ã§ããã
ãã¨ãã°ã第ä¸å¼æ°ãæ´æ°ã§ç¬¬äºå¼æ°ãæååã§ããé¢æ°ãå ¬éãã¦ããã¨ããããå©ç¨ãã¦è¡ãéç¨ã§ãé çªã¯éã®æ¹ãããã¨æ°ä»ããã
åçåä»ãè¨èªã§ããã°ãå®è¡æã«ç¬¬ä¸å¼æ°ã®åãæ¤æ»ããæ´æ°ãªãå¤ãä»æ§ã§ãæååãªãæ°ããä»æ§ã§åãã¨ãããã¨ãå¯è½ã ããããèªåãæä¾ããã©ã¤ãã©ãªã®é¡§å®¢ãã顧客å´ã®ã³ã¼ãã®å¤æ´ãèªãã¦ãããªãã®ã§ããã°ããããã対çãå¿ è¦ã«ãªãããããã£ãç¶æ³ã§ã¯ãåçåä»ãè¨èªã®æ¹ãæå©ã
ãã ãéçåä»ãè¨èªã®ããã°ã©ãã¯ããã®ãããªå¤æ´ããªãããããéããã«æ°ããã¤ã³ã¿ã¼ãã§ã¤ã¹ã«ç§»è¡ããã¹ãã ã¨èãã¦ãããã³ã³ãã¤ã©ã¯ãå¤æ´ãã¹ãç®æããã¹ã¦è¦ã¤ãã¦ãããã®ã§ã顧客ãå¤æ´ãèªãã¦ãããªãã¨ããç¶æ³ã§ãªãéããå¤æ´ã¯å¯è½ã ããå¤æ´ã®æéãããããªã(ãã å¿ è¦ãªäººã¸ã®é£çµ¡ã¯æéã )ã
ããã¯ä¸é·ä¸çã§ããã
éçåä»ãè¨èªã®ããã°ã©ãã«ã¨ã£ã¦ã¯ãå¤æ´ãã¹ãç®æãææãããã¼ã«ããªãã®ã¯ä¸å®ã«æããã ããã(éç解æãã¼ã«ãæä¾ãã¦ããåçåä»ãè¨èªãããããè¨èªå¦çç³»ã«çµã¿è¾¼ã¾ãã¦ããªãã¨ãè¨èªå¦çç³»ã®å¤åã«åãæ®ããã¦ããã¨ãããããã)
åçåä»ãè¨èªã®ããã°ã©ãã«ã¨ã£ã¦ã¯ãå¤æ´ã«å¯¾ããæè»æ§ããªãã®ã¯ä¸å®ã«æããã ããã
ã¦ã¼ã¶ã¤ã³ã¿ã¼ãã§ã¤ã¹ã¨ãã¦ã®è¨èª
ãåçåä»ãè¨èªã¯ãããã·ã¹ãã ãå¶å¾¡ããã¦ã¼ã¶ã¤ã³ã¿ã¼ãã§ã¤ã¹è¨èªã«åãã¦ããã
ããã·ã¹ãã ãå¶å¾¡ããã¦ã¼ã¶ã¤ã³ã¿ã¼ãã§ã¤ã¹è¨èªã¨ã¯ããã¨ãã° Emacs ãå¶å¾¡ãã Emacs Lisp ããã©ã¦ã¶ãå¶å¾¡ãã JavaScript ãæããããããããã®è¨èªã¯ããã¨ãã³ã¼ããä¸å®å ¨ã§ãåãç¶ããªããã°ãããªããã ãããããã·ã¹ãã ãå¶å¾¡ããã¦ã¼ã¶ã¤ã³ã¿ã¼ãã§ã¤ã¹è¨èªã®è¨è¨è ã¯ãèªç¶ã¨åçåä»ãè¨èªãé¸æããã ããã
ãã ããåçåä»ãè¨èªã¯å質ã®é¢ã«ä¸å®ãããã®ã§ãã³ã¼ãçæãå©ç¨ãã¦ããããã°ã©ãããããæè¿ã§ã¯ãã³ã¼ããéçåä»ãè¨èªã§è¨è¿°ãã¦ãããã³ã³ãã¤ã«ã§ããç¨åº¦ã®å質ãä¿è¨¼ãã¦ãããJavaScript ãçæããã¨ããæ¹æ³ãä¸é¨ã§æµè¡ã£ã¦ããããããã使ãæ¹ãããããã°ã©ãã«ã¨ã£ã¦ã¯ãJavaScript ã¨ã¯ãã©ã¦ã¶ãå¶å¾¡ããããã®ã¢ã»ã³ããªè¨èªã§ããã
ãããã¹ã¯ãã
ãåçåä»ãè¨èªã§ã¯ãã³ã¼ãã®ãããã¹ã¯ãããã§ããã
åãç¶ããªããã°ãªããªããµã¼ãã®ã³ã¼ãã®ä¸é¨ããã¼ã¸ã§ã³ã¢ããããããåçåä»ãè¨èªã® Erlang ã§æ¸ããããµã¼ãã§ã¯ãã³ã¼ãã®ãããã¹ã¯ãããå½ããåã®ããã«å®è·µããã¦ããã
éçåä»ãè¨èªã§ããã£ã¦ãããªããã¨ã¯ãªãã¨æããã©ãåçåä»ãè¨èªã®æ¹ãå§åçã«ãããããã®ã¯ééããªãã
ãããã¬ã§ã®ããã°ã©ãã³ã°
ãåçåä»ãè¨èªã§ã¯ãå¤ããããä¸çãåçã«æã¾ãã¦ããã°ã©ãã³ã°ã§ããã
ã³ã¼ããæ¸ããã¨ãã«ã¯æ³å®ãã¦ãªãã£ãããæ°ä»ãã¦ã¯ãããã©ã対å¦ããã°ããã®ãåãããã«ãã®ã¾ã¾ã«ãã¦ããç®æãããã¨ããããåªããåçåä»ãè¨èªã§ã¯ããããè¸ãã¨ãããã¬ãèµ·åãããããã¦ããããã¬ã®ä¸ã§å¯¾å¦ããã³ã¼ããæ¸ãã¦åå®è¡ããã°ãããããåããã³ã¼ãããã£ããã®ããã«åãã¦ãããã
åªããåçåä»ãè¨èªã®åªããããã°ã©ãã¯ãããåç¾ã§ããªããããããªãåè¼ä¸éã®ãã£ã³ã¹ãç¡é§ã«ããããªããã ããããã®ãããªããã°ã©ãã«ã¨ã£ã¦ã¯ããããã¬ãªã©ã®ããã°ã©ãã³ã°ç°å¢ãããã°ã©ãã³ã°è¨èªã ã
ãã®ãããªããã°ã©ãã³ã°ãå®è·µãã¦ããããã°ã©ãã¯ãæ¬å½ã«å°æ¬ãããæ®å¿µãªãããéçåä»ãè¨èªã§ã¯ããã®ãããªããã°ã©ãã³ã°ã¯ã§ããªãããç¸å½ç¡çãããã
ã¾ã¨ã
åã®èããåçåä»ãè¨èªã®å©ç¹ãã¾ã¨ããã¨ä»¥ä¸ã®ããã«ãªãã
- ã¤ã³ã¿ã¼ãã§ã¤ã¹ãå¤æ´ã§ããªãç¶æ³ã§ãæè»ã«å¯¾å¿ã§ãã
- ä¸å®å ¨ãªå ´åã§ãåãç¶ããªããã°ãªããªãç¶æ³ã§åãç¶ãããã
- ã³ã¼ãã®ãããã¹ã¯ãããããããã
- å¤ããããä¸çãåçã«æã¾ãã¦ããã°ã©ãã³ã°ã§ãã
æ¬ ç¹ã¯ã以ä¸ã®ãããªç¹ï¼
- ãããããã¹ããæ¸ããªãã¨å質ãä¿è¨¼ã§ããªã
- ä¸æ´åãªé¨åãçºè¦ããæ段ãæä¾ããã¦ãªããã¨ãå¤ã
åã®å ´åã¯ãåçåä»ãè¨èªã®æ¬ ç¹ã®æ¹ã大ããã®ã§ãéçåä»ãè¨èª Haskell ã使ã£ã¦ããã
ãã¾ã
åçåä»ãè¨èªã®ããã°ã©ããç¥ããªããããããªãä¸çã¨ãã¦ãéçåä»ãé¢æ°åè¨èªã§ã¯ãåãå®è£ ãå°ãã¦ããããã¨ãããã¨ãæãããããããç¥ããªãã®ã§ããã°ãå®éã«ä½é¨ãã¦ã¿ãã¨éçåä»ãè¨èªã«å¯¾ãã¦ã®å°è±¡ãå¤ãããããããªãã