Wonderful WebAssembly

Wonderful WebAssembly

WebAssembly is neither "web" nor "assembly" - but 100% amazing. It is our one chance to build a fast, safe, and universal compilation target for all languages and all platforms.

Let me show you why this is cool and how to get started with WebAssembly in Go, C, and Rust.

We will also learn about up and coming features of WebAssembly (like WASI) that will make it even faster and more versatile. Let's change the way we write software forever!

Ed9e9992fe069a0d3de05b69d8d187c3?s=128

Matthias Endler

November 07, 2019
Tweet

Transcript

  1. 2.

    Matthias Endler ...works at trivago ...mostly Backend ...afraid of Frontend

    ...Python/Golang/Rust ...Runs "Hello Rust" https://endler.dev
  2. 4.
  3. 5.
  4. 6.
  5. 7.
  6. 8.
  7. 10.
  8. 11.
  9. 12.

    " UNIX is very simple.
 It just takes a genius


    to understand its simplicity. " -- Dennis Ritchie
  10. 13.
  11. 15.
  12. 16.
  13. 18.
  14. 19.
  15. 20.
  16. 21.
  17. 22.
  18. 23.
  19. 24.

    function Vb(d) { d = d | 0; var e

    = 0, f = 0, h = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0, r = 0, s = 0; e = i; i = i + 12 | 0; f = e | 0; [l + 4 >> 2] = 0; l = (c[1384465] | 0) + 3 | 0; do { if (l >>> 0 < 26) { if ((c[1356579] | 0) > 0) { m = d + 4 | 0; n = 0; while (1) { o = c[(c[1356577] | 0) + (n << 2) >> 2] | 0; do { if (a[o + 22 | 0] << 24 >> 24 == 24) { if (!(Vp(d, o | 0) | 0)) { break } p = (c[m >> 2] | 0) + (((c[h >> 2] | 0) - 1 | 0) * 40 & -1) + 12 | 0; q = o + 28 | 0; c[p >> 2] = c[q >> 2] | 0; c[p + 4 >> 2] = c[q + 4 >> 2] | 0; c[p + 8 >> 2] = c[q + 8 >> 2] | 0; c[p + 12 >> 2] = c[q + 12 >> 2] | 0; c[p + 16 >> 2] = c[q + 16 >> 2] | 0; asm.js
  20. 25.
  21. 28.
  22. 29.
  23. 30.
  24. 31.
  25. 32.
  26. 33.
  27. 39.
  28. 40.
  29. 41.

    5 3

  30. 42.
  31. 43.
  32. 44.
  33. 50.

    (func (param $foo i32) (param $bar f32) (local $baz f64)

    get_local $foo get_local $bar get_local $baz )
  34. 51.

    (module ( func (param $a i32) (param $b i32) (result

    i32) get_local $a get_local $b i32.add ) )
  35. 52.

    (module (func $add (param $a i32) (param $b i32) (result

    i32) get_local $a get_local $b i32.add) (export "add" (func $add)) )
  36. 53.

    (module (type $type0 (func (result i32))) (table 0 anyfunc) (memory

    1) (export "memory" memory) (export "hello" $func0) (func $func0 (result i32) i32.const 16 ) (data (i32.const 16) "Hello World\00" ) )
  37. 54.
  38. 56.
  39. 57.
  40. 58.
  41. 59.
  42. 60.
  43. 61.
  44. 62.

    0 750 1500 2250 3000 Go C Rust How big

    is " Hello World " (in KB)? 40k 1k
  45. 63.
  46. 64.
  47. 65.

    0 750 1500 2250 3000 Go C Rust "Hello World"

    unoptimized (KB) 20k 400 bytes
  48. 66.
  49. 67.
  50. 70.
  51. 72.
  52. 73.
  53. 74.
  54. 75.
  55. 76.
  56. 77.
  57. 78.
  58. 81.