2010-04-01ãã1ã¶æéã®è¨äºä¸è¦§
[追è¨]解ãããæ§ã§ãhttp://twitter.com/kinaba/status/13109925805 http://twitter.com/kinaba/status/13109851142ã§æ±å¤§ã®æ å ±çå·¥å¦ç³»ç 究ç§ã®ãã¹ã¿ã¼ã®ä¸ã« ãããæ å ±ç§å¦ã®çé«ã¨ããããããªæååã http://twitter.com/hagiya/status/9520249396 â¦
ãã®ããã°ã«ã¯æ¸ãã¦ããªãã£ããã©å®ã¯ç§ã¯æ°å©ãªã®ã§ãã ä»æ¥ã¯çµå©æ輪ãã§ãããã£ãã®ã§åç©é¤¨ã®å¾ã«åãåãã«è¡ãã¾ãããå ¥ç±ããï¼é±éé ããªã£ã¦ãã¾ãã¾ããã
å¹´ã«ä¸åº¦ã®[ã¤ãã³ã]æ°å®¿å館 ãªã¼ãã³ã©ããåç©é¤¨ã®è£å´ãï¼2010, å½ç«ç§å¦åç©é¤¨æ°å®¿å館ï¼ã«è¡ã£ã¦ãã¾ããã å®ãè¨ãã¨ä¸éæ¬é¤¨ã¨ä½µãã¦å½ç«ç§å¦åç©é¤¨ã«è¡ãã®ã¯ï¼é±éé£ç¶ã ã£ãããã¾ãã ç»åãä¸é¨è¼ãã¾ãã軽ãã®ã°ãç»åãããã®ã§æ³¨æã æ°â¦
fortranã³ã³ãã¤ã©ãä½ããªãããªããªãã®ã§åå¼·éå§ãã¾ãã¯Hello World write(*,*) 'Hello World' end å¿ ãé ã«6ã¤ã¹ãã¼ã¹ãå ¥ãã ã³ã³ãã¤ã« % gfortran hello.f -o hello å®è¡ % ./hello Hello World ä¸è¦ãã¾ãåããããã«è¦ãããHello Worldã®å é â¦
ç¾å¨ã®ç°¡ä¾¿ãªã¬ã¸ã¹ã¿å²ãå½ã¦ã ã¨ãè¤éãªé¢æ°ã§ã¬ã¸ã¹ã¿ã足ããªããªã£ã¦å¤±æãã¦ãã¾ããååæãã¨ãã«æãåºãã®ã¯æ³¥æ²¼åããå±éºãããã®ã§ãrowl1ã§ã¯ã¹ã¿ãã¯ãã¼ã¹ã®å®è¡æ¹æ³ã«ãããã¨ã«ããã
以ä¸ã®ã³ã¼ããåãããã«ãªã£ãï¼ import stdlib; make_counter: (n) { return () { return n++; } }; export main: () { counter : make_counter(1); x : counter() + counter() + counter(); sys_exit(x); (% -> 6 %) }; å®è£ ã¯é常ã«è¾ãã£ããã¾ã ç¸äºâ¦
ãããªæãã®ã³ã¼ããå®è¡åºæ¥ãæ§ã«ãªã£ãã import stdlib; fib: (n) { if (n) { return n * fib(n-1); }; return 1; }; export main: () { exit(fib(3)); }; if(n)ã®é¨åã¯ã¾ã æ¯è¼æ¼ç®åãå®è£ ãã¦ããªãçºã ã³ã³ãã¤ã«ãã㨠_fib.LT1ii: pushl %ebp mâ¦
ä¾å¤ãexitãªã©ã®é¢æ°ã®åãã©ãæ±ãã°è¯ããå°ã£ããOCamlã 㨠val exit : int -> 'a Haskellã 㨠exitWith :: ExitCode -> IO a ã¿ããã«å¤ç¸åãè¿ãã¦ä»»æã®åã¨åä¸åã§ããããã«ããã®ãæ®éã®ããã ãã©ãrowlã¯returnã§å¤ãè¿ãã®ã§ãããã§ããªãâ¦
export/import/external宣è¨ãå®è£ ããï¼ (% test.rl %) export type hoge : A | B (int) ; export plus: (x, y) { return x + y; }; ã¿ãããªã³ã¼ããã³ã³ãã¤ã«ããã¨ããããã¡ã¤ã«ãèªåçæãããï¼ (% test.rli generated by rlc1 %) type hoge : A | â¦
ãããªæãã§ã type test : A | B (int) | C (char, int) ; export main: () { x : A; y : B (2); z : C ('a', 0); syscall(1, 0); }; ãã¿ã¼ã³ãããã¯ã¾ã å®è£ ãã¦ããªããã¨ãããå®ã¯ã¾ã ifæããæªå®è£ ã Cã®unionã¿ããã«ãµã¤ãºãæ大ã§ããCã«åããâ¦
ãã®ã¥ããå± MONODZUKURI EXHIBITIONãä»æ¥ã¾ã§ã ã¨ããã®ã§è¡ã£ã¦ããã é¢ç½ãã£ããRubyãå±ç¤ºããã¦ãããã©NaClã®ãã³ãã¨30ç§ä½ã®åç»ã®ã¿ã ã£ããã¡ãã£ã¨å°å³ã ã£ããä¹ ãã¶ãã«ç§åè¡ã£ããã§ä¸éãåã£ã¦ãããã©ããã£ã±ãè¨ç®æ©ã®å±ç¤ºã¯ãã¾ãâ¦
以ä¸ã®æ§ãªã³ã¼ããã³ã³ãã¤ã«ã§ããããã«ãªã£ããå³è¾ºå¤ã¨ãã¦ã®ä¸é¨ã ãå®è£ ã f: () { return (x:1, y:2); }; export main: () { p : f(); syscall(1, p.x + p.y); }; ã¯ãã¼ã¸ã£ãå®è£ ããã°ãªãã¸ã§ã¯ãæåã£ã½ãã³ã¼ããæ¸ããããã«ãªãã
ã¾ã ããåãã£ã¦ãªããã©ç»é²ãã¦ã¿ãã http://twitter.com/9_ties
é£èªãã¦ãããã§ããåå®å ¨ãªhashtableãªã©ãå®è£ ããæã«ã¯å¤ç¸é¢æ°ããã£ãæ¹ãè¯ãã¨æãã å®è£ æ¹æ³ã¯template instansiationã¨dictionary passingã®æ··åãã¡ã³ãããããã©ãéããã¯ã¹ååãæ±ãrowlã§ã¯ä»æ¹ããªãã
ãããªæãã®ãµã³ãã«ã³ã¼ããã³ã³ãã¤ã«åºæ¥ãããã«ãªã£ããdictionary passingã¸ã®å¸ç³ã plus: (a, b) { return a + b; }; f: () { return plus; }; export main: () { g : f(); syscall(1, g(1, 2)); };ã¡ããã¨åå®å ¨ã§ãã syscall(1, g(1));ã¨ãæ¸ãâ¦