1. ã¯ããã«ïŒããã°ã©ãã³ã°èšèªãšã¯ïŒ
åãã«ãããã°ã©ãã³ã°èšèªãå ·äœçã«äœã§ããããç解ããããšã倧åãšãªããŸããããã°ã©ãã³ã°èšèªã¯ã人éãã³ã³ãã¥ãŒã¿ã«åœä»€ãåºãããã®ä»çµã¿ã®äžã€ã§ã人éãç解ãããã圢ã§æžãããã³ãŒããã³ã³ãã¥ãŒã¿ãå®è¡ã§ãã圢æ ãžãšå€æããŸããããã«ãããç§ãã¡ã¯æœè±¡çãªã¢ã€ãã¢ãå ·äœçãªå¿ èŠãªèšç®åŠçãžãšèœãšã蟌ãããšãã§ããã®ã§ãã
1.1 ããã°ã©ãã³ã°èšèªã®åœ¹å²
ããã°ã©ãã³ã°èšèªã«ã¯å€ãã®åœ¹å²ããããŸãããœãããŠã§ã¢éçºããŠã§ããµã€ãã®æ§ç¯ãããŒã¿è§£æãç§åŠçãªç 究ãªã©ãåºç¯å²ã«ãããäœæ¥ãããã°ã©ãã³ã°èšèªã䜿ã£ãŠå®è¡å¯èœã«ããŠããŸãã
人éãšã³ã³ãã¥ãŒã¿ã®éã§åªä»ãšãªã圹å²ãæãããæ瀺ãç解ããæ瀺ããç«å Žãå¯èœã«ããŸãããŸããããã°ã©ãã³ã°èšèªã¯ãœãããŠã§ã¢éçºã®ããã»ã¹ãããå¹ççã«ããããã«æé©åãããŠããŸãã
1.2 å€æ§ãªããã°ã©ãã³ã°èšèªã®ååšçç±
ããããã®ããã°ã©ãã³ã°èšèªã«ã¯ç¬ç¹ãªç¹æ§ãšé©å¿é åããããŸããPythonã¯ãã®æå¿«ãªææ³ãšèªã¿ãããããããŒã¿è§£æãAIã®åéã§å¹ åºã䜿çšãããŠããŸããJavaScriptã¯ãŠã§ããã©ãŠã¶ã§å®è¡å¯èœãªå¯äžã®èšèªãšããŠããŠã§ãéçºã®äž»æµãšãªã£ãŠããŸããCèšèªã¯äœã¬ãã«ã§ã®æäœãå¯èœã§ããããããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ãããã¯ãšã³ãã§äœ¿çšãããããšãå€ãã§ãã
ãã®ããã«ãããããã®èšèªããã€ç¹æ§ãšçšéã«ãããå€æ§ãªããã°ã©ãã³ã°èšèªãååšããŠããŸããããããçŸåšã§ã¯ããããã®èšèªã«ä»£ããæ°ããããã°ã©ãã³ã°èšèªãåŒãç¶ãæå ¥ãããŠããŸãããããã®æ°ããèšèªã¯ãããã»ãã¥ã¢ã§ãããå¹ççã§ããŸãã¯ç¹å®ã®ã¿ã¹ã¯ã«ç¹åããŠèšèšãããŠããããšãäžè¬çã§ãã
ãã®äžã€ãRustïŒã©ã¹ãïŒãšããããã°ã©ãã³ã°èšèªã§ããããããã¯Rustãšãã®ç¹æ§ã«ã€ããŠè©³è§£ããŠãããŸãããã
2. RustïŒã©ã¹ãïŒãšã¯ïŒ
ããŠã話é¡ãããã«æ¬é¡ã«ç§»ããŸãããããã®æ¬é¡ãšã¯ãããã°ã©ãã³ã°èšèªã®1ã€ã§ãããRustãã«ã€ããŠèªãããšã§ãããããããã説æããããã«ããŸãã¯æŠèŠãšãã®ç¹æ§ããã®åŸã§éçºã®èæ¯ãç®çããããŠãªãRustãããã»ã©ãŸã§ã«æ³šç®ãéããã®ãããšãã3ã€ã®ãã€ã³ãã«çŠç¹ãçµã£ãŠèŠãŠãããŸãããã
2.1 Rustã®æŠèŠãšãã®ç¹åŸŽ
Rustã¯ãMozillaãéçºãå§ããçŸåšã§ã¯å šäžçã®éçºè ã³ãã¥ããã£ããå¯äžãåããŠéçºãé²ããããŠããããã°ã©ãã³ã°èšèªã§ããRustã®æ倧ã®ç¹åŸŽã¯ãã®å®å šæ§ãšå¹çæ§ã§ãèšè¿°ããããã°ã©ã ã極ããŠæ£ç¢ºã«åäœãããã€ãã®å®è¡é床ã¯éåžžã«éããšããç¹æ§ãæã£ãŠããŸããããã«ããããã®ç¹æ§ã¯Rustã®ã³ã³ãã€ã©ãä¿èšŒããŠããããããéçºè ãå¿é ããå¿ èŠã¯ãããŸãããããã¯ä»ã®èšèªã§ã¯èŠãããªãéåžžã«ãŠããŒã¯ãªç¹åŸŽãšããŠå€ãã®éçºè ãã泚ç®ãããŠããŸãã
2.2 Rustãéçºãããèæ¯ãç®ç
Rustã¯ãå ã 2006幎ã«Mozillaã®ãšã³ãžãã¢ã§ããGraydon Hoareã®å人ãããžã§ã¯ããšããŠéçºãå§ãŸããŸããããã®äž»ãªåæ©ã¯ãå¹çãšå®å šæ§ãã®ãã¬ãŒããªãã解æ¶ããäž¡æ¹ãè¿œæ±ã§ããèšèªãéçºãããšããéå¿çãªç®æšã§ããããããããã€ã¬ãã«èšèªãšããŒã¬ãã«èšèªã®è¯ãç¹ãçµã¿åãããããšã§ãé«éãªããã©ãŒãã³ã¹ãšãé«åºŠãªå®å šä¿éãæäŸãã æå³ããã£ãŠèšèšãããŸããã
2.3 Rustã泚ç®ãããçç±
ãèšè¿°ã®ç°¡åãããšãããã©ãŒãã³ã¹ãã®ãã¬ãŒããªããå€ãã®ããã°ã©ãã³ã°èšèªã«ååšããŸãããRustã¯ãã®äž¡æ¹ãå ŒãåããŠããç¹ã§ä»ã®èšèªãšã¯äžç·ãç»ããŠããŸããèšè¿°ã¯çããªãã·ã³ãã«ã§ãããªãããçæããããã€ããªã®ããã©ãŒãã³ã¹ã¯é©ãã»ã©é«éã§ãããã¯ä»ã®æ¢åã®èšèªã§ã¯é£ããããšã§ãã
ããã«Rustã®ãã1ã€ã®åŒ·ã¿ã¯ãå®å šæ§ã®é«ãã§ããäžäŸãšããŠãRustã§ã¯ã¡ã¢ãªå®å šæ§ãã³ã³ãã€ã«æã«ç¢ºä¿ããããšãã§ããŸããããã«ãããéçºè ã¯ã³ãŒãã®äžã§èµ·ããå¯èœæ§ã®ããäžéšã®æ·±å»ãªåé¡ã«ã€ããŠå¿é ããããšãªããããéèŠãªåé¡ã«éäžããããšãã§ããŸãã
以äžã®ãããªçç±ãããRustã¯ããããçš®é¡ã®ã·ã¹ãã ãå®å šãã€å¹ççã«æ§ç¯ããããã®æ¥µããŠåŒ·åãªããŒã«ãšãªããå€ãã®é¢å¿ãåŒãã€ããŠããŸãã
3. Rustã®ç¹åŸŽã詳解
Rustãšããããã°ã©ãã³ã°èšèªãã©ã®ãããªç¹æ§ãæã€ã®ããç解ããããšã¯ããªããããäžçäžã®ããã°ã©ããŒã«éžã°ããããã«ãªã£ãã®ããç解ããäžã§éåžžã«éèŠã§ãããã®æãéèŠãªç¹æ§ã¯ããã®é«éæ§ãå®å šæ§ããšã©ãŒãã³ããªã³ã°èœåãå°ããªã©ã³ã¿ã€ã ããããŠã¯ãã¹ãã©ãããã©ãŒã 察å¿ã«ãããŸãã
3.1 é«éãªããã©ãŒãã³ã¹ãšäœã¬ãã«ã®å¶åŸ¡å
Rustã¯C++ãšäžŠã¶é«éãªããã©ãŒãã³ã¹ãæã€ãšåºãèªèãããŠããŸãã ãã®ããã©ãŒãã³ã¹ã¯ãã²ãŒã éçºãã·ã¹ãã éçºãªã©ãé床ãæ±ããããåéã§ã®æ¡çšãåŸæŒãããŠããŸãããã®é床ãæãªããã«ãRustã¯äœã¬ãã«ã®ã·ã¹ãã ã«å¯Ÿãã现ããå¶åŸ¡ãå¯èœã«ããŸããããã«ãããã¡ã¢ãªãã¹ã¬ããã®åŸ®èª¿æŽãå¯èœãšãªããéçºè ããã现ããã·ã¹ãã å¶åŸ¡ãè¡ããŸãã
3.2 å®å šæ§ïŒã¡ã¢ãªå®å šãšã¹ã¬ããå®å š
Rustã¯éçã¿ã€ãã®ã·ã¹ãã ãšæææš©ã¢ãã«ãçµã¿åãããããšã§ãã¡ã¢ãªå®å šæ§ãšã¹ã¬ããå®å šæ§ã確ä¿ããŠããŸãã ã¡ã¢ãªå®å šæ§ã¯ãRustã®ã³ã³ãã€ã©ãå®è¡åã«ã¡ã¢ãªã¢ã¯ã»ã¹ã®åé¡ãæ€åºãã解決ããããšãæå³ããŸãããŸããã¹ã¬ããå®å šæ§ã¯ãããŒã¿ç«¶åããããããã¯ãšãã£ããã«ãã¹ã¬ããããã°ã©ãã³ã°ã®åé¡ãåé¿ããèœåãæããŸãã
3.3 åªãããšã©ãŒãã³ããªã³ã°èœå
Rustã¯ãšã©ãŒãã³ããªã³ã°ã«ãResultãåãšãOptionãåãšãã2ã€ã®ç¹æ®ãªåãçšããŠããŸããããã«ãããæ瀺çã«ãšã©ãŒãã³ããªã³ã°ãã³ãŒãã§æ±ãããšãå¯èœã«ãªããŸãããResultãåã¯æåã瀺ããOkãããšã©ãŒã瀺ããErrãã®ã©ã¡ãããè¿ãããOptionãåã¯å€ãååšãããåŠãããSomeãããNoneãã§ç€ºããŸããããã«ãããããŸããšã©ãŒãã³ããªã³ã°ãè¡ãããšã§ããã°ã©ã ãæå³ããªãåäœãããã®ãé²æ¢ããããšãã§ããŸãã
3.4 æå°ã®ã«ã³ã¿ã€ã
Rustã®ã©ã³ã¿ã€ã ã¯éåžžã«å°ããããããã®èµ·åæéãçãããªãœãŒã¹ã®æ¶è²»ãæå°éã«çãŸããŸããããã«ãããããã©ãŒãã³ã¹ãå³ããæ±ããããå Žé¢ããªãœãŒã¹ã®éãããå Žé¢ã§ãRustã¯æŽ»èºããããšãã§ããŸãã
3.5 ã¯ãã¹ãã©ãããã©ãŒã 察å¿
æåŸã«ãRustã¯ã¯ãã¹ãã©ãããã©ãŒã ã«å¯Ÿå¿ããŠããã WindowsããmacOSãLinuxããããŠçµã¿èŸŒã¿ã·ã¹ãã ãŸã§ãå¹ åºããã©ãããã©ãŒã ã§åäœããŸããããã«ãããããŸããŸãªéçºç°å¢ã§Rustãå©çšããããšãã§ããæ°ãããã©ãããã©ãŒã ãžã®ç§»æ€ã容æã«ãªããŸãã
4. Rustã®å ·äœçãªå©çšã·ãŒã³
äžè¬çã«ãããã°ã©ãã³ã°èšèªã¯ç¹å®ã®åéãç¹å®ã®ã¿ã¹ã¯ã«åããŠããŸããããããRustã¯è²ã ãªé åã§ã®å©çšãæåŸ ã§ããŸãã以äžãããã€ãã®Rustã®å©çšã·ãŒã³ã«ã€ããŠè©³ãã説æããŸãã
4.1 ã·ã¹ãã ããã°ã©ãã³ã°
Rustã¯ã·ã¹ãã ããã°ã©ãã³ã°ã«ç¹åããèšèªã§ãã Rustã¯å®è¡æã®ããã©ãŒãã³ã¹ãæ±ããããé åã«ãããŠæé©ãªéžæè¢ãšãªãåŸãŸãããã®ããã©ãŒãã³ã¹ãå®å šæ§ã䞊ååŠçèœåã¯ãOSã®éçºããããã¯ãŒãã³ã°ã®æ§ç¯ãããã©ãŒãã³ã¹ãå¿ èŠãªã¢ããªã±ãŒã·ã§ã³ã®äœæãªã©ãã·ã¹ãã ããã°ã©ãã³ã°ã«ãããèŠä»¶ãæºãããŸãã
4.2 Webã¢ããªã±ãŒã·ã§ã³éçº
ãŸããRustã¯Webã¢ããªã±ãŒã·ã§ã³éçºã«ãæçšã§ããRustã«ã¯éåæããã°ã©ãã³ã°ãšã¡ã¢ãªå®å šæ§ããµããŒãããããã®åªããããŒã«ãå«ãŸããŠãããããã«ãããé«ãããã©ãŒãã³ã¹ãšå®å šæ§ãæã€ãµãŒããŒãµã€ãã®Webã¢ããªã±ãŒã·ã§ã³ãå¹çããæ§ç¯ããããšãå¯èœã§ãã
4.3 ã²ãŒã éçº
ããã«ãRustã¯ã²ãŒã éçºã«ãé©ããŠããŸãã ã¡ã¢ãªã®å®å šæ§ãšé«éãªå®è¡ããã©ãŒãã³ã¹ã®èŠä»¶ã¯ãã²ãŒã éçºã«ãšã£ãŠéèŠãªèŠçŽ ã§ãããŸããRustã¯ãã«ãã¹ã¬ãããå¹æçã«ç®¡çã§ããããããªã¢ã«ã¿ã€ã ã®ã¢ããªã±ãŒã·ã§ã³ã§ããã²ãŒã ã®éçºã«é©ããŠããŸããããã«ãRustã«ã¯Amethystãšãã£ãã²ãŒã ãšã³ãžã³ãªã©ã®è±å¯ãªãšã³ã·ã¹ãã ããããŸãã
4.4 çµã¿èŸŒã¿ã·ã¹ãã
æåŸã«ãRustã¯çµã¿èŸŒã¿ã·ã¹ãã ã«ã掻çšã§ããŸãã Rustã¯å¶åŸ¡ã®ç²åºŠãé«ãããããªãœãŒã¹ãå¶éãããŠããçµã¿èŸŒã¿ã·ã¹ãã ã«æé©ã§ããåæã«ãRustã®å®å šæ§ç¹æ§ã¯ãçµã¿èŸŒã¿ã·ã¹ãã ã®ä¿¡é Œæ§ãšå®å®æ§ãä¿ã€ããã«åœ¹ç«ã¡ãŸãããããã®çç±ãããRustã¯çµã¿èŸŒã¿ããã°ã©ãã³ã°ã®ããã®éžæè¢ãšããŠãŸããŸãèªèãããŠããŸãã
5. Rustã®ã€ã³ã¹ããŒã«æ¹æ³
ããã°ã©ãã³ã°èšèªã®äžã€ã§ããRustãåŠãã§ããããã«ã¯ããŸãã¯èªèº«ã®éçºç°å¢ã«Rustãã€ã³ã¹ããŒã«ããããšããå§ãŸããŸãããã®ã€ã³ã¹ããŒã«æ¹æ³ã¯äž»ã«2ã€ãã€ã³ã¹ããŒã©ã®å©çšãšã³ãã³ãã©ã€ã³ããã®ã€ã³ã¹ããŒã«ããããŸããç¹ã«é£ããæé ã¯ãªãã以äžã®æ¹æ³ã«åŸã£ãŠé²ããŠããã ãã§ç°¡åã«Rustã䜿ãå§ããããšãåºæ¥ãŸãã
5.1 ã€ã³ã¹ããŒã©ã®å©çš
ã€ã³ã¹ããŒã©ã®å©çšã¯ãç¹ã«ããã°ã©ãã³ã°ãåããŠè¡ãæ¹ããRustã«éãããœãããŠã§ã¢ã®ã€ã³ã¹ããŒã«ãåããŠã®æ¹ã«ããããã®æ¹æ³ã§ããå ãã¯Rustã®å ¬åŒãŠã§ããµã€ããã察å¿ããOSã®ã€ã³ã¹ããŒã©ãããŠã³ããŒãããŸããããŠã³ããŒããå®äºããããã€ã³ã¹ããŒã©ãéããç»é¢ã®æ瀺ã«åŸã£ãŠé²ããŠããã ãã§ãããã®æ¹æ³ã§ããã°ãã³ãã³ãã©ã€ã³ã䜿ããã«ç°¡åã«Rustãã€ã³ã¹ããŒã«ããããšãåºæ¥ãŸãã
5.2 ã³ãã³ãã©ã€ã³ããã®ã€ã³ã¹ããŒã«
次ã«ãã³ãã³ãã©ã€ã³ããã®ã€ã³ã¹ããŒã«æ¹æ³ã«ã€ããŠèª¬æããŸãããã®æ¹æ³ã¯ãã¿ãŒããã«ãã³ãã³ãããã³ãããªã©ã®ã³ãã³ãã©ã€ã³ã䜿ã£ãŠRustãã€ã³ã¹ããŒã«ããŠãããŸãããã®æ¹æ³ã®å©ç¹ã¯ãå šãŠã®æé ãäžã€ã®ç»é¢ã§å®çµããããšãåºæ¥ããŸãå ·äœçãªã³ãã³ãã«ããæäœãåŠã¶ããšãåºæ¥ãç¹ã§ãã
Rustã®ã€ã³ã¹ããŒã«ã¯RustupãšããããŒã«ã䜿çšããŸããRustupã¯ãRustæ¬äœã®ã€ã³ã¹ããŒã«ãããŒãžã§ã³ç®¡çãã³ã³ãã€ã©ã®ã€ã³ã¹ããŒã«ãªã©ãäžæã«æ ã䟿å©ãªããŒã«ã§ããããã䜿ãããšã§ãå¿ èŠãªå šãŠã®ãã®ãäžæ¬ã§ç®¡çã»ã€ã³ã¹ããŒã«ãããã®ã§ãéåžžã«äŸ¿å©ã§ãã
ãŸããRustupã®å ¬åŒããŒãžããã€ãã·ã£ã«ã¹ã¯ãªãããããŠã³ããŒãããŸããããŠã³ããŒããããã¿ãŒããã«ãéãã以äžã®ã³ãã³ããå®è¡ããŸããã ãããæ°åããããããããŸããã
$ curl https://sh.rustup.rs -sSf | sh
ãã®ã³ãã³ããå ¥åããŠEnterããŒãæŒããšãRustãã€ã³ã¹ããŒã«ãããã®ããã åŸ ã€ã ãã§ããã€ã³ã¹ããŒã«ãå®äºããããã¿ãŒããã«ãåèµ·åããŠãã¹ãéã£ãŠããããšã確èªããŸãããã以äžã®ã³ãã³ããå ¥åããŠãããŒãžã§ã³æ å ±ã衚瀺ãããã°Rustã®ã€ã³ã¹ããŒã«ã¯å®äºããŠããŸãã
$ rustc --version
以äžãã³ãã³ãã©ã€ã³ããRustãã€ã³ã¹ããŒã«ããæ¹æ³ã§ããã³ãã³ãã©ã€ã³ã«æ £ããŠããæ¹ããŸãã¯ããããæ £ããŠãããããšããæ¹ã¯ãã²ãã®æ¹æ³ãè©ŠããŠã¿ãŠãã ããã
6. Rustã®åºæ¬çãªææ³ãšã³ãŒãã£ã³ã°ã¹ã¿ã€ã«
ããã°ã©ã ãæžãäžã§æãéèŠãªèŠçŽ ã®äžã€ãã䜿çšããèšèªã®ææ³ãšã³ãŒãã£ã³ã°ã¹ã¿ã€ã«ã§ããããã§ã¯ãRustã®åºæ¬çãªææ³ãšã³ãŒãã£ã³ã°ã¹ã¿ã€ã«ã«ã€ããŠè©³ãã解説ããŠãããŸãã
6.1 å€æ°ãšããŒã¿ã¿ã€ã
Rustã§ã¯ãæ°å€ãæååãè«çå€ãªã©æ§ã ãªããŒã¿ã¿ã€ããæ±ãããšãã§ããŸããå€æ°ã¯ãletãããŒã¯ãŒãã䜿çšããŠå®çŸ©ããŸããããã«ç¶ããŠå€æ°åãšããŒã¿ã¿ã€ãããããŠãã®å€ãã»ããããŸããäŸãã°ããlet x: i32 = 10;ããšããããšã§ããxããšããååã®32ãããæŽæ°åã®å€æ°ãå®çŸ©ãããã®åæå€ãšããŠ10ãèšå®ããŠããŸãã
6.2 é¢æ°ãšå¶åŸ¡æ§æ
é¢æ°ã¯ããfnãããŒã¯ãŒãã䜿çšããŠå®çŸ©ããŸããäŸãã°ãfn hello() -> &’static str { “Hello, Rust!” }ããšããããšã§ããhelloããšããååã®é¢æ°ãå®çŸ©ãããã®æ»ãå€ãšããŠã”Hello, Rust!”ããšããæååãè¿ããŸããå¶åŸ¡æ§æã«ã¯ããifãããelseãããwhileãããforããªã©ããããŸããããããçµã¿åãããããšã§ãæ§ã ãªã«ãŒãã³ãäœæããããšãå¯èœã§ãã
6.3 ã¢ãžã¥ãŒã«ãšã¯ã¬ãŒã
Rustã«ã¯ãã³ãŒããæŽçãåå©çšããããããããã®ãã¢ãžã¥ãŒã«ããšãã¯ã¬ãŒããã®æŠå¿µããããŸãããmodãããŒã¯ãŒãã䜿çšããããšã§æ°ããªã¢ãžã¥ãŒã«ãäœæããããšãã§ããäžæ¹ãuseãããŒã¯ãŒãã䜿çšããããšã§ä»ã®ã¢ãžã¥ãŒã«ãã¯ã¬ãŒãããé¢æ°ãå€æ°ãåŒã³åºãããšãã§ããŸããããã«ãããã³ãŒããããç°¡æœã«ããåå©çšããããããŠããŸãã
6.4 ã¡ã¢ãªç®¡çã®ä»çµã¿
Rustã®ç¹åŸŽçãªéšåã§ãããã¡ã¢ãªç®¡çã®ä»çµã¿ã«ã€ããŠè§£èª¬ããŸããæææš©ãšããæŠå¿µãäžå¿ã«ãã ãŒãã»ãã³ãã£ã¯ã¹ãšåçšããããŸãããã®ä»çµã¿ããRustã®å®å šæ§ãšããã©ãŒãã³ã¹ã®é«ããäž¡ç«ããããšãå¯èœã«ããŠããŸãã
6.5 Rustã®ãšã©ãŒãã³ããªã³ã°æ¹æ³
Rustã§ã¯ãšã©ãŒãã³ããªã³ã°ã«ãResultãããOptionããªã©ã®åæåïŒenumïŒã掻çšããŸãããããã¯ãé¢æ°ã®æ»ãå€ãšããŠæ£åžžãªå€ãŸãã¯ãšã©ãŒãè¡šãå€ãå«ãããšãã§ããŸããå®éã®ã³ãŒãäžã§ã¯ãmatchãæã䜿ã£ãŠãããã®æ»ãå€ãåŠçããŸããããã«ããRustã¯ããšã©ãŒã«å¯Ÿããããã¹ããªå¯Ÿå¿ãå¯èœã«ããŠããŸãã
7. Rustã®ã³ãã¥ããã£ãšåŠç¿ãªãœãŒã¹
Rustã®åŠç¿ã«æçšãªãªãœãŒã¹ãšã³ãã¥ããã£ã«ã€ããŠèª¬æããŸããããããå©çšããã°ãRustã®ã³ãŒãã£ã³ã°ã¹ãã«ãããã«åäžãããããšãå¯èœã§ãã
7.1 Rustã®å ¬åŒããã¥ã¡ã³ããŒã·ã§ã³
Rustã®å ¬åŒããã¥ã¡ã³ããŒã·ã§ã³ã¯éåžžã«è©³çŽ°ã§ãåžžã«ææ°ã®æ å ±ãæŽæ°ãããŠããŸããRustã«é¢ããçåãå°ã£ããšãã«ã¯ããŸãå ¬åŒããã¥ã¡ã³ããŒã·ã§ã³ãåç §ããããšããå§ãããŸããããã«ãããRustã®è±å¯ãªæ©èœãã¢ãžã¥ãŒã«ã«ã€ããŠç解ãæ·±ããããšãå¯èœã§ãã
7.2 ãã©ãŒã©ã ãšã³ãã¥ããã£
ãŸããRustã«ã¯æŽ»çºãªãã©ãŒã©ã ãšã³ãã¥ããã£ããããŸãããããã¯åå¿è ããäžçŽè ãŸã§ãããŸããŸãªã¬ãã«ã®ãŠãŒã¶ãŒã«å¯Ÿå¿ããŠããŸãã質åãããããã£ã¹ã«ãã·ã§ã³ããããèªåã®ç¥èãä»ã®äººãšå ±æãããããããšãã§ããŸãã ãããã®ã³ãã¥ããã£ãå©çšããããšã§ãèªåã ãã§ã¯è§£æ±ºã§ããªãã³ãŒãã£ã³ã°ã®åé¡ã«å¯ŸããçããèŠã€ããããšãã§ããŸãã
7.3 ãã¥ãŒããªã¢ã«ãšåŠç¿ã¬ã€ã
æåŸã«ãRustã®ãã¥ãŒããªã¢ã«ãšåŠç¿ã¬ã€ããéåžžã«äŸ¡å€ããããŸãããããã¯å ·äœçãªããã°ã©ãã³ã°ã®ã¿ã¹ã¯ãéããŠãRustãå¹ççã«åŠã¶ã®ã«åœ¹ç«ã¡ãŸããç¹ã«”The Rust Programming Language”ãšããæ¬ã¯ããRustaceanãïŒRustã³ãã¥ããã£ã®ã¡ã³ããŒãæãèšèïŒã«ã¯å¿ èªã®æžç±ãšãããŠããŸãã ããã«ã¯ãåºæ¬çãªææ³ããé«åºŠãªãããã¯ãŸã§ãåºç¯å²ãªå 容ãå«ãŸããŠããŸãã
8. Rustã®çŸåšãšãããã
ããã°ã©ãã³ã°èšèªã®äžçã¯æ¥ã å€åããæ°ããªæè¡ãçãŸããæ¢åã®æè¡ãé²åãããŸãæã«ã¯å»ããŠãããã®ã§ãããããªäžã§ãçŸåšæŽ»èºããRustã®äœçœ®ãšãããããã®å±æã«ã€ããŠèå¯ããŠã¿ãŸãããã
8.1 Rustã®ææ°åå
Rustã¯ããã®ç¹ç°ãªç¹æ§ããæšæºçãªã¢ããªã±ãŒã·ã§ã³éçºããçµã¿èŸŒã¿ã·ã¹ãã ãã²ãŒã éçºãŸã§å¹ åºãå©çšãããŠããŸãããŸãããªãŒãã³ãœãŒã¹ã³ãã¥ããã£ã®äžã§ããããã©ãŒãã³ã¹ãšå®å šæ§ãäž¡ç«ãããèšèšææ³ãè©äŸ¡ãããåºãåãå ¥ããããŠããŸãã
ãã®äžæ¹ã§ãRustã¯åŠç¿ã³ã¹ãã®é«ãããä»ã®èšèªãšã®èŠªåæ§ã«èª²é¡ãæ±ããŠããŸããããããéçºããŒã ãã³ãã¥ããã£ã¯ãããã®åé¡ã解決ãã¹ããç©æ¥µçã«éçºãé²ããŠããŸããããšãã°ãé«ã¬ãã«ãªã©ã€ãã©ãªã®æäŸãææã®å å®ã«ããããã䜿ããããã芪ãã¿ãããèšèªãç®æããŠããŸãã
8.2 Rustã®ä»åŸã®å±æ
ãããŸã§ã®ååãèžãŸããRustãä»åŸã©ã®ããã«çºå±ããŠãããèããŠã¿ãŸãããã
ãŸãäžã€ã«ã¯ãæ¢åã®ããã°ã©ãã³ã°èšèªãžã®ã圱é¿åããæããããŸããã¡ã¢ãªå®å šæ§ã確ä¿ãã€ã€é«ããã©ãŒãã³ã¹ãå®çŸãããšããRustã®èšèšææ³ã¯ãä»ã®ããã°ã©ãã³ã°èšèªã®èšèšè ã«ãšã£ãŠã倧ãã«åèã«ãªãã§ããããããããã®ããã°ã©ãã³ã°èšèªèšèšã®æµããRustãå·Šå³ããå¯èœæ§ããããŸãã
ãŸããRustèªäœã®é²åãèŠéããŸãããæ¢åã®åé¡ç¹ã解決ããããå€ãã®éçºè ã«äœ¿ãããããã«ãªãã°ãããå€æ§ãªçšéã§ã®æŽ»çšãèããããŸããå ·äœçã«ã¯ãWebããã³ããšã³ãã®éçºãããŒã¿ãµã€ãšã³ã¹ãæ©æ¢°åŠç¿ãªã©ã®åéã§ã®æ¬æ Œçãªå©çšãæåŸ ãããŠããŸãã
ããã«ãRustã¯ã·ã¹ãã éçºã ãã§ãªããæè²ã®çŸå Žã§ã®æŽ»çšãæåŸ ãããŠããŸãããã®çç±ãšããŠãRustã¯äœã¬ãã«ã®ããã°ã©ãã³ã°ãšé«ã¬ãã«ã®æœè±¡åãåæã«æããããšãã§ããç¬èªã®ç¹æ§ããããŸãããã®ç¹æ§ãè©äŸ¡ãããæè²ã®å Žã§ãç©æ¥µçã«æ¡çšãããããã«ãªãã°ãæ°ããªã°ããŒã¹ã®éãéãããããããŸããã
以äžã®ããšãããä»åŸã®Rustã«ã¯å€§ããªæåŸ ãå¯ããããŠããŸãããã¡ããããã®éã®ãã¯å¿ ãããé 颚æºåžã§ã¯ãªããããããŸãããããããRustãç®æãçæ³çãªããã°ã©ãã³ã°èšèªã®å§¿ã¯ãå€ãã®éçºè ã«ãšã£ãŠå€§ããªé åãšãªã£ãŠããŸãã
9. ãŸãšã
以äžãæ¬èšäºã§ã¯ãããã°ã©ãã³ã°èšèªã®åœ¹å²ã«ã€ããŠåŠã³ããã®äžã§ã泚ç®ãããŠããé«æ§èœãªããã°ã©ãã³ã°èšèªãRustã«çŠç¹ãåœãŠãŠè§£èª¬ããŠããŸããã
Rustã®ç¹åŸŽãå©çšã·ãŒã³ãã€ã³ã¹ããŒã«æ¹æ³ãåºæ¬çãªææ³ããããŠã³ãã¥ããã£ãšãã£ããŠãŒã¶ãŒã®æ¯ãã«ã€ããŠè©³ãã解説ããŸããããããã®æ å ±ãããRustã®ãã¯ãã«ããšå€æ§æ§ãããã«ã¯ãã®å®å šæ§ãšãã£ãèŠçŽ ããä»åŸã®ãœãããŠã§ã¢éçºå šäœã«ãããå¯èœæ§ãåºããŠããäžç«¯ãæ ã£ãŠããããšãç解ããŠããã ãããšæããŸãã
ãã¡ãããã©ã®ããã°ã©ãã³ã°èšèªãäžé·äžçããããŸãããRustã¯ãã®é«éæ§ãšå®å šæ§ããããŠäœ¿ãããããå Œãæãããããããå€æ§ãªéçºçŸå Žã§ã®æŽ»çšãæåŸ ãããŠããŸãã
ãããŠäœãããããã°ã©ãã³ã°ãšã¯ãåã«ã³ãŒããæžãã ãã§ãªããããã°ã©ã ãäœãããã®ããç解ããããšããããŠãããããã«å¹çãããå®å šã«å®çŸããããèããæè¡ã§ããRustã¯ãã®éã«éèŠãšãªãã¡ã¢ãªç®¡çããšã©ãŒãã³ããªã³ã°ã®åé¡ãåªããç¹æ§ã§è§£æ±ºããéçºè ãã¡ã®ã¯ãªãšã€ãã£ããªå¯èœæ§ãåŒãåºããŸãã
æ¬èšäºããçæ§ã®åŠç¿ã®äžå©ãšãªããRustã®æ·±æãã楜ãããã£ããã«ãªãã°å¹žãã§ããRustã®äžçãžã®æ ãæ¯éãšãã楜ãã¿ãã ããã絶ããé²åããRustã®ã³ãã¥ããã£ã«ã¯ãæ°ããªçºèŠã仲éãåŸ ã£ãŠããŸãã