観å¯æ¥è¨ 2010-10-04
éçåã¨åçå
éçåã¨åçåãã¾ãã¾ãããè¨èªã»ãã
Common Lisp?
ãã£ã¨ã¾ã¨ããªè¨èªã§
syntax 㯠Ruby ã§ãã
欲ãããã°ä¸é¨ Scala ã§
ScalaãCã§æ¸ãã°è§£æ±ºï¼
Scala ã¯åçåãå ¨ç¶ãªããããã¡
ãã¨å人çãªè¶£å³ã ãã©ãã¼ã¹ã¯ Ruby ã® syntax ã®æ¹ããã
Cã§ããããvoid *ã§ãããã°ããã
å¤ã«åã¯æ¬²ããã§ãâ¦â¦
def foo(a as Fixnum, b as String) as NilClass
ãããªæãã§ãã
ãããçç¥ãå¯è½
: ã§ããã
ãã¼ã¯ã¼ãå¼æ°ã§æ³£ããã©
CommonLisp ã ã¨åã¯ç²ç®çã«ä¿¡ãã
Scalaã ã¨ï¼å ¨é¨æ¸ããªãã¨ãããªãããï¼æ¨è«ã§ããã¨ãã以å¤ï¼åæ¤æ»ãåºæ¥ã
ã©ã£ã¡ãè¯ãï¼
åãæ¸ãã¦ããã¨ããã ãåæ¨è«ããã®ãæµè¡ãã§ã
soft-typing 以æ¥ã»ãã¼ãã¨ç¶ãã¦ã話ã ãã©
ãã®ã¢ããã¼ãã§ã¾ã¨ããªè¨èªã£ã¦ã©ãã ã£ã
åæ¤æ»ã¯å«ããªãã®ããª
éçåä»ãããã¦ãã¨ããã¯éçã«åæ¤æ»ãã¦åçã«ã¯ããªã
ããã¦ãªãã¨ããã¯åçã«åæ¤æ»ãã
Scala ã£ã¦ããã ã£ãï¼
Scala ã¯å ¨é¨éç
ã ããå¤åã¼ãã«ã¯ä½¿ããªã
åçã«ãã¦ãã¨ãããããï¼ã¨æ°´å³¶åã«èãããããªãã¢ãããã©
é¨åçæ¤æ»ã許ãè¨èªã£ã¦ãã£ãã£ãï¼
ããã¯ã¼ããç¥ããªãããå¥ã®è©±ã ããã
ç§ãç¥ããªãã®ã§
ç 究ã§ã¯ã¡ããã¡ãã
æé©åã®ããã«ï¼æ¤æ»çµæã使ãã£ã¦ã®ã¯ãã¡ããããããã©
ã½ããã¿ã¤ãã³ã°ã£ã¦ï¼ããããã¨ãã以å¤ã§ä½¿ã£ã¦ãã®ã¯ããã®ããª
Self ã®ãã®ç 究ãï¼é«éåãç®çãããªãã£ãã£ã
ã½ããã¿ã¤ãã³ã°ã¯ãè¨èªè¨è¿°èªä½ã¯å ¨é¨åçåä»ãã§ããã
確ãã«
é¨åçã«ã¯åã¢ããã¼ã·ã§ã³ãæ¸ããã
æé©åãã¦ã»ããã¨ããã§ã¯ããã使ã£ã¦æé©åãã¦ã»ããã
åã¢ããã¼ã·ã§ã³ã¯ï¼èª°ã®ããã«ãããã ãã
åæ¸ããã»ããã³ã¼ããæ¸ããããã¨ãããå¤ã
ã§ãå ¨é¨æ¸ãã¨è¨ãããã¨è¾ã
ã¢ããã¼ã·ã§ã³ã¯ï¼ç²ç®çã«ä¿¡ãã¦ã»ããï¼ã£ã¦ãã¨ï¼
ããã¨ãï¼ã¢ããã¼ã·ã§ã³ãæ¤æ»ãã¦ã»ããï¼ã¨
åä»ãããã¦ãªãã³ã¼ãããã¢ããã¼ã·ã§ã³ãæ¸ãããé¢æ°ãå¼ã³åºãã¨ãã«
ã©ãããå ´åã ãããª
åçåãã§ãã¯ãã¦ãããã°
ããã¯åçæ¤æ»ãå ¥ããã
ã¢ããã¼ã·ã§ã³ãæ¸ãããã³ã¼ãå ã§ã¯åçæ¤æ»ãªãã§ããã
ããã¯æ¤æ»ã§ããããï¼ã¨
åºæ¬çã«ã¯å ¥ãå£ã¨åºå£ã ããã§ãã¯ããã°ãã
çµå±ï¼ã»ã¨ãã©åçåã«ãªããªãããªï¼
ããããªããã©
éçåä»ãé¢æ°ããéçåä»ãé¢æ°ãå¼ã³åºãã¨ããã§ã¯åçæ¤æ»ããªãã§ã
ããã¯ããããã ãã©
ããã°ã©ã ã®ããã«ããã¯ã«ãªãã¨è¨ããã 10% ã®é¨åã ãåæ¸ãã
å®ã¯ï¼ããããããã¨ããã¯ã»ã¨ãã©ç¡ãããããªãã ãããï¼ã¿ãããª
ã©ãã§ããããã
å¥ã«å ¨é¨åæ¸ãã¦ããããã§ãã
ãããã¿ã¤ãæããåæ¸ãã®ã¯è¾ããã§ãã
åçåã§ãããã¿ã¤ãä½ã£ã¦
åãããåã¢ããã¼ã·ã§ã³å ¨é¨æ¸ã
ãã
ã¾ãã§ããã®è©±ã£ã¦open class ã¿ããã«ã¡ã½ãããåç追å ã¨ãåé¤ã¨ãã§ãããããªè¨èªã ã¨é£ããããªãã ããª
é£ãããã¨ããããããã¾ãé«éåããªã
åã¯ãã¯ã©ã¹ããªã®ã ããã
ãªãã§ãããããã
C++ ã® vtable ã£ã¦ã©ããã£ã¦å®è£ ããã¦ããã ãã
ä¾ãã°
nil or String ãªãã¦ã®ã¯ã©ãæ¸ãã®ããª
nil or String or Array or Hash
Option
ããããã®ãåãä»ããã³ã¼ãã¯æ¸ããªã
ã¨ã«ãã each å¼ã¹ã人éå®ï¼ã¿ãããª
nil or string ã ã㯠Option
ãã¼ã¿ãå ¥ã£ã¦ãããã¾ã£ãããªãã
ããã¯ãªããç¾ãããªããããªâ¦
ã¿ããªã使ãæ±ç¨çãªã©ã¤ãã©ãªã¨ãã ã¨éçåã«ã¯ããªãã§ãããã
ã¤ãï¼ããã¾ã
ã¨èããã¨ããã£ã±ã大ãã¦å¬ãããªãã®ããª
ã¾ãæ±ç¨çãªãããç¾ããã§ããã¨ã¯ãããã¯ä¿¡ãã¦ãªããã ãã©
ä»ã® Ruby ã«ã¯åãå ¥ãããããã«ãªãæ°ããã
ãããã¡ããä»ã® Ruby ã¨ã¯é¢ä¿ãªãå¦æ³ã§ãã
ã»ããã®ã¯æ§è½ãããªãã¦æ¤æ»ãªãã ããï¼
ããã¨ãæ§è½ï¼
ã©ã£ã¡ã
æ¤æ»ã£ã¦è¨ã£ã¦ãã®ã¯éçåãã§ãã¯ã®ãã¨ã§ããã
ãã
å®è¡åã«
ãã
é¨åçã«ã¯æ¬²ãã
ãã®æã®éçåã¨åçåãã¾ããç 究ã£ã¦æããããã¦ããã©ãç 究ã¬ãã«ãè¶ ããã®ãåºã¦ããªãã®ã¯éè¦ããªããããªã®ããªã¼
ç 究ã¬ãã«ã§ãï¼ãåæ¤æ»ã®ããã«ãã£ã¦äººã¯ãããã ã£ã
PLDI ã¨ãã®è«æã®ã¯ï¼ããã«ç¸å½ããã®ããªã¼
åãåºãã¨ããã¦ãã人ãå¤ãæ°ããããã©
PLDI ã¯ããã¨å®è£ ç³»ã ãã
ã§ãåã使ã£ã¦ã¬ã¼ã¹æ¤åºã¨ããã£ãã
ã¾ãrubyã¯ãã¤ãããã¨ã©ããããã®ãã©ã³ã¹ã®å¦ã£ã¦ã¨ãã ãããªã
ç¾ããã¨ãã¯ããã¨ã©ãã§ã
è¨èªå±ãããæ°å¦å±ããã®æ±ããç¾ããã追æ±ãã¦ãã£ãã
ããããã©ã¤ãã¦ã¼ã¶ã¼ã¯ãã¶ããã¤ãããªãããããªãããªã
ç¾çæ°´æºãã©ãã«ç½®ããã
ä»ã®è¨èªãç¾ãããªããããã ã
éçåã¨ãæ°ã«ããªãã§å®å ¨ã«åçåä»ãè¨èªã¨ãã¦ã使ããã¨ããã§ãã
CommonLispã«åæ¤æ»æ©è½ãè¨ããã°ããã®ã
ã¨ãããï¼ããããããããªããï¼ã¨ããæ°ãããã
ä»æ¥ã®F#ã¹ã¬ã¯ããã§ãã
syntax ãããå¾ãªãã®ã§ãã¡
Ruby -> CL ã¯çµæ§ç°¡åã«ããããã ã
Lisp ã®ã«ãã³ã®ä½ããããªãã£ã¦
è¤æ°è¡ã«ã¾ãããã«ãã³ã¨åä¸è¡ã®ã«ãã³ãåãã«ãã³ã§æ¸ããã¨ã ã¨æã
begin .. end ã許ãããæ¡å¤èªããããã¦
]
(ä¸æã«èªããªããªã
Python ã¿ããã«ã¤ã³ãã³ãã使ããã¯èª°ãããã£ã¦ãæ°ããããª
ã¡ãªã¿ã« OCaml ã®ææ³ã¯ä¸äººãã¯ã½ã ã¨èªãã¾ã
ã®ã§ F# ãã ã
ãããªãã
ã§ãææ³ã綺éºãªè¨èªã£ã¦æ¸ãåºãã¨ç´°ããè¨æ³ã«ãã ãã£ã¦ãã¾ã£ã¦ãªããªãçç£æ§ãä¸ãããªã
C ã¨ã OCaml ã¨ãã ã¨è¨æ³ã¯æåãã諦ãã¦ãã®ã§ç´°ãããã¨ãã ãããã«ã©ãã©ãæ¸ãã
å¼±ã£ããã¨ã
ã¯ã£ããè¨ã£ã¦ Ruby ã§å¤§ãããã®æ¸ãããã¨ãªããã ãª
æ大㧠concov ã® 5000 è¡
ã©ãã©ãæ¸ããããªãçç£æ§ããããããï¼
OCaml ã ã¨æ°æ¥ã§ JavaVM æ¸ãã¾ãããããã
ã§ãããã ãã㯠Ruby ã§æ°æ¥ã§æ¸ãã¦ãæ°ããã