vgo(Versioned Go Prototype) #golangtokyo

vgo(Versioned Go Prototype) #golangtokyo

2018/04/16 golang.tokyo #14 の発表です

A142614d6ffed4c65ac5b8eaa7cd3f3b?s=128

Asuka Suzuki

April 16, 2018
Tweet

Transcript

  1. vgo  HPMBOHUPLZP

  2. λϯΫླ໦ !UBOLTV[VLJ גࣜձࣾΤʔϐʔίϛϡχέʔγϣϯζ  ("&(Pɾ'JSFCBTFɾHPQBDLFU  3FBDU3FEVY

  3. λϯΫླ໦ !UBOLTV[VLJ גࣜձࣾΤʔϐʔίϛϡχέʔγϣϯζ (PͰωοτϫʔΫϓϩάϥϛϯά ("&(PͷαʔϏε։ൃ ࠷ۙ࡞ͬͨ΋ͷ ը૾ΛΞοϓϩʔυ͢Δͱ $MPVE7JTJPO"1*ͰإΛݕग़ͯ͠ (PQIFSͬΆͯ͘͘͠ΕΔαʔϏε IUUQTHPQIFSJ[FDPN

  4. λϯΫླ໦ !UBOLTV[VLJ גࣜձࣾΤʔϐʔίϛϡχέʔγϣϯζ (PͰωοτϫʔΫϓϩάϥϛϯά ("&(PͷαʔϏε։ൃ ࠷ۙ࡞ͬͨ΋ͷ ը૾ΛΞοϓϩʔυ͢Δͱ $MPVE7JTJPO"1*ͰإΛݕग़ͯ͠ (PQIFSͬΆͯ͘͘͠ΕΔαʔϏε IUUQTHPQIFSJ[FDPN

  5. ʁ vgo

  6. HPίϚϯυʹ૊Έࠐ·ΕΔ༧ఆͷύοέʔδ؅ཧػೳ ैདྷEFQ΍HMJEFଞͰߦ͍ͬͯͨ͜ͱΛHPͰߦ͏

  7. ϩʔυϚοϓ Α͏΍͘ύοέʔδ؅ཧ·ΘΓ͕མͪண͖ͦ͏ ݱࡏ (P (P ϓϩτλΠϓͱͯ͠WHPίϚϯυ͕ެ։ ςΫχΧϧϓϨϏϡʔ ਖ਼ࣜಋೖ

  8. WHPʹΑͬͯมΘΔ͜ͱ #1ɹґଘؔ܎ͷղܾ͸Ϗϧυ࣌ʹߦ͏ #2ɹWFOEPSσΟϨΫτϦ͕ෆཁʹͳΔ #3ɹഁյతͳมߋΛՃ͑Δࡍ͸JNQPSUQBUIΛม͑Δ #4ɹՄೳͳݶΓݹ͍όʔδϣϯ͕બ୒͞ΕΔ

  9. #1ɹґଘؔ܎ͷղܾ͸Ϗϧυ࣌ʹߦ͏

  10. Ϗϧυର৅ͷίʔυ package main // import "github.com/you/hello" import ( "fmt" "rsc.io/quote"

    ) func main() { fmt.Println(quote.Hello()) }
  11. WHPCVJME $ vgo build vgo: resolving import "rsc.io/quote" vgo: finding

    rsc.io/quote (latest) vgo: adding rsc.io/quote v1.5.2 vgo: finding rsc.io/quote v1.5.2 vgo: finding rsc.io/sampler v1.3.0 vgo: finding golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c vgo: downloading rsc.io/quote v1.5.2 vgo: downloading rsc.io/sampler v1.3.0 vgo: downloading golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c WHPCVJME࣌ͷϩά
  12. WHPCVJME $ vgo build vgo: resolving import "rsc.io/quote" vgo: finding

    rsc.io/quote (latest) vgo: adding rsc.io/quote v1.5.2 vgo: finding rsc.io/quote v1.5.2 vgo: finding rsc.io/sampler v1.3.0 vgo: finding golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c vgo: downloading rsc.io/quote v1.5.2 vgo: downloading rsc.io/sampler v1.3.0 vgo: downloading golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c HPHFUແ͠Ͱ͍͖ͳΓWHPCVJME͢Δ
  13. WHPCVJME $ vgo build vgo: resolving import "rsc.io/quote" vgo: finding

    rsc.io/quote (latest) vgo: adding rsc.io/quote v1.5.2 vgo: finding rsc.io/quote v1.5.2 vgo: finding rsc.io/sampler v1.3.0 vgo: finding golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c vgo: downloading rsc.io/quote v1.5.2 vgo: downloading rsc.io/sampler v1.3.0 vgo: downloading golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c ະ஌ͷJNQPSUzRVPUFzΛݕग़͠ɺ࠷৽൛Λμ΢ϯϩʔυ͢Δ
  14. WHPCVJME $ vgo build vgo: resolving import "rsc.io/quote" vgo: finding

    rsc.io/quote (latest) vgo: adding rsc.io/quote v1.5.2 vgo: finding rsc.io/quote v1.5.2 vgo: finding rsc.io/sampler v1.3.0 vgo: finding golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c vgo: downloading rsc.io/quote v1.5.2 vgo: downloading rsc.io/sampler v1.3.0 vgo: downloading golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c ͞ΒʹlRVPUFz͕ґଘ͢ΔύοέʔδΛμ΢ϯϩʔυ͢Δ
  15. HPNPE module "github.com/you/hello" require ( "rsc.io/quote" v1.5.2 ) ґଘؔ܎͸HPNPEϑΝΠϧͰ؅ཧ͞ΕΔ

  16. HPNPE module "github.com/you/hello" require ( "rsc.io/quote" v1.5.2 ) ࣗ෼ͷJNQPSUQBUIͷએݴ

  17. HPNPE module "github.com/you/hello" require ( "rsc.io/quote" v1.5.2 ) ௚઀ґଘͷύοέʔδΛηϚϯςΟοΫόʔδϣχϯάͰ؅ཧ

  18. #2ɹWFOEPSσΟϨΫτϦ͕ෆཁʹͳΔ

  19. WFOEPSσΟϨΫτϦ͕ෆཁʹͳΔ ✱ WHP͸WFOEPSσ ΟϨΫτϦΛ࡞੒͠ͳ͍ ✱ ͦͷͨΊɺWFOEPSJOHͷͨΊʹ(01"5)ͷதͰ࡞ۀ͢Δඞཁ͕ͳ͍

  20. WFOEPSσΟϨΫτϦ͕ෆཁʹͳΔ $GOPATH/src/v/ !"" rsc.io #"" quote@v1.5.2 #"" sampler@v1.3.0 !"" sampler@v1.99.99

    WHPCVJMEͰऔಘͨ͠ύοέʔδ͸(01"5)TSDWʹอଘ͞ΕΔ
  21. WFOEPSσΟϨΫτϦ͕ෆཁʹͳΔ $GOPATH/src/v/ !"" rsc.io #"" quote@v1.5.2 #"" sampler@v1.3.0 !"" sampler@v1.99.99

    ಉ໊ͷύοέʔδ͸όʔδϣϯผʹอଘ͞ΕɺHPNPE͔Βࢀর͢Δ
  22. #3ɹഁյతͳมߋΛՃ͑Δࡍ͸JNQPSUQBUIΛม͑Δ
  *NQPSU$PNQBUJCJMJUZ3VMF

  23. *NQPSU$PNQBUJCJMJUZ3VMF ✱ WHPͰѻ͏ύοέʔδ͸ɺޙํޓ׵Λ࣋ͭ͜ͱ͕ٛ຿Խ͞ΕΔ ✱ Ͳ͏ͯ͠΋ഁյతͳมߋ͕ඞཁͳ৔߹͸ɺ
 JNQPSUQBUIΛม͑Δ͜ͱͰผύοέʔδѻ͍ʹ͢Δ

  24. *NQPSU$PNQBUJCJMJUZ3VMF HJUIVCDPNUBOLTV[VLJQLH HJUIVCDPNUBOLTV[VLJQLHW ผύοέʔδʹݟ͑ΔͷͰɺW͔ΒW΁ͷॱ࣍Ҡߦ͕ՄೳʹͳΔ $BTF ੜύε HPQLHJOUBOLTV[VLJQLHW HPQLHJOUBOLTV[VLJQLHW $BTF HPQLHJO࢖༻

  25. #4ɹՄೳͳݶΓݹ͍όʔδϣϯ͕બ୒͞ΕΔ
  .JOJNBM7FSTJPO4FMFDUJPO

  26. .JOJNBM7FSTJPO4FMFDUJPO EFQ͸ʮՄೳͳݶΓ࠷৽ͷόʔδϣϯʯΛબ୒͢Δ

  27. .JOJNBM7FSTJPO4FMFDUJPO #͸%Λظ଴͠ɺ$͸%Λظ଴͢Δ " # $ % % %

  28. .JOJNBM7FSTJPO4FMFDUJPO ʮՄೳͳݶΓ࠷৽ʯͰ͋Δ%͕બ୒͞ΕΔ " # $ % % %

  29. .JOJNBM7FSTJPO4FMFDUJPO ʮՄೳͳݶΓ࠷৽ʯ͸ৗʹҠΓมΘΔˠϏϧυ࠶ݱੑʹ໰୊͕ग़ΔՄೳੑ " # $ % % % %

  30. .JOJNBM7FSTJPO4FMFDUJPO WHP͸ʮՄೳͳݶΓݹ͍όʔδϣϯʯΛબ୒͢Δ

  31. .JOJNBM7FSTJPO4FMFDUJPO #͸%Λظ଴͠ɺ$͸%Λظ଴͢Δ " # $ % % %

  32. .JOJNBM7FSTJPO4FMFDUJPO ʮՄೳͳݶΓҰ൪ݹ͍όʔδϣϯʯͰ͋Δ%͕બ୒͞ΕΔ " # $ % % %

  33. .JOJNBM7FSTJPO4FMFDUJPO ΑΓݹ͍όʔδϣϯ͸ϦϦʔε͞Εͳ͍ͷͰɺϏϧυ΋҆ఆ͢Δ " # $ % % % %

  34. .JOJNBM7FSTJPO4FMFDUJPO ͨͩ͠ɺ৽όʔδϣϯͷॏཁͳมߋ͕ɺ"ʹࣗಈͰద༻͞Εͳ͍໰୊͕͋Δ " # $ % % % %

  35. .JOJNBM7FSTJPO4FMFDUJPO ղܾํ๏$ͷ։ൃऀ͕HPNPEΛ%ʹ޲͚Δ " # $ % % % %

  36. .JOJNBM7FSTJPO4FMFDUJPO ղܾํ๏ࣗ෼Ͱ$ΛGPSLͯ͠ɺHPNPEΛ%ʹ޲͚Δ " # $ % % % % $

    GPSLFE
  37. WHPʹΑͬͯมΘΔ͜ͱ #1ɹґଘؔ܎ͷղܾ͸Ϗϧυ࣌ʹߦ͏ #2ɹWFOEPSσΟϨΫτϦ͕ෆཁʹͳΔ #3ɹഁյతͳมߋΛՃ͑Δࡍ͸JNQPSUQBUIΛม͑Δ #4ɹՄೳͳݶΓݹ͍όʔδϣϯ͕બ୒͞ΕΔ

  38. ·ͱΊ ✱ WFOEPSσΟϨΫτϦഇࢭʹΑΓɺ(01"5)͔Βղ์͞ΕΔ ✱ *NQPSU$PNQBUJCJMJUZ3VMFʹΑΓɺόʔδϣϯͷॱ࣍Ҡߦ͕ՄೳʹͳΔ ✱ .JOJNBM7FSTJPO4FMFDUJPOʹΑΓɺϏϧυͷ҆ఆੑ͕ߴ·Δ

  39. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠