Slide 1

Slide 1 text

΍ͬͱ͖ͨϓϥάΠϯ #BDLHSPVOE*NBHF'SBOL(VJEP GVLVPLBHP"QSJM MJOZPXT

Slide 2

Slide 2 text

TOMOHISA ODA LINYOWS@ GMO PEPABO INC GVLVPLBHP

Slide 3

Slide 3 text

GVLVPLBHP ࠷ۙ΍͍ͬͯΔ͜ͱ ▸OPEFKTͰ&4ରԠͷ"1*ΫϥΠΞϯτͱ$-*πʔϧ ▸HPMBOHͷ8"'FDIPͷ"1*ͷ౷߹ςετ ▸0$501"44ͱ͍͏/44Ϟδϡʔϧ

Slide 4

Slide 4 text

ϒϩάɿ IUUQUPNPIJTBPEBDPNQPTUT FBTF@NBOBHFNFOU@PG@MJOVY@TFSWFS@BENJOJTUSBUPSIUNM GVLVPLBHP

Slide 5

Slide 5 text

IUUQTHJUIVCDPNMJOZPXTPDUPQBTT GVLVPLBHP

Slide 6

Slide 6 text

GVLVPLBHP (0ͷϓϩμΫγϣϯ׆༻ࣄྫ ▸ "1*αʔόʢFDIP΍QVSFHPʣ ▸ 45/4ʢMJOVYͷϢʔβ؅ཧʣ ▸ Ϩϯλϧαʔόͷࣗಈ੍ޚʢෛՙঢ়گʹΑΓࣗಈͰ੍ݶΛ͔͚Δʣ ϓϩμΫγϣϯҎ֎Ͱ͋Ε͹঺հ͖͠Εͳ͍΄Ͳ͋Δʜ .PY 0QFO4UBDL$-*XSBQQFS NEU UBLPTBO 44)XSBQQFS΋ͪΖΜQU

Slide 7

Slide 7 text

ͯ͞ɺ(0W࢖ͬͯ·͔͢ʁ GVLVPLBHP

Slide 8

Slide 8 text

GVLVPLBHP (0W͓΋ͳมߋ఺ ▸ ໊લ෇͖ߏ଄ମͷܕม׵ ▸ ίϯύΠϥ΍($ͷվળ ▸ )5511VTIରԠ ▸ )551TFSWFS(SBDFGVM4IVUEPXOରԠ ▸ .VUFYUͷϓϩϑΝΠϦϯάରԠ ▸ 1MVHJOύοέʔδ

Slide 9

Slide 9 text

ϓϥάΠϯ GVLVPLBHP

Slide 10

Slide 10 text

͜Ε·ͰͲ͏ͯͨ͠ͷ GVLVPLBHP

Slide 11

Slide 11 text

GVLVPLBHP ͜Ε·ͰͷϓϥάΠϯྫ ▸ IBTIJDPSQHPQMVHJO 5FSSBGPSN /PNBE 7BVMUͳͲͰ࢖ΘΕͯΔ ▸ EVMMHJVMJPQJOHP 1MVHJOػߏϥΠϒϥϦʣ ▸ NBDLFSFMJPNBDLFSFMBHFOUQMVHJOTʢͦΕͧΕ͕$-*ʣ

Slide 12

Slide 12 text

GVLVPLBHP ͜Ε·ͰͷϓϥάΠϯ࢓૊Έ APPLICATION PLUGINS (SUBPROCESSES) Unix Domain Socket TCP localhost

Slide 13

Slide 13 text

͑ͬɺͦΕͬαʔόʜ GVLVPLBHP

Slide 14

Slide 14 text

1MVHJO4FSWFS 1MVHJO4FSWFS 1MVHJO4FSWFS 1MVHJO4FSWFS GVLVPLBHP ϓϥάΠϯͱ͍͏໊ͷ.JDSP4FSWJDFTʜ APPLICATION Unix Domain Socket Unix Domain Socket Unix Domain Socket Unix Domain Socket

Slide 15

Slide 15 text

▸ ຊମͱ׬શʹ෼཭Ͱ͖ΔͷͰϓϥάΠϯ͕ݪҼͰΫϥογϡ͠ͳ͍ ▸ ϓϥάΠϯ͸31$Ͱ͋Ε͹HPMBOHʹݶఆ͞Εͳ͍ʢ࣮૷࣍ୈʣ ▸ Ϗϧυͨ͠όΠφϦΛઃஔ͢Ε͹ಈ͘ ▸ ϓϥάΠϯͷ਺͚ͩαʔόىಈ͢ΔͷͰϓϩηε૿͑Δ 0WFS31$ܕϓϥάΠϯ·ͱΊ GVLVPLBHP

Slide 16

Slide 16 text

Ͱ͸ɺ৽͍͠ϓϥά Πϯ͸ʁ GVLVPLBHP

Slide 17

Slide 17 text

1. p, _ := plugin.Open(“./plugins/animal.so”) // *PluginΛฦ͢ 2. symbol, _ := p.Lookup(“Sounds”) // ΤΫεϙʔτ͞ΕͨV΍FΛγϯϘϧͱͯ͠ฦ͢ 3. sounds := symbol.(SoundsInterface) // IntefaceΛSymbolʹ౉͢͜ͱͰV΍F͕ར༻ՄೳͱͳΔ 4. sounds.Init(Sounds.conf) // ྫ͑͹ϝΠϯΞϓϦέʔγϣϯ͔Βͷઃఆ஋Λ౉͢ͳͲ 5. sounds.List[“dog”].MakeNoise() // ϝιουݺग़͠ 6. // => Bow wow! ϓϥάΠϯ࢖͍ํ GVLVPLBHP

Slide 18

Slide 18 text

ΊͬͪΌ؆୯΍Μ GVLVPLBHP

Slide 19

Slide 19 text

αϯϓϧίʔυ͋Γ·͢ͷͰɺ ৄ͘͠͸ҎԼͷϦϙδτϦΛ͝ཡ͍ͩ͘͞ IUUQTHJUIVCDPNMJOZPXTHPQMVHJOTBOECPY GVLVPLBHP

Slide 20

Slide 20 text

GVLVPLBHP ৽ύοέʔδͷϓϥάΠϯ ▸ HPCVJMECVJMENPEFQMVHJOPNZQMVHJOTPNZQMVHJOHPͰ40ϑΝΠϧ࡞੒ ▸ QMVHJO͸ݱঢ়MJOVYͰͷΈϏϧυՄೳʢ.BD04͸ؒʹ߹Θͳ͔ͬͨʣ ▸ QMVHJO͸ϝΠϯΞϓϦͱಉ͡(PͷόʔδϣϯͰϏϧυ͠ͳ͚Ε͹ͳΒͳ͍ ʢ͑ͬʣ

Slide 21

Slide 21 text

Versioning Most Of These Execution Modes Permit Code To Be Built At Different Times And Linked Together At Runtime. Nevertheless, We Require That All Go Code That Is Combined Into A Single Executable Image Must Be Built With The Same Version Of The Go Toolchain. We Require Further That If Any Go Package Appears More Than Once In The Executable Image, It Must Be Built From The Same Source Code. This Is A Very Strict Requirement. It Means That If A C Program Has A C Api Style Plugin Interface, And It Opens Multiple Plugins Written In Go, All Of Those Plugins Must Be Built With The Same Version Of The Go Toolchain, And Any Shared Packages Must Be Identical. It May Be Possible To Weaken This Restriction In The Future, But We’ll Start With This. Go Execution Modes (from Feature Proposals) GVLVPLBHP ͜ΕΒͷ࣮ߦϞʔυͷ΄ͱΜͲ͸ɺ࣮ߦ࣌ʹίʔυΛҟͳΔ࣌ؒʹߏஙͯ͠ϦϯΫ͢Δ͜ͱΛՄೳʹ͠·͢ɻ ͦΕʹ΋͔͔ΘΒͣɺ୯Ұ ͷ࣮ߦՄೳΠϝʔδʹ݁߹͞Εͨ͢΂ͯͷGoίʔυ͸ɺಉ͡όʔδϣϯͷGoπʔϧνΣʔϯͰߏங͢Δඞཁ͕͋Γ·͢ɻ ࣮ߦՄೳΠϝʔ δʹෳ਺ͷGoύοέʔδ͕ෳ਺දࣔ͞ΕΔ৔߹͸ɺಉ͡ιʔείʔυ͔Βߏங͢Δඞཁ͕͋Γ·͢ɻ ͜Ε͸ඇৗʹݫ͍͠ཁ݅Ͱ͢ɻ ͭ·ΓɺCϓϩάϥϜʹC APIελΠϧͷϓϥάΠϯΠϯλʔϑΣΠε͕͋ΓɺGoͰॻ͔Εͨෳ਺ͷϓϥά ΠϯΛ։͘ͱɺͦΕΒͷϓϥάΠϯ͸͢΂ͯGoπʔϧνΣʔϯͷಉ͡όʔδϣϯͰϏϧυ͞Εͳ͚Ε͹ͳΒͣɺڞ༗ύοέʔδ͸ಉҰͰ ͳ͚Ε͹ͳΓ·ͤΜɻ কདྷ͜ͷ੍ݶΛऑΊΔ͜ͱ͸Մೳ͔΋͠Ε·ͤΜ͕ɺ͜Ε͔Β࢝ΊΔͭ΋ΓͰ͢ɻ

Slide 22

Slide 22 text

▸ ϓϥάΠϯ͸(Pͷಛఆͷόʔδϣϯʹݶఆ͞ΕΔ ▸ ڞ௨ͷ*'࢖͍ɺ࣮૷͸PQFOͯ͠ࢦఆͷϝιουݺͼग़͚ͩ͢ͳͷͰͱͯ΋؆୯ ▸ ౰વͳ͕ΒQMVHJO಺ͰQBOJDى͖ΔͱϝΠϯΞϓϦ΋ࢮ͵ ▸ ϝΠϯ"QQ͕PQFOલʹϓϥάΠϯΛϏϧυ͢Δͱ͍͏ख΋͋Δ ▸ (PͷΤϯδχΞ͸ख͕ܰͩͦͷଞͷΤϯδχΞʹ͸ෑډ͕͋Δ ڞ༗ϥΠϒϥϦܕϓϥάΠϯ·ͱΊ GVLVPLBHP

Slide 23

Slide 23 text

(0ͷΤϯδχΞ͸ख͕ܰͩ ͦͷଞͷΤϯδχΞ͸೉͍͠ GVLVPLBHP

Slide 24

Slide 24 text

▸ 31$ܕͰ֤ݴޠͷαʔόཱͯΔ ▸ NJUDIFMMIHPNSVCZ΍EFVJMMHPQIQͱ͍ͬͨଞݴޠCJOEJOHTΛ࢖͏ ʜͦ΋ͦ΋ɺHPͰଞݴޠͷϓϥάΠϯΛ࢖͑ΔΑ͏ʹ͢Δͱ͍͏ൃ૝͕ؒҧ͍ͬͯ ΔΑ͏ʹ΋ࢥ͑Δ ΄͔ͷݴޠରԠ͢Δʹ͸ GVLVPLBHP

Slide 25

Slide 25 text

▸ "QBDIFͷϞδϡʔϧMJCQIQTP͕HPͷαʔόͰ؆୯ʹಈ͘ͱ͔ ▸ 5IF1MBUJOVN4FBSDIFSʹਖ਼نදݱΤϯδϯʹَंMJCPOJHTPΛϓϥάΠϯͱ͠ ࢖͑·͢ͱ͔΍Γ͔ͨͬͨ ΄Μͱ͸ʜ GVLVPLBHP

Slide 26

Slide 26 text

GVLVPLBHP ·ͱΊ ▸ (PͷϓϥάΠϯػߏ͸31$ͱൺ΂ΔͱΦʔόʔϔουͳ͍ʢී௨ʹߟ͑ͯʣ ▸ ಉ͡(PͷόʔδϣϯͰϏϧυ͢Δ੍໿͕͋Δ͕$*౳ϏϧυπʔϧͰղܾ ▸ खܰʹϓϥάΠϯػߏ΋ͯΔͷͰ044ઃܭ͕޿͕Γͦ͏

Slide 27

Slide 27 text

͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ GVLVPLBHP