7幎ã¯å€ãã®äººã ã®ç掻ã«ãšã£ãŠéèŠãªæ代ã§ãããç§ãã¡ãåŠæ ¡ã«éãå§ãããšãã®æé·ã®æ°ãã段éã®è±¡åŸŽçãªãã€ã«ã¹ããŒã³ã§ãã ããã¯7幎ã®ããã§ã-ããã»ã©ã§ã¯ãããŸããããããã§ãååã§ã¯ãããŸããã ããã°ã©ãã³ã°èšèªã人ãšããŠæ瀺ãããå Žåãä»æ¥ã1幎çã®Goã®èªçæ¥ãç¥ããŸãã圌ã¯7æ³ã§ãã
Goã®æŠèŠãšãã®åªããç¹ã«ã€ããŠã¯èª¬æããŸããã察象è ã¯ãã®æ¹æ³ãç¥ã£ãŠãããæ®ãã¯Wikipediaã§èªãããšãã§ããŸãã æšæ¥ãåå¿è åãã®trapãèœãšãç©Žãããããééãã®50é調ã®Goã®äŸ¿å©ãªç¿»èš³ãçãããšå ±æããŸããããããŠä»æ¥ãGoã§æžããŠããéçºè ã«ãã®èšèãäŒããŠããŸãã èšå¿µæ¥ãèšå¿µããŠãããããã«3ã€ã®è³ªåãããŸããã
- ãªãGoïŒè³åŠäž¡è«ïŒãéžãã ã®ã§ããïŒ
- Goã§ãã§ã«äœãæžããŠããŸããïŒ
- GoãåŠã¶ããã®æè¯ã®æ¹æ³ã¯äœã§ãããåå¿è ã«ã¯äœããå§ãããŸããïŒ
ããã«åœŒããçãããã®ããããŸãã
ãã¯ã¿ãŒãMail.Ruã¡ãŒã«ããã°ã©ããŒ
Goã§æžããããããžã§ã¯ãã§ããã€ãã®ã¿ã¹ã¯ãå®è¡ãããšããäºå®ããå§ãŸããŸããã ç§ã¯ããã奜ãã§ãåå ããŸããã Goã¯ãããã©ãŒãã³ã¹ãšã³ãŒãã®èšè¿°/ä¿å®ã®å®¹æãã®ç¹ã§ãæ°ããã¿ã¹ã¯ã«é©ããŠããŸãã é·æïŒã³ãŒãã®èªã¿ããããäºæž¬å¯èœæ§ãGoã¢ããªã±ãŒã·ã§ã³ã®ããã©ãŒãã³ã¹ã çæïŒCã³ãŒããšã®äžå®å šãªçµ±åã
ãããŸã§ã«ãMail.Ru Mailã®blobãªããžããªãäœæããŸãããããã«ã¯ãã»ãšãã©ïŒãã ãå®å šã§ã¯ãªãïŒæåã®æ¬æãæ ŒçŽãããŠããŸãã ãŸããGo on Mailã®æžãçŽãã«ã圹ç«ã¡ãŸããã
Goãéå§ããã«ã¯ã tour.golang.orgãæ¢çŽ¢ããã ãã§ååã§ãã æšæºã©ã€ãã©ãªã«ã¯ãããã»ã©è€éã§ã¯ãªãWebãµãŒãã¹ãäœæããããã®ã»ãŒãã¹ãŠã®ãã®ããããŸãã ããŒã¿ããŒã¹ã³ãã¯ã¿ããªãéãããµãŒãããŒãã£ããããã«å¿ èŠã«ãªããŸãã Goã¯éåžžã«ã·ã³ãã«ã§ãè€éãªçè«ãcãªè«çæŠå¿µã¯ãªããä»æ§ã®ãèããå Žæã¯ã»ãšãã©ãããŸããã ã³ãŒããæžããŠããéã«èšèªãåŠã¶ã®ãæåã®ããã«æããŸãã
ãã³ãïŒ
- Goã«ã€ããŠäœããã°ãŒã°ã«ããããšã¯ããgolangããšããèšèã䜿ã£ãã»ããè¯ãã§ãã
- ããã«ãã³ããŒçšã®ãŠãŒãã£ãªãã£ã䜿çšããããšããå§ãããŸã ã
- ã³ã³ãã€ã©/ã©ã³ã¿ã€ã ã«ã€ããŠçåãããå Žåã¯ãGoã§ãœãŒã¹ã³ãŒãã確èªã§ããŸãã èªã¿ããããã³ã³ãã€ã©ãä»å±ããŠããŸãã
ããã€ã«ããªãŒãããã°ã©ããŒmyTarget
ã以åã¯äœãç¥ã£ãŠããã®ãããããããŠããŸããã ã€ã³ã¿ãŒãããããæ°ããããã°ã©ãã³ã°èšèªãç¥ã£ãŠããã®ã¯è¯ãããšã ãšç¢ºä¿¡ãããšãã éåžžã®C ++ãPythonã®ã»ãã«ãä»ã®äººã ãã§ãªããæ°ãããã®ããããŸããæªæ¥ã¯åœŒãã«ãããŸãã RustãGoãScalaã«ç®ãåããŸããã ãããåæã«ãç§ãåŠãã§ããèšèªãç§ã«ãšã£ãŠæçšã§ããããšãæ¬åœã«æãã§ããŸããã çŽ3幎åãç§ã¯ErlangïŒããã³FPå šäœïŒã«å€¢äžã«ãªããŸãããã5幎åŸã§ã¯ãªããC ++ã§ããããéã皌ãããšãã§ããªãããšã«æ°ä»ããŸããã Scalaãèœã¡ãã®ãšåãçç±ã§ïŒç³ãèš³ãããŸããããéåžžã«èå³æ·±ãããã«æããŸããïŒããã®èšèªã¯Javaã®æ·±å»ãªèæ¯ãæ瀺ããŠããŸãã Rustã¯ããã«æ°ã«å ¥ããªãã£ãã ã¡ãªã¿ã«ãC ++ã®åŸã¯ãäž»ã«æè»æ§ãšããç¹ã§å€ãã®ããšãæããã§ãã
ããããGoã«ã¯è±å¯ãªæšæºã©ã€ãã©ãªãããããŽã«ãŒãã³ãéçºäžãæ·±å»ãªãã®ãæžãããŠããŸãïŒDockerãDropboxïŒã ãããŠ-ç§ãæ°ã«å ¥ããªãã£ããã®ã®è£è¿ã-Goã«ã¯å°ãç°ãªãèãæ¹ãå¿ èŠã§ãã C ++ãPythonã®ãããªOOPã§ã¯ãããŸããã ããããã«ç°ãªãèãæ¹ããç¿åŸãããšãããã®èŠéãã¯ç§ãé äºããŸãã
å®çšçãªéèèŠçŽ ãåããGoãåªããŠããŸãã ãã®ç¯å²ã¯ç§ã®ãæ°ã«å ¥ãã®ããã¯ãšã³ãã§ãã ã€ãŸããC ++ãç§ã®ã¡ã€ã³èšèªã®ãŸãŸã§ããã絊äžã倱ãããšãªããåãè·å Žã§Goã§å°ããã€ã¿ã¹ã¯ã解決ãããŸãã ãããŸã§ã®ãšãããGoã§äœæããã®ã¯ãé³æ¥œã³ã¬ã¯ã·ã§ã³ã®ã¿ã°ãèªèããŠè£å ããããã®ãŠãŒãã£ãªãã£ã®ã¿ã§ãã ãã®ãšããç§ã¯èšèªãç¥ãå§ããã°ããã§ããã ãããããGoã¯ãã®ãããªã¿ã¹ã¯ãç®çãšããŠããªãããšã«æ°ä»ããŸããã
ãããŠãç§ã¯éç£ã³ãŒããæžããŸããããããã¬ãã¥ãŒããŸãã ã³ãŒãäœæè ãšGoããã¹ã¿ãŒããã ç§ã¯åå¿è ãªã®ã§ãå匷ã®èšç»ããå ±æã§ããŸããã
- æåã«äœããèªã¿ãæ§æã«ç²Ÿéããããã¥ã¡ã³ããèŠã€ããŸãïŒå®äºïŒã
- äœããæžããŠã¿ãŠããããå¿ èŠãã©ãããèªåã§æ±ºããŠãã ããïŒå®äºïŒã
- ãŸã å¿ èŠãªå Žå-ã³ãŒããæžããŠãä»ã®äººãèªãã§ãæžããŠã話ãåã£ãŠãæžããŠãã³ãŒããèªãã§ãèšäºãèªãã§ãæžããŠãæžããŠããããããªãã¯ãªã©ãã¯ã¹ããŠãGoã«é¢ããæ¬ãèªãã§ãæžããŠã話ãåã£ãŠãæžããŠãã ããã äžè¬çã«ãäž»ãªããšã¯ç·Žç¿ã§ãã
IlyaãMail.Ruã¡ãŒã«ããã°ã©ããŒ
äœïŒC ++ãPHPãJavaãObjective-CïŒã§å€ãã®ããã°ã©ã ãäœæã§ããŸããã Mail.Ru Groupã«åå ããåã«ã圌ã¯Perlã§æžããŠããŸããã ãããæžãããšã¯å¯èœã§ããããæŽå²çã«åœ¢æããããæãããã³ãŒãããããããããããå Žæã«ãã£ãŠã¯æ²ãããã®ã§ãã ããæç¹ã§ãGoãšRustã«ã€ããŠã»ãŒåæã«èããã®ã§ãè©ŠããŠã¿ãããšã«ããŸããã ãã£ãšè¡ãã®ã奜ãã ã£ãã æéãçµã€ã«ã€ããŠãç§ã¯èªåã®ä»äºã§ããã䜿çšããæ¹æ³ãèŠã€ããŸããã é·æ-ã·ã³ãã«ããã³ã³ãã€ã«èšèªãå³å¯ãªåæå®ãéçã³ã³ãã€ã«ã
ç§ã¯Goã§2ã€ã®Mail.Ru Groupãããžã§ã¯ãã®ããã«æžããŸãããCarsMail.Ruã®å Žåãå€éšãœãŒã¹ããç»åãããŠã³ããŒãããããã®éåæãã¹ãã€ããŒããæžããããŠã³ããŒããæ©æã«åæ¢ããå¯èœæ§ããããŸãã Mail.Ru Mailã®å Žå-ããŒãµãŒ/ããŒãµãŒ/ãã°ã®éä¿¡è ã æ®ãã¯å®¶åºçšã®æ圱ã§ãããå®éšçãªæ圱ã§ãã
GoãåŠã³ãã人ã¯ãã³ãŒãã®èšè¿°ãšã°ãŒã°ã«ã®äœæãéå§ããå¿ èŠããããŸãã ãã¶ãããªãã¯ããã奜ããããããŸããããããã§ã¯ãªããããããŸããã å€æ°ã®ãããªãã¥ãŒããªã¢ã«ãèšäºããããŸãã Goã«ã¯ãå€ãã®äººãæ°ã«å ¥ããªããããããªãç¬èªã®ãããããããŸãã :)èšèªã¯éåžžã«ã·ã³ãã«ã§ãå°ãéæ³ããããŸãã Perlãšæ¯èŒãããšãã»ãšãã©ååšããŸããã è¯ãæ¬ãåºçãããŠããŸãïŒAlan A. A. DonovanãBrian W. KernighanãGo Programming Language; Mark SummerfieldãGo ProgrammingãDevelopment of 21st Century ApplicationsïŒãGoéçºãžã®ããé©åãªã¢ãããŒãã䜿çšããããç解ããã®ã«åœ¹ç«ã¡ãŸãããŒã«ã§ã
ããã·ã ãMail.Ru Mailã®ã€ã³ã¿ãŒã³
ã€ã³ã¿ãã¥ãŒã«æ¥ããšããMail.Ru Mailããã¯ãšã³ãã®Céçºè ã®ããžã·ã§ã³ãç³è«ããŸããã ãããŠãã¯ã¿ãŒã¯ç§ã«ã€ã³ã¿ãã¥ãŒããŸããã 察話ã¯ãã®ãããªãã®ã§ããã
-Cã§æžããŸããïŒ ãŽã£ãã£ã¢ã«å°ããã
ãããã§ããªããç§ã¯æ£çŽã«çããã
-ãªãã§ïŒ
-ããã«ããããããããããŸãã
ãåæããããããç§ã®ãšããã«æ¥ãŠãã ãããGoã§æžããŠãCã§ã¯æžããªãã§ãããããšãã¯ã¿ãŒã¯ãå·§åŠã«ç®ã现ããã
ãäœããæãã§ããæµè¡ã«ææãªäººã¯Goã«æžã蟌ã¿ãŸããç§ãã¡ã¯æ·±å»ãªããšãããå¿ èŠããããŸãããšç§ã¯çããã»ãšãã©ãã¹ãŠã«åæããŸããã
-ã¯ãããã¹ãŠãæ£åžžã§ããç§ã¯æ¯ãäžããŸãïŒ -ãã¯ã¿ãŒã¯èšã£ã...
ããã§ç§ã¯éçºè ã«ãªããŸããã ãããããã¡ãããCã«ã¯ä»äºããªãã£ãããã§ã¯ãããŸããã ããã°ã©ãã³ã°èšèªã§ã®èšè¿°æ¹æ³ããã§ã«ç¥ã£ãŠããããçªç¶çã®éãéžæããŠGoãéžæããå Žåãå³å¯ãªåã·ã¹ãã ã«æ £ããå¿ èŠããããŸãã ããå€ãã®ã€ã³ã¿ãŒãã§ã€ã¹ã䜿çšããç¶æ¿ãæžãããŸãã
Goãæåã®ããã°ã©ãã³ã°ãšã¯ã¹ããªãšã³ã¹ã§ããå Žåãåãã§ãã ããã PythonãRubyãJavaã«æ¯ã¹ãŠæ§æã®æ§æèŠçŽ ãã¯ããã«å°ãªããããåŠç¿ãå°ãç°¡åã«ãªããŸãã Goã¯æããšã¬ã¬ã³ããªèšèªã§ã¯ãããŸããããéåžžã«è¡šçŸåããããŸãã èšå€§ãªæ°ã®è£å©ããŒã«ïŒgofmtãgoimportsãgovet ...ïŒã¯ãå€ãã®åä»ãªåé¡ãå¿ããã®ã«åœ¹ç«ã¡ãŸãã
æåã«ã å¹æçãªgoæçš¿ãèªãããšããå§ãããŸãã ãªã©ãã¯ã¹ããŠã å¹æçãªgoãèªã¿çŽãããã°ããããŠããå¹æçãªgoãããäžåºŠèŠãŠãã ããã å¹æçãªç§»åã¯ããã»ã©èµ·ãããŸãããæã èªã¿çŽã䟡å€ããããŸãã 誰ããèšèªã¡ã¢ãªã¢ãã«ãç解ãïŒãããŠäžéšã®äººã¯èš±ãïŒãèŠããŠããããšãéèŠã§ãã 代ããã«ãéä¿¡ããŠã¡ã¢ãªãå ±æããŠãã ãã ã ã
AlexanderãMail.Ru Mailã®ãžã¥ãã¢ããã°ã©ããŒ
1æãç§ã¯Céçºè ãšããŠã€ã³ã¿ãŒã³ãšããŠæ¥ãŸããã åæ¥ãååãå°ããŸããïŒGoã§æžãããã§ããïŒ åæããã ããã§ãã¹ãŠãèµ·ãããŸããã Syshnyã®ã¡ãã»ãŒãž/ã¹ããŒã¿ã¹ã®ã¢ãããŒãã«ã€ããŠããã¡ãŒã«ã¹ã¬ãããPerlããGoã«æžãçŽããŸããã ä»ãPerl / Cã§ã¡ãŒã«APIãæžãçŽããŠããŸãã ãªãŒãã³ãœãŒã¹ãããžã§ã¯ããžã®æ¬²æ±ã¯ãŸã ååã§ã¯ãããŸããã :(
åå¿è ã¯æåã«tour.golang.orgã確èªããå¿ èŠããããŸã :)ã ãã®åŸã
http.HandleFunc
ã䜿çšããŠãæšæºã©ã€ãã©ãªã®ã§ããã ãå€ãã®æ©èœãã«ããŒããç¬èªã®APIãµãŒãã¹ãäœæããŠã¿ãŠãã ããã ãããŠãç¬èªã®
http.HandleFunc
æžããŠãã ãã:)
ããŒãã³ããããªãµãŒãã¹éçºã°ã«ãŒãã®ããã°ã©ããŒ
Mail.Ru Groupã«æ¥ããšããã¡ã€ã³ããã¯ãšã³ãã¯NodeJS on Goã«å¯Ÿå¿ããŠããŸããã ã ããããã®å²Goã¯ç§ãéžãã ããç§ã¯æºè¶³ããŠããã Goã«ã¯ãNodeJSããã3ã€ã®å€§ããªå©ç¹ããããŸãã
- éçåä»ã;
- ã·ã³ãã«ã ãææ ®æ·±ãç°å¢ã
- åªããéåæ/競åã³ã³ãã¥ãŒãã£ã³ã°ã¢ãã«ã
Goã¯ã·ã³ãã«ããéèŠããŠããããããæ°ã«å ¥ã£ãŠããŸãã ãã ããåçŽããç ç²ã«ããå¿ èŠããããŸãã ããšãã°ããžã§ããªãã¯å»è¬åã®äžè¶³ã ãŸããèªå販売ã«ãã£ãŠãã¹ãŠã®åé¡ã解決ãããããã§ã¯ãããŸããã ãã ããGoã¯æãåºãç¯å²ã®èšèªãšããŠèããããŠããªãããšãèŠããŠããå¿ èŠããããŸãããããã£ãŠãGoã®ããããªãºã ã¯å€§éšåãæ£åœåãããŸãã
Goã§ã®ç§ã®éçºçµéšã¯ããŸã ãã€ã¯ããµãŒãã¹ãšã³ã³ãœãŒã«ãŠãŒãã£ãªãã£ã«éå®ãããŠããŸãã Goã«æ £ããã«ã¯ãä»æ§æžãéããŠãå¯ãåã«20åéèªãã§ããããããä¹ãè¶ãããŸã§ïŒåè«ã§ãïŒãå§ãããŸãã ãã¡ãããèšèªãç¿åŸããããã«ã¯ããã®èšèªã«ã€ããŠæžãå¿ èŠããããŸãã ãŸããã€ãã£ãªã ããã¹ã¿ãŒããã«ã¯ãæšæºã®Goã©ã€ãã©ãªã®ã³ãŒãã調ã¹ãŠã¿ããšããã§ãããã å¹æçãªgoããå§ãããŸã ã
Dmitryãã¹ã¿ãžãªAllodsããŒã ã®ããã°ã©ããŒ
äž»ã«Goãéžæããã®ã¯ãéåæIOãåæãšåããããç°¡åã«èšè¿°ã§ããä»ã®èšèªãããããªãããã§ãïŒCïŒã®async-awaitãé€ããã* nixã·ã¹ãã ã§ã¯ããŸãäžè¬çã§ã¯ãããŸããïŒã ããã«ãèšèªã¯ç°¡åã«ç¿åŸã§ããæšæºã©ã€ãã©ãªã«ã¯å¿ èŠãªãã®ãã»ãŒãã¹ãŠæã£ãŠããŸãïŒãããŠããµãŒãããŒãã£ã©ã€ãã©ãªã®ãšã³ã·ã¹ãã ãéçºãããŠããŸãïŒã ããŒã«ãããã¯ç°¡åã食ãæ°ã®ãªããåªããããã¥ã¡ã³ãã æ¬ ç¹ã®äžã§ïŒç§ã¯ååãªgeneric'ovãæã£ãŠããŸããã
çŸåšãGoã§å éšäœ¿çšããããã®ãŠãŒãã£ãªãã£ãããã€ãäœæããŠããŸãã éå§ããã«ã¯ãå ¬åŒãµã€ãã®æ å ±ã調ã¹ãã°ååã§ãã ç°¡åãªæŠèŠãšã ããå®å šãªä»æ§ãšäŒè°ã®ã¹ããŒãããããŸãã
ããã ãã§ã Goãã©ã®ããã«åŠã³ãŸãããïŒ ã³ã¡ã³ãã§ã¹ããŒãªãŒãå ±æããŸãã