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

Getting Started with Swift WebAssembly

7a4968fbcd56e81f95a4f3c186141b52?s=47 Yuta Saito
September 07, 2019

Getting Started with Swift WebAssembly

iOSDC 2019

7a4968fbcd56e81f95a4f3c186141b52?s=128

Yuta Saito

September 07, 2019
Tweet

Transcript

  1. (FUUJOH4UBSUFEXJUI4XJGU 8FC"TTFNCMZ J04%$ !LBUFJOPJHBLVLVO 1

  2. 4XJGU8"4.Ͱ։ൃͯ͠Έͨ࿩ 2

  3. 4XJGU8"4.Ͱ։ൃͯ͠Έͨ࿩ 4XJGU8"4.Λ։ൃ͢Δ࿩ 3

  4. 8"4. 8FC"TTFNCMZ ϒϥ΢βͰಈ࡞͢Δ௿ڃݴޠ • ϙʔλϒϧ • ηΩϡΞ • ελοΫϚγϯ 4

  5. 4XJGUͰ8FCϑϩϯτΛॻ͖͍ͨʂʂ 5

  6. 4XJGUͷ8"4.ύΠϓϥΠϯ 6

  7. 4XJGUͷ8"4.ύΠϓϥΠϯ 7

  8. --7.ͱ4XJGUͷؔ܎ SwiftಠࣗͷLLVMଐੑ https://github.com/apple/swift-llvm • swiftself • swifterror 8

  9. 5ISPXTͳؔ਺ݺͼग़͠ typealias NonThrowableFunc = () -> Void typealias ThrowableFunc =

    () throws -> Void let f: NonThrowableFunc = {} let g: ThrowableFunc = f try g() 9
  10. /PO5ISPXBCMF'VOD5ISPXBCMF'VOD 10

  11. ϥϯλΠϜදݱ 4XJGU෩ typealias NonThrowableFunc = () -> Void typealias ThrowableFunc

    = (inout Error) -> Void let f: NonThrowableFunc = {} let g: ThrowableFunc = f var error: Error try g(&error) Ҿ਺ͷ਺͕૿͑ͯΔ https://speakerdeck.com/omochi/swiftfalseguan-shu-xing-falseshi-xing-shi-biao-xian 11
  12. TXJGUFSSPSͱ8"4.ϥϯλΠϜ ؔ਺ݺͼग़࣌͠ͷγάωνϟνΣοΫ -> callerͷݺͼग़ͦ͏ͱ͍ͯ͠Δγάωνϟͱcallee ͷγάωνϟ͕Ұக͠ͳ͍ͷͰΫϥογϡ https://webassembly.org/docs/security/ 12

  13. ରԠࡦ શͯͷؔ਺ʹswifterrorΛ෇͚ͯίʔυੜ੒͢Δɻ https://github.com/apple/swift/pull/24684#issuecomment-491487863 13

  14. ·ͱΊ • LLVMΛ࢖͍ͬͯͯ΋؆୯ʹ͸͍͔ͳ͍ • SwiftͷWASMରԠ͸΋͏গ͠଴ͬͯͶ 14

  15. 15