ãã®èšäºã¯ã2æC ++ CoreHard Winter 2017ã«ã³ãã¡ã¬ã³ã¹ã®ååã®ã¬ããŒãã®ããã¹ãããŒãžã§ã³ã®æåã®éšåã§ãã ããŸããŸ15幎éã SObjectizerãã¬ãŒã ã¯ãŒã¯ã®éçºãæ åœããŠããŸããã ããã¯ãã¢ã¯ã¿ãŒã¢ãã«ã䜿çšã§ãããªãŒãã³ãœãŒã¹C ++ãã¬ãŒã ã¯ãŒã¯ããŸã éçºããŠããæ°å°ãªããã®ã®1ã€ã§ãã ãããã£ãŠããã®éãç§ã¯å®éã«ä¿³åªã®ã¢ãã«ãç¹°ãè¿ãè©ŠããŠã¿ãŸããããã®çµæãããã€ãã®çµéšãèç©ãããŸããã åºæ¬çã«ã¯ååããªçµéšã§ããããäºåã«ç¥ã£ãŠãããšè¯ããšæãããããã€ãã®æçœãªç¬éããããŸãã èžãŸããã¬ãŒããã³ãŒã³ããã£ã±ãã«ãªã£ããã®ãç掻ãç°¡çŽ åããæ¹æ³ãããã³ãããSObjectizerã®éçºã«ã©ã®ããã«åœ±é¿ãããã«ã€ããŠã¯ãåŸã§èª¬æããŸãã
ç§ã話ãããšã®å€ãã¯ãErlangã³ãã¥ããã£ã§ããç¥ãããŠãããšæããŸãã ããããErlangã³ãã¥ããã£ã¯C ++ã³ãã¥ããã£ãšãããã«éè€ããŠããŸãã ããã«ãErlangéçºè ãå©çšã§ãããã®ãšC ++éçºè ãå©çšã§ãããã®ã«ã¯éãããããŸãã ãããã£ãŠããã®èšäºãC ++ã®ããã¯ããŒã ã«ãšã£ãŠèå³æ·±ãæçšã§ããããšãé¡ã£ãŠããŸãã
SObjectizerèªäœã¯ã2002幎æ¥ã«Intervaleã§ç»å ŽããŸããã SObjectizerã¯ãäœæ¥ããŒã«ãšããŠã®ã¿äœæãããŸããã ãã®ããã圌ã¯ããã«ãããžãã¹ã«åå ¥ããã瀟å ããã³ç€Ÿå€ã®ããã€ãã®è£œåã§äœ¿çšãããŸããã
- é»ååååŒããã³ã¢ãã€ã«åååŒã
- ã¢ãã€ã«ãã³ãã³ã°;
- SMS / USSDãã©ãã£ãã¯ã®éçŽã
- ã·ãã¥ã¬ãŒã·ã§ã³ã¢ããªã³ã°;
- éé茞éã®ACSããã§ãã¯ããããã®ãã¹ããã³ãã
- 枬å®æ å ±ãåéããããã®åæ£ã·ã¹ãã ã®ãããã¿ã€ãã³ã°ã
ãããã®è£œåã®äžéšã¯ãŸã 皌åäžã§ãã
ã¢ãã«ã¢ã¯ã¿ãŒã®é¢é£æ§ã«ã€ããŠã®ããã€ãã®èšè
ã¢ãã«ã¢ã¯ã¿ãŒã®èŠç¹ãç°¡åã«æŽæ°ããŸãã
- ã¢ã¯ã¿ãŒã¯æ¯ãèããæã€ãšã³ãã£ãã£ã§ãã
- ã¢ã¯ã¿ãŒã¯çä¿¡ã¡ãã»ãŒãžã«å¿çããŸãã
- ã¡ãã»ãŒãžãåä¿¡ãããšãã¢ã¯ã¿ãŒã¯æ¬¡ã®ããšãã§ããŸãã
- ããã€ãã®ïŒæçµçãªïŒã¡ãã»ãŒãžãä»ã®ã¢ã¯ã¿ãŒã«éä¿¡ããŸãã
- ïŒæçµçãªïŒæ°ã®æ°ããã¢ã¯ã¿ãŒãäœæããŸãã
- åŸç¶ã®ã¡ãã»ãŒãžãåŠçããããã®æ°ããåäœãå®çŸ©ããŸãã
ã¢ã¯ã¿ãŒã¢ãã«ã¯ãã¢ããªã±ãŒã·ã§ã³ã§ã®ã¢ããªã±ãŒã·ã§ã³äœæ¥ããéåæã¡ãã»ãŒãžãä»ããŠã®ã¿çžäºäœçšããå¥åã®ãšã³ãã£ãã£ãã¢ã¯ã¿ãŒã«ãã£ãŠå®è¡ãããããšãæå³ããŸãã
ã¢ã¯ã¿ãŒã¯ãçä¿¡ã¡ãã»ãŒãžãåŸ ã£ãŠã¹ãªãŒãããçä¿¡ã¡ãã»ãŒãžã衚瀺ããããšããŠã§ã€ã¯ã¢ããããŠã¡ãã»ãŒãžãåŠçãã次ã®ã¡ãã»ãŒãžãåä¿¡ãããŸã§åã³ã¹ãªãŒãç¶æ ã«ãªããŸãã
æŽå²çãªçç±ãããSObjectizerã§ã¯ã¢ã¯ã¿ãŒã§ã¯ãªããšãŒãžã§ã³ããšããçšèªã䜿çšããŠãããããäž¡æ¹ã®çšèªã¯ããã¹ãã®åŸåã§äœ¿çšãããåãæå³ãæã¡ãŸãã
ãããŠãC ++ã§ã®ã¢ã¯ã¿ãŒã¢ãã«ã®é©çšå¯èœæ§ã«é¢ããããã€ãã®èšè
ç§å人ã®æèŠã§ã¯ãC ++ã§ã¢ã¯ã¿ãŒã¢ãã«ã䜿çšãããšãå€ãã®ããŒãã¹ãåŸãããŸãã
- å俳åªã«ã¯ç¬èªã®ç¶æ ããããããã¯èªåã ãã䜿çšã§ããŸãã ããã«ããããã«ãã¹ã¬ããããã°ã©ãã³ã°ã®å¯¿åœãå€§å¹ ã«ç°¡çŽ åãããŸãã
- éåæã¡ãã»ãŒãžãä»ããæ å ±è»¢éã¯ãããã€ãã®ã¿ã€ãã®ã¿ã¹ã¯ã解決ãã䟿å©ã§èªç¶ãªæ¹æ³ã§ãã ãããŠããã®ãããªã¿ã¹ã¯ã®ã¢ã¯ã¿ãŒã®ã¢ãã«ã¯ããµããžã§ã¯ããšãªã¢ãšå®è£ ã®éã®ã»ãã³ãã£ãã¯ã®ã£ãããæžãããŸãã
- ã¢ã¯ã¿ãŒã®ã¢ãã«ã䜿çšããå Žåãã³ã³ããŒãã³ãã®æ¥ç¶ã¯éåžžã«åŒ±ããããæ§æãšãã¹ããç°¡åã«ãªããŸãã
- éåæã¡ãã»ãŒãžããŒã¹ã®éä¿¡ã¡ã«ããºã ã¯ãã¿ã€ããŒãšéåžžã«å奜çã§ãã ã¢ã¯ã¿ãŒã¢ãã«ã§ã¿ã€ããŒãé 延ã¡ãã»ãŒãžãŸãã¯å®æã¡ãã»ãŒãžãšããŠäœ¿çšããã®ã¯æ¥œããããšã§ãã
- C ++ã®åå¿è ã¯ãé©ãã»ã©é«éã«Model of Actorsã«åºã¥ããŠãã«ãã¹ã¬ããããã°ã©ãã³ã°ã®ãããã¯ã«å ¥ããŸãã æšæ¥ã®åŠçã¯ãçæéã§ä¿¡é Œã§ãããã«ãã¹ã¬ããã³ãŒããæžãå§ããŸãã
ããããšã³ãŒã³
äžèšã®ããŒãã¹ã¯ãã¿ã¹ã¯ãã¢ã¯ã¿ãŒã®ã¢ãã«ã«ããŸãé©åããŠããå Žåã«ã®ã¿åŸãããŸãã ãããŠãããã¯åžžã«ããŸããã£ãããããšã¯éããŸããã ãããã£ãŠã泚æãå¿ èŠã§ããããšãã°ãéãã³ã³ãã¥ãŒãã£ã³ã°ã¿ã¹ã¯ã§ã¢ã¯ã¿ãŒã®ã¢ãã«ãåãäžãããšãåã³ãããçã¿ãæããããšããããŸãã
ã¢ã¯ã¿ãŒã¢ãã«ãç¹å®ã®ãµããžã§ã¯ããšãªã¢ã«é©ããŠããå Žåã¯ãé©åãªããŒã«ã䜿çšããããšã§äººçãå€§å¹ ã«ç°¡çŽ åã§ããŸãã
ãããããã®å ŽåããçæããŸãã¯ãèœãšãç©Žãã®ã«ããŽãªã«èµ·å ããå¯èœæ§ã®ãããã®ã®ã¢ã€ãã¢ãæã£ãŠããããšãéåžžã«æãŸããã§ãã 次ã«ãããã€ãã®çæã«ã€ããŠã話ããŸãã ããã誰ããç§ãä»ãŸã§æã£ãŠãããããå°ãªããã³ããåããã®ã«åœ¹ç«ã€ããšãé¡ã£ãŠããŸã
ãšãŒãžã§ã³ãã®éè² è·
ææªã®ãµã³ãŽç€ã®1ã€ã¯ã俳åªã®éè² è·ã®åé¡ã§ãã
éè² è·ã¯ããšãŒãžã§ã³ããã¡ãã»ãŒãžãåŠçããæéããªããšãã«çºçããŸãã
ããšãã°ã誰ãã1ç§éã«3ã¡ãã»ãŒãžã®é床ã§ãšãŒãžã§ã³ããããŒããããšãŒãžã§ã³ãã1ç§éã«2ã¡ãã»ãŒãžããåŠçã§ããªããšããŸãã åãµã€ã¯ã«ã®ãšãŒãžã§ã³ããã¥ãŒã«ã¯ãæªåŠçã®ã¡ãã»ãŒãžããã1ã€ãããŸãã
ãšãŒãžã§ã³ããäœããã®æ¹æ³ã§éè² è·ããä¿è·ãããŠããªãå Žåãçµæã¯æ²ãããã®ã«ãªããŸãïŒçä¿¡ã¡ãã»ãŒãžãã¥ãŒãèšãã¿ãã¡ã¢ãªãæ¯æžããã¡ã¢ãªæ¶è²»ã«ããäœæ¥ãé ããªãããã¥ãŒã®æé·ãããã«éããªããŸãã ãã®çµæãã¢ããªã±ãŒã·ã§ã³ã®ããã©ãŒãã³ã¹ãå®å šã«äœäžããŸãã
Model of Actorsã§éè² è·ãããã»ã©æãã®ã¯ãªãã§ããïŒ
ã¡ãã»ãŒãžã®éä¿¡ã«åºã¥ãéåæçžäºäœçšã§ã¯ããã£ãŒãããã¯ãå®è£ ããåçŽãªå¯èœæ§ã¯ãããŸããïŒããã¯ãã¬ãã·ã£ãŒã§ããããŸãïŒã ã€ãŸã éä¿¡åŽã®ãšãŒãžã§ã³ãã¯ãåä¿¡åŽã®ãšãŒãžã§ã³ãã®ãã¥ãŒãã©ãã ããã£ã±ãã«ãªã£ãŠããããç¥ãããåä¿¡åŽã®ãšãŒãžã§ã³ããé çªãå€ãããŸã§äžæåæ¢ããããšã¯ã§ããŸããã ç¹ã«ãéä¿¡ãšãŒãžã§ã³ããšåä¿¡ãšãŒãžã§ã³ãã®äž¡æ¹ãåãäœæ¥ã¹ã¬ããã§åäœã§ãããããéä¿¡ãšãŒãžã§ã³ãããã¹ãªãŒãããããšãåä¿¡ãšãŒãžã§ã³ããšãšãã«å ±éã®äœæ¥ã¹ã¬ããããããã¯ãããŸãã
éè² è·å¶åŸ¡ã®è€éãã¯ãç¹å®ã®ã¿ã¹ã¯ã«å¯ŸããŠéè² è·ã«å¯Ÿããä¿è·ã®åªããã¡ã«ããºã ã匷åããå¿ èŠãããããšã§ãã éè² è·ãçºçããå Žåãã©ããã§ææ°ã®ã¡ãã»ãŒãžãã¹ããŒã§ããŸãã ã©ããã§æãå€ããã®ãæšãŠãå¿ èŠããããŸãã å€ãã¡ãã»ãŒãžã®å Žåã¯ãå¥ã®åŠçæŠç¥ãéžæããå¿ èŠããããŸãã
åºå£ã¯ã©ãã§ããïŒ
ç§ãã¡èªèº«ã®çµéšããã2ã€ã®ãšãŒãžã§ã³ãã«åºã¥ããã£ã³ããŒã³ãéåžžã«ããŸãæ©èœããŠããããšãããããŸãããã³ã¬ã¯ã¿ãŒãšããã©ãŒããŒã¯ããããç°ãªãã¯ãŒã¯ã¹ã¬ããã§åäœããŸãã ã³ã¬ã¯ã¿ãŒãšãŒãžã§ã³ãã¯ã¡ãã»ãŒãžãèç©ããéè² è·ä¿è·ãæäŸããŸãã perfomerãšãŒãžã§ã³ãã¯ãã³ã¬ã¯ã¿ãšãŒãžã§ã³ããã次ã®ã¡ãã»ãŒãžããããå®æçã«èŠæ±ããŸãã 次ã®ããããåŠçããããšãå®è¡ãšãŒãžã§ã³ãã¯æ¬¡ã®ããããå床èŠæ±ããŸãã
ããããæªãããšã¯ãããããã¹ãŠãã¢ããªã±ãŒã·ã§ã³ããã°ã©ããè¡ãå¿ èŠããããšããããšã§ãã ãããã®ç®çã®ããã«ãæ¢è£œã®ããŒã«ã»ãããçšæããããšããå§ãããŸãã ãã®ãããSObjectizerã«ã ã¡ãã»ãŒãžå¶é ããšåŒã°ããç¹å¥ãªã¡ã«ããºã ãçµã¿èŸŒã¿ãŸãããããã«ãããããã°ã©ããŒã¯ãæ¢æã®ç°¡åãªããªã·ãŒã䜿çšããŠãšãŒãžã§ã³ããéè² è·ããä¿è·ã§ããŸãã
ã³ãŒãã§ã¯æ¬¡ã®ããã«ãªããŸãã
class collector : public so_5::agent_t { public : collector(context_t ctx, so_5::mbox_t quick_n_dirty) : so_5::agent_t(ctx // get_status . + limit_then_drop<get_status>(1) // , // , . + limit_then_redirect<request>(50, [quick_n_dirty]{ return quick_n_dirty; } ) // , // . + limit_then_abort<get_messages>(1)) ... };
å°ã説æ
ãã¡ãã»ãŒãžå¶éãã«ãããããšãã°ããšãŒãžã§ã³ãã®ã¡ãã»ãŒãžãã¥ãŒã«get_statusã¿ã€ãã®ã¡ãã»ãŒãžã1ã€ã ãããã°ååã§ããããã®ã¿ã€ãã®æ®ãã®ã¡ãã»ãŒãžã¯ç°¡åãã€ç°¡åã«ç Žæ£ã§ããããšãæå®ã§ããŸãã
limit_then_drop<get_status>(1)
ãã¥ãŒã«ãªã¯ãšã¹ãã¿ã€ãã®ã¡ãã»ãŒãžã50ãè¶ ããªãããã«æå®ãããã®ã¿ã€ãã®æ®ãã®ã¡ãã»ãŒãžãå¥ã®æ¹æ³ã§åŠçããå¥ã®ãšãŒãžã§ã³ãã«éä¿¡ããå¿ èŠããããŸãïŒããšãã°ããããç»åã®ãµã€ãºãå€æŽãããªã¯ãšã¹ãã§ããå Žåã¯ãããç¡äœæ³ã«ãµã€ãºãå€æŽã§ããŸãïŒããããã¯ããã«é«éïŒïŒ
limit_then_redirect<request>(50, [quick_n_dirty]{ return quick_n_dirty; } )
å Žåã«ãã£ãŠã¯ããã¥ãŒå
ã®èš±å¯ãããã¡ãã»ãŒãžæ°ãè¶
éããããšã¯ããã¹ãŠãå®å
šã«æªãããšã瀺ããŠãããã¢ããªã±ãŒã·ã§ã³å
šäœã®åäœãäžæããæ¹ãããå ŽåããããŸãã ããšãã°ãã¿ã€ãget_messagesã®2çªç®ã®ã¡ãã»ãŒãžããã¥ãŒã«è¡šç€ºãããæåã®ã¡ãã»ãŒãžããŸã åŠçãããŠããªãå Žåã
æããã«äœããå®å
šã«ããŸããããªãã®ã§ãstd ::ãåŒã³åºããŠãåèµ·åããæåããããçŽãå¿
èŠããããŸãã
limit_then_abort<get_messages>(1)
SObjectizerã«è¿œå ãããã¡ãã»ãŒãžã®å¶éã¯ãéè² è·ããä¿è·ããããã®å®å šãªã¡ã«ããºã ã§ã¯ãããŸããïŒãã®ãããªã¡ã«ããºã ã¯ç¹å®ã®ã¿ã¹ã¯ã®ããã«ç ãæŸãŸãããå¿ èŠãããããïŒããåçŽãªå Žåããã³ã©ããããããã¿ã€ãã³ã°ã§ã¯ãã¡ãã»ãŒãžã®å¶éã¯éåžžã«æåããŠããŸãã
ã¡ãã»ãŒãžé ä¿¡ã¯ä¿¡é Œã§ããŸãã
äžéšã®äººã«ãšã£ãŠã¯ãããã¯æå€ãªããšãããããŸããããéä¿¡ãããã¡ãã»ãŒãžã®åä¿¡è ãžã®é ä¿¡ã¯ä¿èšŒãããŠããŸããã ã€ãŸã ã¡ãã»ãŒãžã¯éäžã§å€±ãããå¯èœæ§ããããŸãã éä¿¡ãããã¡ãã»ãŒãžãåä¿¡ãšãŒãžã§ã³ãã«å±ããªãäž»ãªçç±ã¯ããã€ããããŸãã
- åä¿¡è ã¯ãã¯ãååšããŸããã ã€ãŸã éä¿¡æã«ååšããŠããŸããããäœãšãæ¶ããŸããã
- åä¿¡è ã¯ããã«ããŠãã¡ãã»ãŒãžã¯åœŒã«å±ããããåä¿¡è ã¯çŸåšã®ç¶æ ã®ã¡ãã»ãŒãžãåã«ç¡èŠããã
- ããšãã°ããã¡ãã»ãŒãžå¶éãã¡ã«ããºã ã®ãããã¡ãã»ãŒãžã¯åä¿¡è ã«å±ããŸããã
ã€ãŸããã¡ãã»ãŒãžãéåæã§èª°ãã«éä¿¡ããå Žåããã®ã¡ãã»ãŒãžãåä¿¡è ã«å±ããšãã確信ã¯ãããŸããã
ãšãŒãžã§ã³ãAãã¡ãã»ãŒãžxããšãŒãžã§ã³ãBã«éä¿¡ããå¿çãšããŠã¡ãã»ãŒãžyãåä¿¡ããããšãæ³å®ããŠãããšããŸãã ã¡ãã»ãŒãžyããšãŒãžã§ã³ãAã«å±ããšããšãŒãžã§ã³ãAã¯åãã§ä»äºãç¶ããŸãã
ãã ããã¡ãã»ãŒãžxããšãŒãžã§ã³ãBã«å°éãããéäžã§å€±ãããå ŽåããšãŒãžã§ã³ãAã¯å¿çã¡ãã»ãŒãžyãç¡é§ã«åŸ ã¡ãŸãã
ã¡ãã»ãŒãžã®ä¿¡é Œæ§ãå¿ãããšãããã€ãã®ã¡ãã»ãŒãžã倱ã£ãã ãã§ã¢ããªã±ãŒã·ã§ã³ãåäœããªããªã£ãç¶æ³ã«ç°¡åã«æ°ã¥ãããšãã§ããŸãã ãã®äŸã®ããã«ïŒãšãŒãžã§ã³ãAã¯ãã¡ãã»ãŒãžyãåä¿¡ãããŸã§äœæ¥ãç¶è¡ã§ããŸããã
ãããã£ãŠããã¡ãã»ãŒãžã®ä¿¡é Œæ§ãäœãå Žåãã©ã®ããã«ãããšäžç·ã«æ®ãããããšããçåãçããŸãã
ã©ããã
ã¡ãã»ãŒãžã®æ倱ãããã©ãŒãã³ã¹ã«åœ±é¿ããªãããã«ããšãŒãžã§ã³ãã®äœæ¥ãèšèšããå¿ èŠããããŸãã ãããè¡ãã«ã¯ã2ã€ã®ç°¡åãªæ¹æ³ããããŸãã
- ã¿ã€ã ã¢ãŠãåŸã«ã¡ãã»ãŒãžãåéä¿¡ããŸãã ãããã£ãŠããšãŒãžã§ã³ãAããšãŒãžã§ã³ãBãã10ç§ä»¥å ã«ã¡ãã»ãŒãžyãåä¿¡ããªãã£ãå ŽåããšãŒãžã§ã³ãAã¯ã¡ãã»ãŒãžxãåéä¿¡ã§ããŸãã ãããïŒ ããã§ãã¡ãã»ãŒãžã®è»¢éã¯ãšãŒãžã§ã³ãã®éè² è·ãžã®çŽæ¥ã®ãã¹ã§ããããšãç解ããå¿ èŠããããŸãã ãããã£ãŠããšãŒãžã§ã³ãBã¯ã xã¡ãã»ãŒãžã§éè² è·ã«ãªããªãããã«ä¿è·ããå¿ èŠããããŸãã
- 劥åœãªæéå ã«çµæãåŸãããªãã£ãå Žåã®æäœã®ããŒã«ããã¯ã ãã®ããããšãŒãžã§ã³ãAããšãŒãžã§ã³ãBãã10ç§ä»¥å ã«ã¡ãã»ãŒãžãåä¿¡ããªãå ŽåããšãŒãžã§ã³ãAã¯ãã®åŽã§ä»¥åã«å®è¡ãããã¢ã¯ã·ã§ã³ããã£ã³ã»ã«ã§ããŸãã ãŸãã¯ãçŸåšã®æäœã®ã¹ããŒã¿ã¹ããçŸåšã®çµæäžæãã«èšå®ããŠã次ã®æäœã®åŠçã«é²ã¿ãŸãã
äžèŠãããšãéåæã¡ãã»ãŒãžãä»ããããåããä¿¡é Œã§ããªãå Žåãã¢ã¯ã¿ãŒã¢ãã«ã«åºã¥ããŠéçºãããã¢ããªã±ãŒã·ã§ã³èªäœãä¿¡é Œã§ããªãããã«æããããããããŸããã å®éã«ã¯ãããèå³æ·±ãããšãããããŸããã¢ããªã±ãŒã·ã§ã³ã®ä¿¡é Œæ§ãåäžããã ãã§ãïŒå°ãªããšãç§ã®æèŠã§ã¯ïŒã ããã¯ãéçºè ãç·æ¥äºæ ãå æããããã®ããã€ãã®ã¡ã«ããºã ããšãŒãžã§ã³ãã«ããã«åŒ·å¶ãããšããäºå®ã«ãã£ãŠèª¬æãããŸãã ãããŠããããã®ã¡ã«ããºã ã¯ãå¶çºäºæ ãçºçãããšãã«æ©èœããŸãã
ãšã©ãŒã³ãŒããšäŸå€
ãã®ã¬ãŒããSObjectizerã®éçºè ãšããŠæ£ç¢ºã«èžè¥²ããŸããã çµæã¯ãŠãŒã¶ãŒã«åœ±é¿ããŸããã å®éã2002幎ã«SObjectizerã®æåã®ããŒãžã§ã³ãäœæãããšãããšã©ãŒãå ±åããããã«äŸå€ã䜿çšããŠããŸããã§ããã 代ããã«ãæ»ãã³ãŒãã䜿çšãããŸããã
æéãçµã€ã«ã€ããŠããšã©ãŒã³ãŒãã¯ä¿¡é Œã§ããªãããšãå€æããŸããã ããã§ã«ãŒã«ãæ©èœããŸããïŒäœããå¿ããããšãã§ããã°ãããã¯å¿ããããŸãã ã©ããã§ãšã©ãŒåŠçãã¹ããããããããšã©ãŒåŠçããã®ãã°ã®ã¿ã«æžããã ãã§ååã§ããããã¯æéã®çµéãšãšãã«ç¢ºå®ã«æšªã«ãªããŸãã ããšãã°ãã¢ããªã±ãŒã·ã§ã³ã¯ãŠãŒã¶ãŒèŠæ±ã®åŠçãåæ¢ããŸãã ãã®åŸãåé¡ã®çè·¡ããã°ã®ã©ããã«èŠã€ããããšãã§ããŸãã ããããããã¯ãåé¡ããŠãŒã¶ãŒã«ãã§ã«çŸããŠãããšããäºå®ã®åŸã§ãã
ãã®ããã2010幎ã«æ°ããããŒãžã§ã³ã®SObjectizerã®äœæãéå§ãã以åã®ããŒãžã§ã³ãšã®äºææ§ãå£ãããšããäŸå€ã䜿çšããŠãšã©ãŒãå ±åããããã«åãæ¿ããŸããã
ç§ã®æèŠã§ã¯ãããã¯ã¢ããªã±ãŒã·ã§ã³ã®ä¿¡é Œæ§ãšå質ã«ãã©ã¹ã®å¹æããããããŸããã åé¡ã¯ãã¯ãã飲ã¿èŸŒãŸãããªããªããæšæºããã®éžè±ã¯ããã«é¡èã«ãªããŸãã
ã»ãŒ100äžã®è³ªå
ãšãŒãžã§ã³ãBããšãŒãžã§ã³ãAããã®ã¡ãã»ãŒãžãåŠçããç¶æ³ãæ³åããŠã¿ãŸãããããã®ã¡ãã»ãŒãžã®åŠçäžã«ãšã©ãŒãçºçãããšããšãŒãžã§ã³ãBã¯ãã³ãã©ãŒããäŸå€ãã¹ããŒããŸãã ãããã©ãããŸããïŒ
ãã®åé¡ã«ã¯2ã€ã®èŠçŽ ããããŸãã
- ãšãŒãžã§ã³ãBã¯ãSObjectizerãææããã³ã³ããã¹ãã§å®è¡ãããŸãã ãŸããSObjectizerã¯ããšãŒãžã§ã³ãBããé£ã³åºããäŸå€ãã©ããããããããŸããããã®äŸå€ã¯ããã¹ãŠãéåžžã«æªããäœæ¥ãç¶ããæå³ããªããšèšã£ãŠãããããããŸããã ãŸãã¯å€åããã¯ããªãã泚æãæããªããªãããã®ãã³ã»ã³ã¹ã§ãã
- ãšãŒãžã§ã³ãBããéä¿¡ãããäŸå€ããã£ããããŠããšãŒãžã§ã³ãAã«é
ä¿¡ããããšããŠãã次ã®ããšãããããŸãã
- ãšãŒãžã§ã³ãAã¯ãã¯ãååšããªããªããæ¢ã«ååšããªããªã£ãŠããŸãã
- ãšãŒãžã§ã³ãAãååšããå Žåã§ãããšãŒãžã§ã³ãBã®åé¡ã«é¢ããæ å ±ã®åä¿¡ã«èå³ããªãå ŽåããããŸãã
- ãšãŒãžã§ã³ãAãããŠããšãŒãžã§ã³ãBã®åé¡ã«é¢ããæ å ±ã®åä¿¡ã«èå³ãããå Žåã§ããäœããã®çç±ã§ïŒããšãã°ããšãŒãžã§ã³ãAãéè² è·ããä¿è·ãããŠããããïŒãã®æ å ±ããšãŒãžã§ã³ãAã«é ä¿¡ããªãå ŽåããããŸãã
ããã«ã€ããŠã©ãããã°ããã§ããïŒ
SObjectizerã§ã¯ããšãŒãžã§ã³ãããäŸå€ãçºçããå Žåã®åŠçââã決å®ããç¹å¥ãªãã©ã°ãäœæããŸããã ããšãã°ãã¢ããªã±ãŒã·ã§ã³å šäœãäžåºŠã«åŒ·å¶çµäºããããåé¡ã®ãããšãŒãžã§ã³ããç»é²è§£é€ããããäŸå€ãç¡èŠããŸãã
äŸå€ãã¹ããŒããããšãã«ãšãŒãžã§ã³ããç»é²è§£é€ãããšããäºå®ã«ãããErlangã®ããã«ã¹ãŒããŒãã€ã¶ãŒã¡ã«ããºã ã®çµç¹åãå¯èœã«ãªããŸãã ã€ãŸããäŸå€ã®ããã«äžéšã®ãšãŒãžã§ã³ãããèœã¡ããå Žåãã¹ãŒããŒãã€ã¶ãšãŒãžã§ã³ãã¯ãã®ãããªããããã«å¯ŸããŠãèœã¡ãããšãŒãžã§ã³ãã«å¯Ÿå¿ããåèµ·åããããšãã§ããŸãã
ããã¯ã¢ãŒã©ã³ãããªããããã¯æ°åãéã
ããã§ã®ã¿ãC ++ã®å Žåãããã¯Erlangãä»ã®å®å šãªèšèªã»ã©ãã©è²ã§ã¯ãªãããšã瀺ããŠããŸãã ã¢ãŒã©ã³ã§ã¯ãã¯ã©ãã·ã¥ããããšããååã¯çµ¶å¯Ÿçãªãã®ã§ãã ããã§ã¯ã倧ãŸãã«èšã£ãŠããŒãã«ããé€ç®ãåãå ¥ããããŸããã ãŸãã圌ã¯Erlangããã»ã¹ããŒãã§å²ãããšããŸãããŸããããã¯èœã¡ãŸããErlangä»®æ³ãã·ã³ã¯ãã¿ããããã«ããã¹ãŒããŒãã€ã¶ãŒã¯èœã¡ãããã»ã¹ãåã³äœæããŸãã ãã ããC ++ã§ã¯ããŒãã§é€ç®ããããšãããšããšã©ãŒãçºçãããšãŒãžã§ã³ãã ãã§ãªããã¢ããªã±ãŒã·ã§ã³å šäœã匷å¶çµäºãããŸãã
ãã1ã€ã®éèŠãªãã€ã³ãïŒãšãŒãžã§ã³ãã¯C ++ãªããžã§ã¯ãã§ãã ã¢ããªã±ãŒã·ã§ã³ããåé€ããããšã«æ±ºããå Žåã¯ãæå¹æéãåããä»ã®ãªããžã§ã¯ããšåæ§ã«ãæ éã«åé€ããå¿ èŠããããŸãã ã€ãŸã ãšãŒãžã§ã³ããªããžã§ã¯ãã®å Žåããã¹ãã©ã¯ã¿ãåŒã³åºããããã®ãã¹ãã©ã¯ã¿ã¯æ£åžžã«æ©èœããã¯ãã§ãã
ããã¯ããšãŒãžã§ã³ããªããžã§ã¯ããå°ãªããšãäŸå€ã®å®å šæ§ã®åºæ¬çãªä¿èšŒãæäŸããå¿ èŠãããããšãæå³ããŸãã ã€ãŸãããšãŒãžã§ã³ããªããžã§ã¯ããäŸå€ãã¹ããŒããå ŽåããªãœãŒã¹ãªãŒã¯ãããã°ã©ã å ã®äœããžã®æå·ã¯çºçããŸããã
ããã¯ãC ++ã§ãã¯ã©ãã·ã¥ãããããšããååãErlangã®å Žåãšã¯å€§ããç°ãªããšããäºå®ã«èªåçã«ã€ãªãããŸãã ãããŠããšãŒãžã§ã³ããäŸå€ã«é¢ããŠäœããã®åççãªä¿èšŒãæäŸããããšããã§ã«ç¢ºèªãå§ããŠããå Žåããšã©ãŒã®çµæããã¬ãŒã ã¯ãŒã¯ã«å æããããšã«å¯Ÿããæžå¿µãã·ããããå¿ èŠããªãããšãããã«æããã«ãªããŸãã ããã¯ãšãŒãžã§ã³ãèªèº«ãè¡ãããšãã§ããŸãã
ããã¯ããšãŒãžã§ã³ããèªç¶ã«nothrowä¿èšŒããµããŒããå§ãããšããäºå®ã«ã€ãªãããŸãã ã€ãŸã äŸå€ããŸã£ããã¹ããŒããªãã§ãã ããã 倧ãŸãã«èšã£ãŠãäœãæ·±å»ãªããšããããšãŒãžã§ã³ãã®ã¡ãã»ãŒãžãã³ãã©ãŒã«ã¯ãtry-catchãããã¯ãå«ãŸããŠããŸãã åæã«ãäŸå€ããšãŒãžã§ã³ãããé£ã³åºãå ŽåïŒcatchãããã¯ã§äºæããªãäœããæå³ããå ŽåïŒãã¢ããªã±ãŒã·ã§ã³å šäœã«äœãåé¡ããããŸãã ãã®å Žåãåé¡ã®ãããšãŒãžã§ã³ãã1ã€ã§ã¯ãªããã¢ããªã±ãŒã·ã§ã³å šäœã殺ãå¿ èŠããããŸãã ç¶ç¶çãªæ£ããåäœãä¿èšŒããããšã¯ã§ããŸããã®ã§ã
ãããã£ãŠãã¢ã©ã«ïŒC ++ã¯Erlangã§ã¯ãªããErlangãŸãã¯C ++ã®ä»ã®ããã°ã©ãã³ã°èšèªã«é©ãããšã©ãŒåŠçã¢ãããŒãã転éãã䟡å€ã¯ãããŸããã
ãããæåã®éšåã®ãã¹ãŠã§ã ããã«ç¶ããŸã ã