远跡ããªãã£ã人ã ã®ããã«-2012幎ã®åãã«ããã¯ãããŒæŽ»åã§ãããSelectelã®ããã°ã©ããŒã¯ç±å¿ã«ããã玹ä»ãå§ããŸããã ããããããããããã¹ãŠãã®äœ¿çšæ¹æ³ã«é¢ããã¬ããŒããå ¬éããããšãçŽæããŸããã
åæ¥ãããžã§ã¯ãã®è£œåã¯ããèªåçšãã®å°ããªãµã³ãããã¯ã¹ã§ã¯ãªããã³ã³ãã¥ãŒã¿ãŒãµã€ãšã³ã¹ã®åŠè¡çãªå®éšã§ããããŸããã ããã¯ãå°çãææããããŠæ»ãååšãããå è·¯ç·ãã®ããã®æãŠããªãéäºã§ããããšã«ããããŸãããã¯ãã§ãã XML-RPCã®Int64ã¯æååã§ãšã³ã³ãŒãããïŒXML-RPCã®intã¯int32ã«çœ²åãããããïŒããã¡ã€ã«ããè€æ°ã®èšŒææžãèªã¿åãéã®opensslã¯æåã®èšŒææžã®ã¿ãèªã¿åããboolã§ã¯ã1ããŸãã¯ã0ãã®ãããããæžã蟌ãå¿ èŠããããŸããã -ã2ããããã¯ããã®ããã«ããŠã®ã¿ãšã³ã³ãŒããã3çªç®ã®ã¢ãŒããæãã€ããããã§ã-ãªã©ã ãªã© ãããã®æ¡ä»¶ã§ã¯ãèšèªã®èŠä»¶ã¯ããã®ãšã³ã·ã¹ãã ãã€ã³ãã©ã¹ãã©ã¯ãã£ãå®äžçã«é©å¿ããæºåã®èŠä»¶ã«åŸã ã«çºå±ããŸãã
Haskellã«ã€ããŠã¯ãããã°ã©ããŒã§ã¯ãªãããããã¯ããªãŒããŒããããžã§ã¯ããããŒãžã£ãŒãã·ã¹ãã 管çè ã®èŠ³ç¹ããæžããŸãã ã§ããããã¢ãããä»ããŠã©ãã ãåªé ã«ã»ãã°ã«ãŒãåãäœæã§ãããããããŠåã䜿çšããŠåãä»ããŠåãå°åºããã®ãããã«ã¯ãŒã«ã§ãããã«ã€ããŠãå¿ããã®ç±æãæåŸ ããªãã§ãã ããã
ãããžã§ã¯ããããŒãžã£ãŒã®èŠ³ç¹ããèŠããšãããã°ã©ãã³ã°èšèªã¯ãããã°ã©ãã³ã°èšèªãšã¯å®å šã«ç°ãªãããã€ãã®ã¡ããªãã¯ã䜿çšããŠè©äŸ¡ãããŸãã ããã°ã©ããŒã«ãšã£ãŠãèšèªãšãã®æ©èœã¯ããããæãéèŠãªãã®ã§ãããªããªãã圌ã¯ã»ãšãã©ã®æéãè²»ãããŠããããã§ãã ããŒã ã®æ®ãã®éšåã§ã¯ããœãŒã¹ã®å€ã§äœãèµ·ãã£ãŠããããã¯ããã«éèŠã§ãã ãŸããã©ã€ãã©ãªãšé©åãªãã¯ãããžãŒãæ€çŽ¢ãã次ã«ã¡ã³ããã³ã¹ãç£èŠãå®è£ ããããã°ã®ã¿ã¹ã¯ãæ€çŽ¢ããŸãã
æ¶è²»è ã®ããããã£ããå§ããŸãããã
ããã°ã©ã å®è¡é床
Haskellããã°ã©ã ã¯ãpythonãphpãrubyïŒããã³ãã®ä»ã®ã€ã³ã¿ããªã¿èšèªïŒãããé«éã§ãã Erlang / JavaïŒããã³ãã®ä»ã®vmããŒã¹ã®èšèªïŒãããé«éã§ãã Haskellã³ã³ãã€ã©ãŒãCã³ã³ãã€ã©ãŒã®çµæãããåªããçµæãçæããããã€ãã®ã±ãŒã¹ãèŠãŠããŸããããéåžžã¯Cããé ãã§ãã
Haskellããã©ãŒãã³ã¹ã®ãã¹ãŠã®å®çšçãªã¢ããªã±ãŒã·ã§ã³-ç®ã®åŸããšè³ã®åŸãã
PythonïŒããããåŸã ã«ç§»è¡ããŸããïŒãšæ¯èŒããäž»ãªå©ç¹ã¯ãå®è¡ã®åªãã䞊åæ§ã§ãã GILã¯ãªãããã¯ãŒã«ãŒéã®å€éšãã©ã³ãµãŒããããããã°ãã³ãã®åé¡ããããŸããã
Haskellã«ã¯ãã«ã¿ã€ã ã®ã°ãªãŒã³ã¬ãããããããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®ã¹ã¬ããããã€ãã£ãã«äœ¿çšããŠããŸãã
å®è¡å¯èœãã¡ã€ã«ãµã€ãº
ã»ãšãã©ã®å Žåãæ°ã«ããŸããããäžéšã®å Žæã®æ§æã§ã¯æ··éããŠããã22MBã®å®è¡å¯èœãã¡ã€ã«ã®æå°ãµã€ãºã¯è¿·æã§ããã ãcrå±ãªå Žæãã解決ããããšããµã€ãºã¯å ·äœçãªåœ¹å²ãæãããªããªããŸããã ç§ãã¡ã®æ倧ã®ãµãŒããŒã¯44MBãå æãã3ããŒã¹ã«åçã«ãªã³ã¯ããŠããŸãã
ã¡ã¢ãªäœ¿çšé
ïŒãã®ã»ã¯ã·ã§ã³ã§ã¯ãããªãœãŒã¹ããã€ãŸããRESåã«å¯Ÿå¿ããäžéšã®ã³ãŒãã§ã¯ãªããããŒã¿ãä¿åãããã¡ã¢ãªã«ã€ããŠèª¬æããŠããŸãïŒã
ã³ã³ãã¥ãŒã¿ãŒã¢ã«ãŽãªãºã ã§ã¯ãéåžžã䜿çšãããã¡ã¢ãªã¯Oè¡šèšã§èšç®ãããŸãããéèŠãªèŠå ããããŸã-ããã»ã¹ãå€ãããããããOïŒ1ïŒã§ããå ŽåããµãŒããŒäžã§æ¶è²»ãããã¡ã¢ãªéã¯ã©ããããã§ããïŒ ãããã®åãããã¬ããã¢ã³å®æ°ãã¯ãçªç¶åœ¹å²ãæããããã«ãªããŸãã
Haskellã¯ãPythonããã°ã©ã ã«å¹æµããã¡ã¢ãªã䜿çšããŸãã ããŒã¢ã³ïŒå€§éã®ããŒã¿ãæ ŒçŽããªãéšåïŒã¯ã9ã20ã¡ã¬ãã€ããå æããŸãã PythonããŒã¢ã³ã¯ã»ãŒåãã§ãã
ãã®ãã©ã¡ãŒã¿ãŒã§ã¯ãHaskellã¯OCamlããå°ãå£ã£ãŠããããšïŒãã®ãããæŠéãµãŒãã¹ã¯1ã2ã¡ã¬ãã€ãã®ã¡ã¢ãªã§çããããšãã§ããŸãïŒããããŠãã¡ãããCïŒããšãã°moddã¯0.15MBããæ¶è²»ããŸããïŒãJava / Erlangã®ç¶æ³ãããã¯ããã«åªããŠãããšèšããªããã°ãªããŸããã
å®éã®å®è¡å¯èœãã¡ã€ã«
ã»ãšãã©ã®å± å¿å°ã®è¯ããœãããŠã§ã¢ç°å¢ïŒjvmãpythonãbeam.smpãphpãperlã.netãªã©ïŒã«ã¯ãããªãã®ã€ã³ãã©ã¹ãã©ã¯ãã£ïŒã€ã³ã¿ãŒããªã¿ãŒ/ä»®æ³ãã·ã³ã®å®è¡ãé©åãªå Žæã§ã®å€æ°ã®ãã¡ã€ã«ãªã©ïŒãå¿ èŠã§ãã ããŠãŒã¶ãŒãã2ã€ã®çªå·ãåãåããããããããŒã¿ããŒã¹ã«æžã蟌ã¿ããããžã§ã¯ã管çè ã«ãã®éé¡ã衚瀺ãããããã°ã©ã ãäœæãããšããã¹ãŠãåé¡ãããŸããã
ãã ããã·ã³ã°ã«ã¢ãŒãã§å®è¡ããããã°ã©ã ãäœæããå¿ èŠãããå ŽåããããŸãã ãŸãã¯ãinitã®ä»£ããã«ã ãŸãã¯ãinitèªäœããã ãŸãã¯suidã§ã ãŸãã¯ä»ã®æ¹æ³ã§ãå± å¿å°ã®è¯ãå®è¡ç°å¢ãå±éããå Žæããªãããã«ããŸãã
Haskellã¯å®è¡å¯èœãã¡ã€ã«ãçæããŸãã æ¬ç©ã®ELFã éçãŸãã¯åçã«ããããšãã§ããŸãã ããã¯çŽ æŽãããããšã§ãã
2çªç®ã®éèŠãªèŠå ïŒèµ·åé床ã å€ãã®å Žåãããã°ã©ã ã¯éå§ããã³çµäºããŸãã pythonïŒããã³ä»ã®å€ãã®ã€ã³ã¿ãŒããªã¿ãŒèšèªïŒã§ã¯ãç¹ã«å€§éã®ã€ã³ããŒãã«ãããèµ·åæã«100500ã®ç°ãªããã¡ã€ã«ãã¹ãã£ã³ãããèµ·åæã«100ã200ããªç§ã®é 延ãçºçããŸãã Haskellã§ã¯ãldã¯PythonãPHPãããäœåãéãåäœããããããã®å€ã¯ã¯ããã«å°ãããªããŸãã
ps / topåºåã«ã€ããŠãåãããšãèšããŸã-Haskellããã°ã©ã ã¯ãããã»ã¹ãªã¹ãã®ãåãªãããã»ã¹ãã®ããã«èŠããéåžžã®å®è¡å¯èœãã¡ã€ã«ã§ããããã¡ã€ã«ãèµ·åããpythonã®ããã§ã¯ãããŸããã
ããã«ã¯ãã€ãã¹ããããŸãïŒçªç¶ã®32/64ãããã¯ç°ãªãå®è¡å¯èœãã¡ã€ã«ã§ãããlibffi5ãŸãã¯libffi6ã¯ãã§ã«ç¹å®ã®ãã£ã¹ããªãã¥ãŒã·ã§ã³ãŸãã¯åãããŒãžã§ã³ã®ã¢ããªã±ãŒã·ã§ã³ã®ãçžäºäºææ§ãã劚ãã倧ããªéãã§ãé åžãããã
ã¢ãã¿ãªã³ã°
Haskellããã°ã©ã ã¯ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã«ããã€ãã£ããã§ãããããç¹å¥ãªç£èŠæ©èœã¯ãããŸããïŒæ¯èŒã®ãããJavaãã·ã³ã«ã¯ç¬èªã®ã€ã³ãžã±ãŒã¿ããããç£èŠããå¿ èŠããããŸããErlangã«ã¯ç¬èªã®ã€ã³ãžã±ãŒã¿ããããŸãïŒã
ã³ãŒãå質
ãã§ã«äœæãããããã°ã©ã ãæäœããå Žåãèå³ã®ããããšã1ã€ã ããããŸããããã¯ããã¹ãŠãã¯ã©ãã·ã¥ãããŒãé³ãããã³å°ç¡ãã«ãªãé »åºŠã§ãã ã ãããPythonãšæ¯èŒããŠ-æ¯é¡ãªãã»ã©å°ãªãã ã¯ããé©åãªãã¡ã€ã«åŠçãè¡ããšããããã¬ãã«ã«ãªãŒã¯ããäŸå€ããã£ããã§ããŸããããã®å¯èœæ§ã¯éåžžã«å°ããã§ãïŒãã¹ãŠã®ããã°ã©ã ã§äœ¿çšäžã«äžåºŠèŠãããšããããŸãïŒã
æããªééãã®å¯èœæ§ã¯ã¯ããã«å°ãªãã§ãã ãããŠããããªãããšèšããšããããã¯çè«äžã§ã¯ãªããå®éã«ã¯ãã€ãŸããHaskellãšPythonã§åã人ã«ãã£ãŠæžãããåã補åã芳å¯ããããšã§ãã
Pythonã¯ãä»ã®åçã«åä»ããããèšèªãšåæ§ãç¶ç¶çãªæéç匟ã§ãã ãã¹ãŠã®æªãç¶æ³ãæ確ã«èããªããã°ãªããŸãããããã«ãå°ããªããŒã«ã«ãšã©ãŒãé倱ã«å¯ŸããŠèª°ãä¿èšŒããŸããã ãšã©ãŒã¯ãå®è¡æã«è¡šç€ºãããããpassïŒïŒããã«æªãïŒãé€ããŠæé»çã«é衚瀺ã«ããããšãã§ããŸãã ã¿ã€ã 'NoneType'ã®ãªããžã§ã¯ãã«ã¯ã¡ãœããããããŸãã-ããã ãã§ãã ãŸãããã®ãšã©ãŒããŸããªåå²ã«ããå Žåãã³ãŒããé·ãéãå®å®ããŠãã衚瀺ããããäžè¬ã«300æ¥éã®çšŒåæéãçµéãããšãé±å±±ãå®å šã«é ããªãèµ·åããŸãã
æ®å¿µãªããããã¹ãŠã®ã³ãŒããã«ããŒããããã¹ãã¯ãããã¹ãŠã®å¯èœãªã¿ã€ãã®å ¥åããŒã¿ãïŒçªç¶åçãªãã®ïŒãã«ããŒãããå ¥åãšã©ãŒããŸã£ããä¿åããŸããã
Haskellã§ã¯ããã®ãããªãšã©ãŒããããããã®ãã©ã³ãã§ç¢ºèªããã®ãå¿ããããŸãã¯ãæ»ãå€ã®åãæ··ãããã¬ãã«ã®ãšã©ãŒã¯ããã°ã©ã ã«è¡šç€ºãããŸããã ããã°ã©ããŒã¯ããããã®ãšã©ãŒã®ã»ãšãã©ãã³ã³ãã€ã«æ®µéã§ãã£ããã§ãã䟿å©ãªåã·ã¹ãã ã«å ããŠãé åãäžæå€æ°ã®ã€ã³ããã¯ã¹ã«æ°ãåãããããšãªãäž»èŠãªãã®ãæžãããšãã§ããèšèªã§ããã䞻匵ããŠããŸãã 圌ãã¯ããç¥ã£ãŠããŸãã
èŠã€ãã£ããšã©ãŒã®åæã®çµéšãããç§ãã¡ãééãããšã©ãŒã®ã»ãšãã©ã¯ãTORã®ãšã©ãŒïŒã€ãŸããè¬èãªäœ¿çšäººã®ãšã©ãŒïŒããããã°ã©ããŒãTKã誀解ãããã®ã§ãããšèšããŸãã ããããããŒã«ã«ã®ééããç©å¿ãã§ã¯ãããŸããã
ããã¯é説çãªçµè«ã«ã€ãªãããŸãïŒåçåä»ãã䜿çšããèšèªã§ã¯ãNoneTypeãçªç¶ã¯ããŒã«ã¢ãŠããã次ã®å Žæãä¿®æ£ããããããHaskellã§ããã°ã©ã ã®ãã°ãä¿®æ£ããããšã¯é£ãããHaskellã§ã¯ãã¢ã«ãŽãªãºã ãåŠçããå¿ èŠããããŸãä»ã®äººã ã宣èªããããšã§TKã®æ確ããæ¬ åŠããŠããããšã«ã
ã©ã€ãã©ãªã®æç床
çç¶ã®ç空ããã°ã©ã ã¯ãçç¶ã®æ¡ä»¶ããã³ç空ã§ã®ã¿æ©èœããŸãã ä»ã®ãã¹ãŠã®äººã¯ãæ°çŸäžã®è€éãªãã©ãŒããããä»æ§ãããã³ãããã³ã«ãããçŸå®ã®äžçã§åããŠããŸãã ã€ãŸããã©ã€ãã©ãªãå¿ èŠã§ãã æ°å人ã
ãããŠãé©ãã¹ãããšã«ãHaskellã«ã¯ãããã®å€ãããããŸãã ã€ãŸããã圌ãã¯æŠéã³ãŒããåããæžãå§ããããšãã芳ç¹ãã-ã¯ãããã®ã³ã°ãsslãready ormãregexpãããŒã«ãªãŒãŒã·ã§ã³ã®ãµããŒããæéãhttpãµãŒããŒãªã©ãäœæããå¿ èŠããªãããã§ãã ã»ãšãã©ãã¹ãŠã®æºåãæŽããŸããã äžå¿«ãªç¬éããããŸãããã ããšãã°ãç§ãã¡ã¯Haskellã®bson / mongdbã®å®è£ ãç¬ç«ããŠãµããŒãããå¿ èŠããããŸãããããã¯ãç±ç·ããTengenã圌ã®ãµããŒããåæ¢ããããã§ãã
...åæã«ãã»ãšãã©ã®ããã°ã©ã ã¯Cã§èšè¿°ãããã©ã€ãã©ãªã«ãªã³ã¯ãããŠãããããHaskellããã°ã©ã ãã»ãã©ãŒã«ãããä¿è·ãããŠããŸãããããã¯ãã©ã€ãã©ãªãšã©ãŒãããã®ã©ã€ãã©ãªãééã£ãŠåŒã³åºãããåå ãšãªã£ãããã°ã©ãïŒããã³ãã®ã³ã³ãã€ã©èªäœãã¯ãä¿è·ããŸããïŒã ããã€ãã®å Žæã§ãããã«ããçŽç²ãªHaskellã§ã©ã€ãã©ãªãæžãæããããŸããïŒããšãã°ããã®çç±ããã HenãäœæããŸãã ãããã¯ãXenã§äœæ¥ããããã«å¿ èŠãªãªã¯ãšã¹ãã®ãµãã»ãããå®è£ ããŸããã³ãããã¯å®å šãªãµããŒããæè¿ããŸãïŒã
ã³ã³ãã€ã«é床
ãããåé¡ã«ãªããšã¯æã£ãŠããŸããã§ãããããããžã§ã¯ããæ§ç¯ããã®ã«30åããããŸããã å€æ°ã®ã³ã¢ãšè¶ é«éã¹ãã¬ãŒãžãåããéåžžã«æãªããã®ããŒããŠã§ã¢äžã å人çã«ã¯ããããããç§ãã¡ã®ããã°ã©ã ã¯ãã§ã«30åãã³ã³ãã€ã«ãããŠããããšããèªãã®æåã®ç¬éã®åŸããã°ä¿®æ£ãå°ãããã·ãŒã³ãããã«ã¡ã¯ã®ã§ããããããå§ããŸããã
é£æ床ã®è¿œè·¡
ã¡ã³ããã³ã¹ãšã¯ãé¢é£ããå°ããªå€æŽãå°å ¥ããããšã§ããã€ãŸãããäœãééã£ãŠããã®ãããšããçŸå°ã®æ確åãã€ãŸããçããŠãããèªåã®ããããžã§ã¯ãã®ã«ãŒãã³ã§ãã
ããã§ã䌎å¥ã§ããã¯ããªãäžå¿«ã«ãªããŸããã ã·ã¹ãã 管çè ã«ã¢ããã³ã³ãã¥ãŒãã£ã³ã°ãæããããšãã§ããããšã¯æããã§ãã ããã...ãŸããããªãã¯ãã€ã³ããåŸãã å¿ èŠã«å¿ããŠã·ã¹ãã 管çè ãPythonã³ãŒããèŠã€ããŠä¿®æ£ã§ããå Žåãã³ãŒãã¯shaitan-arbaã«ãªãããããå€æŽããããã«ç¹å¥ãªäººãæ¥ç¶ãããŸãã蚺æã¹ã¿ã€ã«ã§ã®ã¿åé¡ã«ã€ããŠè©±ãå¿ èŠããããŸãïŒãããã§ã¯æ©èœããŸããã "ïŒã 第äžã«ãdevopã®çžä¹å¹æãããããæãªãïŒããŒã ã®èª°ããããŒã ã®2çªç®ã®éšåã®æ¬è³ªãç解ããŠããªãå Žåãããã¯æªãããšã§ãïŒã第äºã«ãã³ãŒãã«åº§ã£ãŠãã人ã ã®èŠä»¶ãéåžžã«æã£ãŠããŸãã
ããã°ã©ããŒã®æ€çŽ¢ã¯ãHaskellã®è¬çœªè ãå¥ã®èšãæ¹ãããªãã£ããã®ããã«ãåé¡ã§ãã é¢æ°åããã°ã©ãã³ã°ã§ã¯ãç¹ã«ãã³ãã³ãããšãã³ãã¬ãŒãhaskellã䜿çšããå Žåããåãã¬ãŒãã³ã°ããããªãã·ã§ã³ã§ããåé¡ã«ãªããŸãã èšãæããã°ãèšèªã¯åå ¥ã®ãããå€ãåŒãäžããè¿œå ã®é害ã§ãã
åŽååžå Žã«ãããããã°ã©ããŒã®æ¢ç¥ã®äžè¶³ã®æèã§ã¯ãããã¯é害ã§ãã äžæ¹ããã®ãããªãã®ã®ååšã¯ããphp + jsãããããæ£åãŸã§ãã«ããããããŠããããã°ã©ããåŒãä»ããŸãã
éçºã¹ããŒã
確ãã«ãç§ã¯äžç·ã«åããããã°ã©ããŒãå«ãèšèªã®è¬çœªè ããå€ãã®digããèãã§ãããã ãããã客芳çãªçŸå®ïŒHaskellã§ã®ãããžã§ã¯ãã¯Pythonãããé ãèšè¿°ãããŸãã åè«ã¯ãããã°ã©ãã³ã°ã¹ã¿ã€ã«ã®å€æŽã詳现ãžã®æ³šæãªã©ã«ç§ãå°ããŸãããããã§ããå®è·µã«åºã¥ãç§ã®çŸåšã®ä¿¡å¿µã¯-Haskellã§ã®æ°ããæ©èœã®å®è£ ã®æçµé床ãèããäœãããšã§ãã ããã
ããã¯ãããã°ã©ã ã®äœæåŸã«Pythonã§ãŸãšããªã«ãŒããæ§æããããããçš®é¡ã®æããªãã°ããããã°ããŠãã£ããããæéã«ãã£ãŠéšåçã«è£ãããŸãããHaskellã«ã¯ã»ãšãã©ãããŸããããããã念é ã«çœ®ããŠããããã§ãé ããªããŸãã
ãããã¿ã€ãã³ã°ã«é¢ããåæ§ã®åé¡ã Pythonã®åºæ¬çãªãããã¿ã€ãããã©ãã®ã€ã³ã¿ã©ã¯ãã£ããªç°å¢ã§è¡ã£ãããšãã»ãŒã³ããŒã¢ã³ãããŒã¹ãããŠããããã«èŠããŠããHaskellã§ã¯éåžžããã°ããã®éïŒã¿ã€ããªã©ïŒæ¶ãå»ããããçš®ã®ç¥èãªã¢ã¯ã·ã§ã³ã§ããçµæã«ã€ãªãããŸãã çµæããç§ãã¡ã倢èŠãŠãããã®ãšã¯ãŸã£ããç°ãªããããšãå€æããå Žåã¯ãæåã§ã¯ãªãããã¡ã€ãã«ã«ããè¿ãããšãæããã«ãªããŸãã ãããã£ãŠããœãªã¥ãŒã·ã§ã³ã®æ€çŽ¢ã«ãããå埩ã®ã³ã¹ããå¢å ããããã»ã¹å šäœã®æè»æ§ãäœäžããŸãã