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

An introduction to WebAssembly

An introduction to WebAssembly

吉祥寺.pm8 で発表した資料
http://kichijojipm.connpass.com/event/34598/

842aaadff6e13fbf372c9b17b49b031c?s=128

Pine Mizune

July 29, 2016
Tweet

Transcript

  1. Pine Mizune Jul 29, 2016 / Kichijoji.pm #8 An introduction

    to WebAssembly
  2. 1SPGJMF o (JU)VC !QJOF o 5XJUUFS!QJOF o ޷͖ͳݴޠ +BWB4DSJQU o

    ࢓ࣄͰॻ͍͍ͯΔݴޠ1FSM+4 o .PCJMF'BDUPSZ *OD
  3.  8FC"TTFNCMZ ͱ͸  8FC"TTFNCMZ ͷ࠷ۙͷಈ޲  8FC"TTFNCMZ ͷϝϦοτ 

    8FC"TTFNCMZ ͷར༻ϑϩʔ  σϞ 5BCMFPGDPOUFOUT
  4. ϒϥ΢β޲͚ ࣮ߦՄೳόΠφϦϑΥʔϚοτ • +BWB4DSJQUͷ୅ସͰ͸ͳ͍ • --7.ܥݴޠ͔ΒίϯύΠϧՄೳ • $ISPNF'JSFGPY /JHIUMZ Ͱ࣮૷ࡁΈ

    8FC"TTFNCMZͱ͸ C/C++/Rust WebAssembly LLVM compiler
  5. C/C++/Rust WebAssembly Compiler 94࢖͑͹$$ Ͱڞ௨Մೳ • [MJCD ͳͲ΋ಈ͘Α Perl /

    XS 1FSMͱ૊Έ߹Θͤͯ࢖͏ͳΒ
  6. n $ISPNFɺ8FC,JUɺ'JSFGPYɺ.JDSPTPGU&EHFɺ--7 .ɺ6OJUZΒ͕αϙʔτΛද໌  IUUQXXXQVCMJDLFZKQCMPHXFCBTTFNCMZIUNM n 7ɺ'JSFGPYɺ.JDSPTPGU&EHF͕ʮ8FC"TTFNCMZʯ ͷ࣮૷Λൃද ʢ IUUQXXXQVCMJDLFZKQCMPHWGJSFGPYNJDSPTPGU@FEHFXFC

    BTTFNCMZXFCIUNM 8FC"TTFNCMZͷ࠷ۙͷಈ޲
  7. 8FC"TTFNCMZ ͷϝϦοτ ߴ଎࣮ߦͱলϑΝΠϧαΠζ • ϒϥ΢βԋࢉॲཧͷߴ଎Խ ήʔϜ ը૾ॲཧ FUD – ߴ଎

    8FC"TTFNCMZ BTNKT +BWB4DSJQU௿଎ – ˞BTNKT .P[JMMB։ൃͷ +4ʹ੩తղੳ৘ใΛ෇༩ͨ͠αϒηοτ • సૹϑΝΠϧ༰ྔͷ࡟ݮ – BTNKT ͸ߴ଎ʹ࣮ߦͰ͖Δ͕ϑΝΠϧαΠζ͕ωοΫ – όΠφϦϑΥʔϚοτʹ͢Δ͜ͱͰղܾ
  8. 8FC"TTFNCMZ ͷར༻ϑϩʔ  ソースコード .ll .s .wast .wasm .c/.cpp LLVM

    IR (中間表現) WebAssembly のアセンブラ wasm のテキスト形式 (S式) wast をシリアライズしたもの
  9. 8FC"TTFNCMZ XBTU ܗࣜྫ (module (memory 1 (segment 8 "¥00¥00¥00¥00") )

    (export "memory" memory) (export "count" $count) (func $count (result i32) (local $$0 i32) (i32.store offset=8 (i32.const 0) (i32.add (set_local $$0
  10. 8FC"TTFNCMZ ͷར༻ϑϩʔ  ソースコード .ll .s .wast .wasm .c/.cpp wast

    をシリアライズしたもの ★ 簡単に試すなら Emscripten がオススメ
  11. QJOFNEXBTNFYBNQMF IUUQTHJUIVCDPNQJOFNEXBTNFYBNQMF σϞ