3å¹´ã¶ãã«æ´æ°ãã¾ãããã®ï¼å¹´éã«ã(éä¸1年以ä¸å¥ã®äºããã£ã¦ãã¾ããã)èªä½ã®è¨èªã¨ãã®å¦çç³»ã®éçºã¯ç¶ãã¦ãã¾ãããããããç´¹ä»è¨äºãæ¸ãå§ãããã¨æãã¾ãããã¼ã ãã¼ã¸ã¯æ¢ã«ããã¾ããããã¡ãã¯æ¨å¹´ã®å¤ããæ´æ°ãã¦ããªãã®ã§å 容ãå¤ãâ¦
ç¾å¨2ã«æã®çææ»å¨ç 究ã§ã¢ã¡ãªã«ã«æ¥ã¦ãã¾ããä¸äººã§ã®æµ·å¤æ»å¨ã¯åãã¦ã§ãã ãã¦ããã®æ»å¨åæ¥ããè²´éãªçµé¨ãããã®ã§è¨é²ãæ®ãã¦ããã¾ãã æ¥æ¬ã§ããã¥ã¼ã¹ã«ãªã£ããããã·ã«ã´ã®ããªã¶ã¼ã(ã¹ãã¼ãã²ãã³)ã«æã¾ãã¾ããã (Chicago Tribunâ¦
以ä¸ã®è¨äºã§PythonãRubyã®æ«å°¾å帰é¢æ°ãã«ã¼ãã«å¤æããææ³ããæ«å°¾å帰æé©åãããæ«å°¾å¼ã³åºãæé©åãã¨ãã¦ç´¹ä»ããã¦ããã®ã§ããããããã®ç¨èªã使ãã®ã¯ééãã§ãã ç´¹ä»ããã¦ããææ³(åçæç¸ãå©ç¨ãã¦å¶å¾¡ããã¼ãå¤å½¢ããææ³)èªä½ã¯å¤§â¦
ä»æ¥ã¯80ã¾ã§ããã®ã¨ãããæ°å¦ã使ãåé¡ã沢山ã§é¢ç½ãã§ããã ãã¿ã´ã©ã¹æ°ã¨ããã³ããæ¨ Problem75 ç°¡åã«ã¯ 1,500,000以ä¸ã®L㧠a^2 + b^2 = c^2 ã㤠a + b + c = L ãæºããèªç¶æ°a,b,cã®çµãã¡ããã©ä¸çµã¨ãªããããªLã®åæ°ãæ±ãã ã¨ããåé¡â¦
ä¹ ã ã«Project Eulerããã¾ãããã¾ã rowlã¯ä½¿ãã段éã«ãªãã®ã§ãRubyã¤ãã£ã¦ã¾ãã ãã®ãããããæ°è«ã®åé¡ãããããåºã¦ãã¦é¢ç½ãã£ãã§ãã ãºã«æ¹ç¨å¼(Problem 66) ç°¡åã«ã¯ Dãå¹³æ¹æ°ã§ãªãæ´æ°ã®æ x^2 - Dy^2 = 1 ã®æ´æ°è§£ãæ±ãã ã¨ããåé¡â¦
1å¹´åã®ä»æ¥ãã¢ã»ã³ããªã§æ°åè¡ã®echoããã°ã©ã ãä½æãã¾ããã ãããå¾ã ã«è²ã¦ã¦ãä»æ¥ã§ã¯ã½ã¼ã¹ã³ã¼ãè¡æ°ããã¼ã¿ã«ã§1ä¸5åè¡ãè¶ ãã¦ãã¾ããã ï¼å¹´ã§ãã£ãããã ããã¨ããæ°ãããªãããªãã§ããã趣å³ããã°ã©ã ã«ãã¦ã¯ãããªãã«é²ãã ã®â¦
50åç®ã¾ã§è§£ãã¾ãããæ°å¦ã使ã£ã¦å·¥å¤«ããã¨éã解ããããããããªãã®ã«ã¤ãã¦ã ãèªåã®è§£çãæ¸ãã¾ãã Problem 15 20x20ã®ã°ãªããã®å·¦ä¸ããå³ä¸ã¾ã§ã®æççµè·¯æ°ãæ±ãã ããã¯ï¼é ä¿æ°ã ã®å¤ãè¨ç®ããã°è¯ãã§ããï¼é ä¿æ°ã®å¤ã¯ãã¹ã«ã«ã®ä¸â¦
8åã¨ãã¾ããã Problem 3 600851475143ã®æå¤§ç´ å æ°ãæ±ãã ãç´ å æ°å解ãããã§ã¯ãªããæå¤§ç´ å æ°ã ãæ±ãããã§ãããç´ æ°ã®ãã¼ãã«ã¯ä½ããããªãã®ã§ãå復ã«ããæ±ããäºãèãã¾ãã æ´æ°Nãç´ å æ°å解ãã¦ã¿ã㨠ã¨ãªãã¾ãããããã®æå°ã®ç´ â¦
ããã¯ããªãã®è¯éã§ã¯ãªãã§ããããã ç´æ°ã®æ°ã500以ä¸ã«ãªãæåã®ä¸è§æ°ãæ±ããä¸è§æ°ã¨ã¯ä»¥ä¸ã®å¼ã§æ¸ãããã®ã§ãã Nã®ç´ å æ°å解ãä¸ã®ããã«ãªãæ ç´æ°ã®åæ°ã¯ ã¨ãªãã¾ããã¾ããäºãã«ç´ ãª2æ°ã¯ææ°ãéè¤ããªãã§ãããã nãå¥æ°ãªã ã§â¦
Project Euler解ãå§ãã¾ãããèªåã®æ°å¦ã®åå¼·ãå ¼ãã¦ãã§ããã ãããã°ã©ã ã§ã®åæã®è¨ç®ã¯é¿ãããã¨æã£ã¦ãã¾ããã©ããã¦ãããã°ã©ãã³ã°ãå¿ è¦ãªãã¤ã¯ããã¨ã§rowlã§æ¸ããã¨æã£ã¦ã¾ãã Problem 1 1000æªæºã®3ã¾ãã¯5ã®åæ°ã®åãæ±ãã éåâ¦
nåã®å¯¾å¿ããæ¬å¼§ã®ãã¿ã¼ã³ã®æ°ãæ¯é¢æ°ã使ã£ã¦æ±ãã¦ã¿ã¾ããã ããã¯id:nobsunãããææãªãã£ã¦ããããã«ã«ã¿ã©ã³æ°ã¨ããæ°ã«ãªããã§ãããããããåæç¥èãªãã§æ©æ¢°çã«è§£ããããããªå ´åã«ä½¿ãã¾ãã ããããªæç§æ¸ãããã¨æãã¾ãããç§â¦
rowlã®å¼ã¨ãã¦ä»¥ä¸ã®å®ç¾©ã使ãæ¹éã«ãã¾ããããã®çºãããããã¨å®è£ ã®ä¿®æ£ãè¡ã£ã¦ãã¾ãã åå§å¼(ã·ã³ãã«ï¼æ´æ°ãªãã©ã«ï¼æµ®åå°æ°ç¹æ°ãªãã©ã«ï¼æåå)ã¯å¼ã§ããã hãã·ã³ãã«ï¼e1,...,enãå¼ã®æ h(e1, .., en)ã¯å¼ã§ãããhãå¼ã®headã¨è¨ããâ¦
åã§ã®ãããã³ã°ã®å®è£ ãä¸é¨å®è£ ãã¾ããã ããã«ãã£ã¦é¢æ°ã®ãªã¼ãã¼ãã¼ããåºæ¥ãããã«ãªãã¾ããâ print(10) # print_intãå¼ã°ãã print("Hello World") # print_stringãå¼ã°ããé¢æ°å®ç¾©æã«ã¯ãããªæãã§æ¸ãã¾ãâ fib(n!Int): fib(n-1) + fiâ¦
Haskellã«å¯ä½ç¨ãããã®ãï¼ã¨ããã®ã¯é£ãããã¼ãã ã¨æãã¾ãããå°ãªãã¨ãæé©åçè«ã§ã®ä¸è¬çãªãå¯ä½ç¨ãã®å®ç¾©ã§ã¯Haskellã¯å ¨ãå¯ä½ç¨ããªãè¨èªã¨è¨ããã¨æãã¾ãã çè«çã«ç¾ããã¨ããç¹ãHaskellã®è¨è¨ã®ä¸çªéè¦ãªã¨ããã ã¨æãã®ã§ããâ¦
Rowlã®åçãªãã¿ã¼ã³ãããã¨ã³ã¸ã³ã®æ§æã«ã¤ãã¦æ¸ãã¾ãã ã¾ããã¤ã³ã¿ããªã¿å ã«funtableã¨ããé¢æ°ãã¼ãã«(é¢æ°å à å¼æ°ã®æ° â é¢æ°å®ä½)ãããã¾ãã é¢æ°ã®å®ä½ã¯ é¢æ°æ¬ä½(ãã¤ãã³ã¼ã) é¢æ°å®ç¾©ã®ãªã¹ã(ASTã§ã¯ãªãã³ã³ãã¤ã«ããå½¢) ãããªâ¦
以ä¸ã®è¨äºã®ããããã¯ãã¼ã«ã«ã§é¢æ°å®ç¾©ãåå®ç¾©ã§ãããã¨ããä»çµã¿ã«ã¯åé¡ãããã¾ããã®ã§ããããã¨ã«ãã¾ããã ä½ãå¥ã®å½¢ã§çç¾ãªãåæ§ã®æ©è½ã使ããããã«ãããã¨æãã¾ãã fib(n): fib(n-1) + fib(n-2) fib(0): 0 fib(1): 1 print_int(fibâ¦
èªåã¯ã³ã³ãã¤ã©ã®å®è£ è¨èªã«ã¯ãã¿ã¼ã³ããããããã¨æ¥½ã ã¨æã£ã¦ããã®ã§rowlã«ããã¿ã¼ã³ãããã¨ã³ã¸ã³ãå®è£ ãã¦ãã¾ãã以ä¸ã®è«æãåèã«ãã¦ãã¾ãã http://portal.acm.org/citation.cfm?id=507641&dl= ããã¾ã§å¤æ°ãã¿ã¼ã³ãDontcareãã¿ã¼ã³â¦
ã¨ã¯ãã£ã¦ãx86ã®æ©æ¢°èªãçæããã®ã§ã¯ãªããVMã®ãã¤ãã³ã¼ããçæãããã¤ãä½ãã¾ãããx86ã®JITã¢ã»ã³ãã©ã¯æ¬¡ã®ä¸ä»£ã§ä½ãäºå®ã§ãã ãã®JITã¢ã»ã³ãã©ã¯ç¾å¨å®è£ ä¸ã®ã¤ã³ã¿ããªã¿ã«å èµããJITã³ã³ãã¤ã©ã§ç¨ãã¾ãã 以ä¸ã¯ãã£ãããããè¨ç®ãâ¦
ãªã³ã«ãåé¡ãªãåãããã«ãªã£ãã®ã§ããããã次ã®å¦çç³»(rowl1)ä½ããéå§ãã¾ããã ã¬ããµã¯ããã¾ã§ã¨åããç¶æ é·ç§»å³ãæã§ä½æãã¾ãããrowl2ã®éçºæã«ã¯ã¬ããµã®èªåçæãåºæ¥ãããããè¨èªãé«ç´ã«ãªã£ã¦ããã¨è¯ããªãã¨æã£ã¦ãã¾ããç¾å¨â¦
ä¸ãæã»ã©æ¬æ¥ã«å°å¿µãã¦ãã¾ããããRowlã®éçºãåéãã¾ããã çµæ§å¿ãã¦ããã¨ãããããã®ã§ãããã¾ã§ã®çµéãã¾ã¨ãã¾ããããã¾ã§å®è£ ãããã®ã®ä¸è¦§ã¯ä¸å³ã åé¡1: æ©è½ä¸è¶³ ã¢ã»ã³ããªè¨èªã§å®è£ ããrowl0ã¯æ©è½ã貧弱ããã¦ã次ã®ã¹ãããã§ä¸â¦
ãã³ããã¼ã¯ç¨éãç®çã¨ãã¦Rubyã§æ¸ããã¬ã¤ãã¬ã¼ãµã¼ãå ¬éãã¾ããhttp://github.com/nineties/raytracer以ä¸ãPart3ã¾ã§å®è£ ãããã®ã§ãã http://www.devmaster.net/articles/raytracing_series/part1.phpPPMå½¢å¼ã®ç»åãçæããã®ã§é©å½ã«å¤æãâ¦
ã³ã³ãã¤ã©ã®å®è£ è¨èªã«ããã¨è¯ãæ©è½ã§Javaã§AST(æ½è±¡æ§ææ¨)ä½ãã®ã大å¤ã ã¨ãã話ã«è§¦ããã®ã ããã©ããå®ã¯èªåã®ç¥ããªãè¯ãããæ¹ãããã®ã§ã¯ãªããã¨æã£ã¦Clojureãªã©Javaã§å®è£ ãããå¦çç³»ã®ã½ã¼ã¹ãè¦ãã¦ã¿ã¾ããã çµè«ï¼ãã£ã±ã大å¤ã Câ¦
Så¼ããbrainfuckã®ã³ã¼ããèªåçæããããã°ã©ã ãæ¸ãã¦ã¿ã¾ããã ã³ã¼ãçæãç®çã§ã¯ãªãã¦åã«ã§ããã ãããã¨æ°ã«ãªã£ãã®ã§ãã£ã¦ã¿ã¾ãããgaucheã使ãã¾ããã brainfuck ã¤ã³ã¿ããªã¿ãã¹ã¿ãã¯ãã·ã³ã£ã½ã使ã£ã¦åä½ãã¾ãã å¤æ°ã使ããâ¦
ç´ç²é¢æ°åè¨èªã®å¦çç³»ãä½ã£ã¦ã¿ããã¨ã«ãã (ãã®3 : Mark-1 G-machine)ã®ç¶ããæç§æ¸P94-P97ã¾ã§ã http://github.com/nineties/puref/commit/4cd5d92a5f02468929bc2dd2ddafbd363251c86cMark-2 G-machineã§ã¯é 延è©ä¾¡ãè¡ãçºã®æºåã¨ãã¦ãUpdate/Popâ¦
ç´ç²é¢æ°åè¨èªã®å¦çç³»ãä½ã£ã¦ã¿ããã¨ã«ãã (ãã®2)ã®ç¶ãã ä»æ¥ã¯æç§æ¸ã®ç¬¬3ç« P75-P94(Mark1: A MINIMAL G-MACHINE)ã®å®è£ ããã¾ããã ç¾ç¶ã§ã¯é¢æ°é©ç¨ããã§ãã¾ãããé 延è©ä¾¡ã¯ã¾ã æ±ã£ã¦ããªãã¦ã次åMark2ã§æ±ããã¨ã«ãªãã¨æãã¾ãã ãã â¦
ãããªã®ãè¦ã¤ããã®ã ãã© http://code.google.com/p/brainfuckos/ ä¸ã空ã£ã½ã§ãã£ããããã®ã§ãèªåã§ä½ãä½ã£ã¦ã¿ãããã¨æã£ãã ã¯ã£ããè¨ã£ã¦ããã©ãããããã®ã§ç¶ãã¯ããã¾ãããããããªã®ä½ã£ã¦ã¿ã¾ããã .code16 .equ SCREEN, 0xb800 .eâ¦
ãã¡ã¤ã«å ¥åºåã¨ãå¯å¤é·é åã¨ãrowlVMã®ããªããã£ããå å®ãã¦ããã®ã§ãç¾å¨ã¯rowl-coreè¨èªã§æ¬¡ærowl1ã³ã³ãã¤ã©ã®å®è£ ããã¦ãã¾ãã ã¨ããããã¡ã¢ãªããã¼ã¸ã£ã®ãªãã¹ã¯ãªããè¨èªã§ããrowl-coreã¯å¤§éã«ã¡ã¢ãªãæ¶è²»ããçºã¤ãã«éçããã¾ãâ¦
ç´ç²é¢æ°åè¨èªã®å¦çç³»ãä½ã£ã¦ã¿ããã¨ã«ããã®ç¶ãã å é±æ«ã¯ã¡ãã£ã¨å¿ããã£ãã®ã§æ¯é±æ¥ææ¥ã®äºå®ãããã¦ãã¾ãã¾ããã ä»æ¥ã¯Pretty Printerãä½ãã¾ãããG-machineã¯æ¬¡åã«åãã¾ãã http://github.com/nineties/puref/commit/9295d96e1e0adb7â¦
ã¡ã¢ãªããã¼ã¸ã£ãã¡ããã¨åãã¾ãããGCãä»ã®ã¨ãã大ä¸å¤«ã£ã½ãã§ãã ã¨ãããã¨ã§ãã¨ã©ãã¹ããã¹ã®ç¯©ãå®è£ ãã¦ã¿ã¾ããã次æã³ã³ãã¤ã©å®è£ å°ç¨ã®DSLãªã®ã§å¯èªæ§ãä½ãã®ã¯åå¼ãã¦ãã ããã (fun main () ( (sieve 200000) (exit 0) )) (fun sâ¦
ããã°ã©ãã³ã°è¨èªã®é«ç´åã¯ãã¦ãã¦ããã°ã©ã ãè¤éåãæé©åãé»å®³ãã¦ãã¾ãã¾ãã rowlã®éçºã§ã¯ãã®ãã¬ã¼ããªãã«ã¤ãã¦ç¥çµè³ªã«ãªããã¨æã£ã¦ãã¾ãã æé©åã®åºæ¬ æé©åã«ã¯å½ä»¤æ°åæ¸ã»ä¸¦ååã»ãã¤ãã©ã¤ã³æé©åã»ã¬ã¸ã¹ã¿å²ãå½ã¦ã»ã¹ã±â¦