コワクナイヨ TypeScript - static typing reloaded -

コワクナイヨ TypeScript - static typing reloaded -

309384d4f7b37d3532fd81800d356bcf?s=128

dojineko

May 15, 2019
Tweet

Transcript

  1. TUBUJDUZQJOHSFMPBEFE EPKJOFLP(.01FQBCP *OD 'VLVPLB+4 ίϫΫφΠϤ5ZQF4DSJQU

  2. 5ZQF4DSJQU ΍ͬͯ·͔͢ʁ

  3. ࠷ۙͷ5ZQF4DSJQUμΠδΣετ w 5ZQF4DSJQU w ΠϯΫϦϝϯλϧϏϧυͷαϙʔτɺδΣωϦΫεؔ਺ͷߴ֊ܕਪ࿦ɺ3FBEPOMZͷվྑɺ DPOTUͷܕએݴɺHMPCBM5IJTͷܕνΣοΫαϙʔτ w5ZQF4DSJQU w6OJPOܕͷܕਪ࿦ͷվྑɺ૿෼ϑΝΠϧ؂ࢹͷαϙʔτ w5ZQF4DSJQU wTUSJDU#JOE$BMM"QQMZͷ௥Ճɺ#JH*OUͷαϙʔτɺ


    ֎෦ύοέʔδͷUTDPOpHKTPOར༻ͷαϙʔτͳͲ ·ͩ·ͩ͋ΔκΠʁ
  4. ࠷ۙͷ+BWB4DSJQUμΠδΣετ wΫϥεߏจͷQSJWBUFpFME͕$ISPNFʹ࣮૷͞Εͨ w 5ZQF4DSJQUଆ͸·ͩτϥϯεύΠϧͷ࣮૷Ҋ͸·ͩݕ౼த w QSJWBUFpFMEͷఆٛΛಠࣗͰ͍࣋ͬͯΔͷͰࠓޙ͕ؾʹͳΓ·͢Ͷ w SFGIUUQTHJUIVCDPN.JDSPTPGU5ZQF4DSJQUJTTVFT w/PEFKTWͰNKT͡Όͳͯ͘΋&4.PEVMFͱͯ͠ಈ࡞͢ΔΑ͏ʹ w

    QBDLBHFKTPOʹUZQFNPEVMFΛ௥Ճ͢Δͱ&4.PEVMFͰಈ͘ύοέʔδʹ w ʮFYQFSJNFOUBMNPEVMFTʯ͕΍ͬͺΓඞཁ
  5. ͓͓͍Α

  6. ʮ5ZQF4DSJQUΛ࢝Ί͍͚ͨͲ ͪΐͬͱΘ͔Βͳ͍ʜʯ

  7. ίϫΫφΠϤ 5ZQF4DSJQU

  8. ΑΖͣ԰ !EPKJOFLP GVLVPLBUTΛΑΖ͘͠Ͷʂ 

  9. ૣ଎Ͱ͕࣌ؒ͢ͷؔ܎্ w5ZQF4DSJQUͷେ·͔ͳઆ໌͸ԼهͷεϥΠυʹҠৡ͠·͢ w ଟ෼ωλͷେ෦෼͕͔Ϳͬͯͦ͏ɾɾɾ͍΍ͦ͏ʹҧ͍ͳ͍ʂ Ч㱬ŞƄţƃ wಋೖ޲͚ͷ಺༰͸ͬͪ͜Λݟͯ͘ΕΔͱخ͍͠ͳ ͪΐͬͱݹ͍Ͱ͢  IUUQTTQFBLFSEFDLDPNEPKJOFLPUZQFTDSJQUSPBEUPTUBUJDUZQJOHPKJTBO

  10. ࠓճ࿩͢͜ͱ w Ҡߦʹࡍͯ͠ͷUTDPOpHKTPO w UTDͱ#BCFM w BOZͱVOLOPXO w 54-JOUͱ&4-JOU w

    TUSJDUUSVF΁ͷಓ
  11. UTDPOpHKTPOʹԿΛॻ͚͹͍͍ͷʁ w5ZQF4DSJQUΛ+BWB4DSJQUʹม׵͢Δͱ͖ͷઃఆΛॻ͖·͢ w/PEFKT༻ɺϒϥ΢β༻ͳͲͷग़ྗ݁Ռͷ੾Γସ͑ wͲͷϨϕϧ·Ͱͷ&$."4DSJQUͷػೳΛ࢖͏͔ wࢼݧత࣮૷ %FDPSBUPSͳͲ ͷ༗ޮԽ wܕνΣοΫͷϨϕϧ wͳͲͳͲ

  12. None
  13. ઃఆ େਿ

  14. UTDPOpHKTPO͜Ε͚ͩॻ͍ͱ͚͹େৎ෉ w+4͔ΒͷҠߦͷ৔߹͸ɺͱʹ͔͘ΏΔΊʹઃఆ͢Δͷ͕ϛιʂ w͍͖ͳΓʮTUSJDUUSVFʯ͸͓͢͢Ί͠·ͤΜɻ w ϩτͷ༐ऀͩͬͯʮ͔ΘͷͨͯʯͰग़ൃ͢ΔΑͶ wNPEVMF͸FTOFYU͕͓͢͢ΊʮΨϯΨϯ͍͜͏ͥʯ w ͔ͤͬ͘΍ΔͳΒ&$."4DSJQUͷ৽͍͠ػೳΛ࢖͍ͬͯ͜͏ʂ ͦͷ΄͏͕ϩϚϯ͕͋Δ 

    wUBSHFUઃఆ͸*&͸ແࢹͰ͖ΔͳΒFTɺͩΊͳΒFT wҊ݅ʹԠͯ͡QPMZpMMJP΍CBCFMQPMZpMMΛซ༻͠·͠ΐ͏
  15. ઃఆྫ *&޲͚ͷΏΔʔ͍ઃఆ ग़ྗ݁Ռ͸&4ͷൣғͰ ࢖͏ػೳ͸࠷৽ͷػೳͰ $PNNPO+4ͱ&4Ϟδϡʔϧͷҧ͍Λ ͳΔ΂͘ҙࣝ͠ͳͯ͘ྑ͍Α͏ʹ͢Δ #BCFMతͳ΍ͭ 5ZQF4DSJQU͔Β+BWB4DSJQUͷ *NQPSUΛڐՄ͢Δ ಡΈࠐΉϑΝΠϧΛࢦఆ

    ϏϧυΛ͍ͨ͠ର৅Λ໌ࣔ͢Δ
  16. ࠓճ࿩͢͜ͱ w Ҡߦʹࡍͯ͠ͷUTDPOpHKTPO w 5ZQF4DSJQUͱ#BCFM w BOZͱVOLOPXO w 54-JOUͱ&4-JOU w

    TUSJDUUSVF΁ͷಓ
  17. #BCFM͞Μͷֵ໋తΞοϓσʔτ w#BCFM͔Β5ZQF4DSJQUͷ
 τϥϯεύΠϧ͕ਖ਼ࣜαϙʔτ w#BCFMͰτϥϯεύΠϧ͢Δ৔߹͸
 Ұ෦ͷػೳ͕࢖͑·ͤΜ w OBNFTQBDF΍+49ͷܕΞϊςʔγϣϯɺ&OVNͷએ ݴͷϚʔδɺτϥϯεύΠϧ࣌ͷܕνΣοΫͳͲ

  18. UTDͱ#BCFMͲͬͪΛ࢖͑͹͍͍ͷʁ wUTD͕͓͢͢Ίͳ৔߹ w ܕνΣοΫΛݫີʹߦ͍͍ͨ৔߹ w 5ZQF4DSJQUͷػೳΛϑϧʹ׆༻͍͖͍ͯͨ͠৔߹ w#BCFM͕͓͢͢Ίͳ৔߹ w ͢Ͱʹ#BCFMͷΧελϚΠζΛߴ౓ʹߦ͍ͬͯΔ৔߹ w

    ຊ࣭తʹܕνΣοΫΛඞཁͱ͍ͯ͠ͳ͍৔߹ w τϥϯεύΠϧ଎౓Λॏࢹ͢Δ৔߹
 ܕνΣοΫ͚ͩUTDΛซ༻͢Δύλʔϯ΋༗Γ ಋೖ͢ΔϓϩδΣΫτͷঢ়ଶΛݟͯ ͱʹ͔͘ແཧͷͳ͍બ୒Λߦ͍·͠ΐ͏ #BCFMΛഇࢭͯ͠UTDΛ࢖͏ɺ ͋Δ͍͸ͦͷٯ΋ׂͱ؆୯ʹग़དྷ·͢
  19. ࠓճ࿩͢͜ͱ w Ҡߦʹࡍͯ͠ͷUTDPOpHKTPO w UTDͱ#BCFM w BOZͱVOLOPXO w 54-JOUͱ&4-JOU w

    TUSJDUUSVF΁ͷಓ
  20. VOLOPXOܕͱ͸ w5ZQF4DSJQUͰ௥Ճ͞Εͨ৽ͨͳܕ w୅ೖʹ͍ͭͯ͸BOZܕͱಉ͡ wVOLOPXOܕͷ஋Λ࢖༻͢Δ৔߹͸ܕΞαʔγϣϯ͕ඞཁʹͳΔ wBOZܕʹ͢Δ͜ͱͰܕνΣοΫ͕׬શʹΨϥۭ͖ʹͳΔ໰୊Λ
 ղܾ͢ΔͨΊͷखஈͷ̍ͭͱͯ͠࢖͑Δ w5ZQF4DJSQUΛखݎ͘ӡ༻͢ΔͳΒ࢖͍͖͍ͬͯͨػೳͷ̍ͭ

  21. ࢖༻ྫ BOZܕͩͬͨΒ ʮଘࡏ͠ͳ͍ؔ਺ʯؔ਺͸࣮ߦ࣌ʹ
 ଘࡏ͠ͳ͍ͷͰVOEFpOFE ΍΍͍͜͠ 
 ͚ͩͲ΋ίϯύΠϧ࣌ʹνΣοΫͰ͖ͳ͍

  22. ࢖༻ྫ VOLOPXOܕʹ͢Δͱ VOLOPXOܕΛͦͷ··࢖͍ͬͯΔՕॴΛ ίϯύΠϧ࣌ʹݕ஌Ͱ͖Δ ࢖༻࣌ʹ͸ඞͣΞαʔγϣϯ͕ඞཁʂ ݁Ռଘࡏ͠ͳ͍ؔ਺Λݺͼग़͍ͯ͠Δ Α͏ͳՕॴΛݕ஌͢Δ͜ͱ͕Ͱ͖Δ

  23. ࠓճ࿩͢͜ͱ w Ҡߦʹࡍͯ͠ͷUTDPOpHKTPO w UTDͱ#BCFM w BOZͱVOLOPXO w 54-JOUͱ&4-JOU w

    TUSJDUUSVF΁ͷಓ
  24. ͜͜͸େࣄͳͱ͚ͩ͜ w54-JOUͷ࢖༻͸ඇਪ঑ʹͳΓ·ͨ͠ w ৽نҊ݅͸&4-JOUͰ࢝ΊΔ͜ͱΛ͓͢͢Ί͠·͢ w&4-JOUͷ5ZQF4DSJQUαϙʔτ͸·ͩ·ͩ͜Ε͔Β w OPqPBUJOHQSPNJTFͷΑ͏ͳ5ZQF4DSJQUͷܕ৘ใʹجͮ͘-JOUJOH͸׬શʹ͸ҠߦͰ͖ ͳ͍ͷͰ৔߹ʹΑͬͯ͸·༷ͩࢠݟ͍͓͍ͯͨ͠΄͏͕ྑ͍͔΋ʁ wͱ͸͍͑&4-JOUʹҠߦ͠ͳ͚Ε͹ͳ͘ͳΔͷ͸࣌ؒͷ໰୊ w

    Ջ͕͋Ε͹Ҡߦ͓͖ͯ͠·͠ΐ͏ʂ w ୲౰ϓϩδΣΫτͰ͸ͻͱ·ͣҠߦͷ४උ͚ͩࡁ·͍ͤͯ·͕͢54-JOU͕·ͩݱ໾Ͱ͢ɻ
  25. ࣌ؒ଍ΓͯΔͷ͔ͳʁ w Ҡߦʹࡍͯ͠ͷUTDPOpHKTPO w UTDͱ#BCFM w BOZͱVOLOPXO w 54-JOUͱ&4-JOU w

    TUSJDUUSVF΁ͷಓ
  26. ΑΓखݎ͘ӡ༻͍ͯ͘͠ϙΠϯτ wVOLOPXOΛ࢖͍ͬͯ͘ w BOZΛ࢖͏ΑΓɺVOLOPXOΛ࢖͏ͷ͕͓͢͢Ί wܕఆٛΛ࢖͏ɺແ͍ఆٛ͸ॻ͘ w ৽نͷఆٛ΍ɺఆٛͷߋ৽͸13͢ΔͱΈΜͳ΋޾ͤʹͳΕΔ wUTDPOpHKTPOͰTUSJDUUSVFΛઃఆ͢Δ w ΑΓڧ੍͘໿Λֻ͚ͯӡ༻͢Δ͓ؾ࣋ͪͷද໌

    w ඞͣ͠΋ඞཁͰ͸ͳ͍͕खݎ͘͸ͳΔ TUSJDUUSVFΛઃఆ͢Δ Ϟνϕʔγϣϯͬͯ ͳΜͩΖ͏ʁʁʁ
  27. TUSJDUUSVFͷޮՌͱ͸ʁ w࣮͸खݎ͘ӡ༻͢ΔͨΊͷෳ਺ͷϧʔϧ͕·ͱΊͯద༻͞ΕΔ w OP*NQMJDJU"OZ҉໧ͷBOZͷ࢖༻Λېࢭ͢Δ w OP*NQMJDJU5IJTUIJTͷܕΛ໌ࣔ͢Δ͜ͱΛཁٻ͢Δ w BMXBZT4USJDUग़ྗ݁ՌʹৗʹVTFTUSJDUΛࢦఆ͢Δ w TUSJDU#JOE$BMM"QQMZCJOE

    DBMM BQQMZͷܕਪ࿦Λݫີʹߦ͏ w TUSJDU/VMM$IFDLTݫີͳOVMMͷνΣοΫΛߦ͏ w TUSJDU'VODUJPO5ZQFTݫີͳؔ਺ͷܕͷνΣοΫΛߦ͏ w TUSJDU1SPQFSUZ*OJUJBMJ[BUJPOॳظԽ͞Ε͍ͯͳ͍ΫϥεϓϩύςΟΛېࢭ͢Δ όʔδϣϯʹΑͬͯద༻͞ΕΔ ϧʔϧ͸एׯҟͳΓ·͢
  28. TUSJDUUSVFΛద༻͢Δ͜ͱ͸ྑ͍͜ͱʁ wద༻Ͱ͖ΔͳΒ͓͍ͯͨ͠΄͏͕खݎ͘͸ͳΔ͠ྑ͍͜ͱʂ w͔͠͠ඞਢͰ͸ͳ͍͠ɺΰʔϧͰ΋ͳ͍ wద༻͠ͳ͍͔Βѱ͍ͱ͍͏͜ͱ΋ͳ͍ wཧղΛಘͳ͕Βɺ௕ظతʹɺແཧͳ͘
 ӡ༻Ͱ͖ΔΑ͏ʹ͍ͯ͘͜͠ͱ͕େࣄ wTUSJDUUSVFʹ͢Δ৔߹͸ݸผͷϧʔϧΛద༻੍͍͖ͯ͠໿Λঃʑʹ ڧΊ͍ͯ͘͜ͱΛ͓͢͢Ί͠·͢

  29. TUSJDUUSVF΁ͷಓ  TUSJDUUSVFͷࢼݧద༻ͱݱঢ়೺Ѳ w໰୊఺Λ೺Ѳ͢ΔͨΊ͚ͩʹҰ࣌తʹద༻  OP*NQMJDJU"OZҎ֎ͷద༻ w҉໧ͷBOZ࢖༻Օॴ͕ଟʑ͋ͬͨͨΊ  OP*NQMJDJU"OZͷద༻ w͚ͭͯ͸֎͠Λ܁Γฦͯ͠໰୊ՕॴΛۦஞ

     ݸผద༻ΛTUSJDUUSVF΁ஔ͖׵͑ͯ·ͱΊΔ  Ҏޙ͸TUSJDUUSVFͰͷӡ༻Λܧଓ ݱࡏʹࢸΔ
  30. TUSJDUUSVFΛద༻ͨ͜͠ͱʹΑΔޮՌ w੍໿͕ڧԽ͞ΕΔͨΊɺΑΓΤϥʔݕ஌ͷਫ਼౓্͕͕Γ·ͨ͠ wͨͩ͠ɺ੍໿͕ڧԽ͞Εͨ͜ͱʹΑΓ5ZQF4DSJQU ੩తܕ෇͚ݴޠ ΁ͷʮ͜ͳΕײʯ͕ඞཁʹͳΓ·ͨ͠ w+BWB4DSJQU͔ΒҠ͖ͬͯͨ͹͔ΓͩͱɺετϨεʹײ͡Δ෦෼͕ग़ ͯ͘Δ͔΋͠Ε·ͤΜ ࠓ͸ຆͲͦΜͳ͜ͱແ͍Ͱ͢  w΋͠΍ΔͳΒʮ͖ΐ͏͍ͤΪϓεʯΛ͚ͭͯ࿅शͯ͠ΔཧղͰྟΈ·

    ͠ΐ͏
  31. ·ͱΊ

  32. ·ͱΊ w5ZQF4DSJQU͸ίϫ͘ͳ͍ʂ w ΏΔʔ࢝͘Ίͯ΋શવ0,ʂ w ͳΜͳΒܕఆ͚ٛͩ࢖ͬͯΤσΟλͰิ׬ͤ͞Δ͚ͩͰ΋0,ʂ w#BCFMͰ΋5ZQF4DSJQU͸࢖͑ΔΑ wBOZܕΑΓ͸VOLOPXOܕΛ࢖͏ͷ͕͓͢͢Ί w54-JOU͸&4-JOUʹஔ͖׵͍͑ͯ͘४උΛ͠·͠ΐ͏ wTUSJDUUSVF͸ศར͚ͩͲ௧ΈΛ൐͏ͷͰ


    ༻๏༻ྔΛकͬͯਖ਼͓͘͠࢖͍͍ͩ͘͞
  33. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠