Upgrade to Pro — share decks privately, control downloads, hide ads and more …

About Type Syntax Proposal

About Type Syntax Proposal

Yosuke Kurami

May 14, 2022
Tweet

More Decks by Yosuke Kurami

Other Decks in Programming

Transcript

  1. 5ZQF4DSJQU͕&$."4DSJQUʹ
    ؚ·ΕΔ೔͕དྷΔ͔΋ʂ


    View full-size slide

  2. 5ZQF4ZOUBY1SPQPTBM


    https://github.com/tc39/proposal-type-annotations

    View full-size slide

  3. 5ZQF4ZOUBY1SPQPTBM
    w .JDSP4PGU͕5$ʹఏग़ͨ͠૲Ҋ ೥݄ݱࡏ͸4UBHF



    https://devblogs.microsoft.com/typescript/a-proposal-for-type-syntax-in-javascript/

    View full-size slide

  4. 5ZQF4ZOUBY1SPQPTBM
    w τϥϯεύΠϧͤͣʹɺUTϑΝΠϧΛ࣮ߦͰ͖ΔΑ͏ʹͳΔ
    w ʮϒϥ΢β͕ܕνΣοΫΛͯ͘͠ΕΔʯΘ͚Ͱ͸ͳ͍
    w 5ZQF4ZOUBYͱ͋ΔΑ͏ʹɺ4ZOUBY จ๏
    ͷ࿩
    w 4FNBOUJDT ҙຯ
    ʹ͸Ұ੾౿Έࠐ·ͳ͍


    View full-size slide

  5. 5ZQF4ZOUBY1SPQPTBM
    w +BWB4DSJQUΤϯδϯ͸: numberͷ෦෼Λ੾Γམͱ࣮ͯ͠ߦ͢Δ͚ͩ
    5ZQF"OOPUBUJPO͕ਖ਼͍͔͠Ͳ͏͔͸ෆ໰

    w $ tsc --target esnextͱಉ͜͡ͱΛ+BWB4DSJQUΤϯδϯଆ͕΍ͬͯ͘
    ΕΔΠϝʔδ


    View full-size slide

  6. จ๏͕ඪ४Խ͞ΕΔҙຯ
    'PS5ZQF4DSJQU
    w 5ZQF4DSJQUຊՈʹͱͬͯ
    w 5ZQF4ZOUBY͕&$."4DSJQUʹؚ·ΕΔͱɺߏจͷ௥Ճʹඪ४Խϓϩη
    εΛ௨աͤ͞Δඞཁ͕ൃੜ͢ΔʢউखʹߏจΛมߋͰ͖ͳ͍ʣ
    w .JDSP4PGUࣗ਎͕5ZQF4ZOUBYΛఏҊ͍ͯ͠Δͱ͍͏͜ͱ͸ɺ൴Βࣗ਎͕
    ʮ5ZQF4DSJQUͷߏจ͸े෼ʹݻ·͖ͬͯͨʯͱߟ͍͑ͯΔূࠨʁ


    View full-size slide

  7. จ๏͕ඪ४Խ͞ΕΔҙຯ
    SE1BSUZ5SBOTQJMFS
    w ۙ೥ར༻͕౰ͨΓલʹͳΓͭͭ͋ΔɺCBCFM TXD FTCVJMEͳͲͷSEύʔς
    ΟτϥϯεύΠϥ
    w ͜ΕΒͷπʔϧ͸5ZQF4DSJQU༻ͷߏจղੳثΛ࣮૷͍ͯ͠Δ
    w จ๏ͷඪ४ԽʹΑΓɺ҆ఆͨ͠ߏจղੳ͕ߦ͑ΔΑ͏ʹͳΔ
    w Ϗϧυ༻ͷτϥϯεύΠϥʹٻΊΒΕ͍ͯΔͷ͸ʮܕΞϊςʔγϣϯͷ࡟আʯ
    ͚ͩ XFCQBDLճ͢ͱ͖ʹܕνΣοΫ͸͍Βͳ͍



    View full-size slide

  8. Ͳ͏උ͑Δ͔
    w ݱঢ়͸4UBHFͰ͋Γɺࠓ͙͢ϢʔβʔϥϯυͰͲ͏͜͏͢Δ࿩Ͱ͸ͳ͍
    w Ұ෦ͷϥϯλΠϜʹӨڹΛٴ΅͢จ๏ FHOBNFTQBDF FOVN FUD
    ʹ͍ͭ
    ͯ͸ɺ5ZQF1SPQPTBMͷൣғ֎ͱ͞Ε͍ͯΔ
    w ʮ͜ΕΒͷػೳΛੵۃతʹ࢖Θͳ͍Α͏ʹ͓ͯ͘͠ʯͷ͸ΞϦ


    View full-size slide