$30 off During Our Annual Pro Sale. View Details »

Avoiding spelling mistakes: a WebAssembly tale

Avoiding spelling mistakes: a WebAssembly tale

An overview of WebAssembly, a brief introduction to Rust and a real world use case for using both to provide spell checking on the frontend.
Talk given at SFScon 2020.

Riccardo Magliocchetti

November 14, 2020
Tweet

More Decks by Riccardo Magliocchetti

Other Decks in Programming

Transcript

  1. Avoiding spelling mistakes:
    Avoiding spelling mistakes:
    a WebAssembly tale
    a WebAssembly tale
    Riccardo Magliocchetti
    Riccardo Magliocchetti

    View Slide

  2. whoami
    whoami
    So ware developer @ Maieu cal Labs
    Consultant
    Torino Hacknight @tohacknight

    View Slide

  3. Avoiding spelling mistakes:
    Avoiding spelling mistakes:
    a WebAssembly tale
    a WebAssembly tale
    Agenda:
    WebAssembly
    Rust
    A real-world use case

    View Slide

  4. WEBASSEMBLY
    WEBASSEMBLY

    View Slide

  5. WebAssembly is a portable binary format, developed as
    compila on target.
    webassembly.org

    View Slide

  6. WebAssembly is a portable binary format, developed as
    compila on target.

    View Slide

  7. WebAssembly is a portable binary format, developed as
    compila on target.

    View Slide

  8. Working but still WIP
    Working but still WIP
    JS BigInt and 64 bit WASM Integer integra on, no
    Webkit
    SIMD, not enabled by default
    Threads and atomic opera ons, no Webkit
    , s ll experimental
    WASI
    Source: webassembly.org/roadmap

    View Slide

  9. Main features
    Main features
    Fast
    Safe
    Compute only

    View Slide

  10. WASM targets
    WASM targets
    Browsers: ,
    JS Run me: ,
    WASM Run me: ,
    93% users WebAssembly MDN docs
    Node.js Deno
    wasm me wasmer

    View Slide

  11. Programming Languages
    Programming Languages
    C/C++:
    :
    C#:
    Other
    Emscripten
    Rust Working Group
    AssemblyScript
    Blazor

    View Slide

  12. Why WebAssembly?
    Why WebAssembly?
    Applica ons por ng to the Web, e.g.
    Reuse code in JavaScript
    One run me for many languages
    Pyodide

    View Slide

  13. RUST
    RUST

    View Slide

  14. Rust
    Rust
    Fast
    Reliable
    Rich ecosystem

    View Slide

  15. Uses of Rust
    Uses of Rust
    Systems programming
    Embedded
    Good integra ons with other languages:
    C,
    Python,
    WebAssembly :)
    cargo-c
    PyO3

    View Slide

  16. How to learn Rust?
    How to learn Rust?
    The book
    Italian meetups

    View Slide

  17. A use case
    A use case
    Add spell checking to a web applica on using SymSpell

    View Slide

  18. Problems
    Problems
    CPU intensive
    No available JS implementa on

    View Slide

  19. Solution
    Solution
    Por ng the to WebAssembly!
    Rust implementa on

    View Slide

  20. Our contributions
    Our contributions
    Op mized WebAssembly por ng
    More features
    Tech details: Nicola Mar no at Rustlab 2020
    talk

    View Slide

  21. That's all folks! Any question?
    That's all folks! Any question?
    github.com/xrmx
    speakerdeck.com/xrmx
    @rmistaken

    View Slide