WebAssembly: A new development paradigm for the web

Sdílet
Vložit
  • čas přidán 9. 05. 2023
  • WebAssembly (Wasm) is a low level, high-performance binary format for the web, which can be compiled from languages such as C++, Swift, Dart, & Kotlin. In this talk we’ll showcase new developments in language support, usability, and increased performance. We’ll also show you how to get started quickly yourself!
    Resources:
    AutoCAD blog → goo.gle/3LtWASX
    Figma blog → goo.gle/3VtzekR
    PS blog → goo.gle/3nsglSU
    Speakers: Thomas Nattestad, Vivek Sekhar
    Watch more:
    Watch all the Technical Sessions from Google I/O 2023 → goo.gle/IO23_sessions
    Watch more Web Sessions → goo.gle/IO23_web
    All Google I/O 2023 Sessions → goo.gle/IO23_all
    Subscribe to Google Chrome Developers → goo.gle/ChromeDevs
    #GoogleIO
  • Věda a technologie

Komentáře • 123

  • @ChromeDevs
    @ChromeDevs  Před rokem +3

    Want to learn more about what's new for the web? Check out the Web Keynote at #GoolgeIO → goo.gle/IO23_webkey_pin

  • @ben6
    @ben6 Před rokem +44

    Ahh, Wasm and JS will share memory. It would be good hear more about how race conditions are avoided.

    • @VincentPride1986
      @VincentPride1986 Před rokem +8

      Just write a good code and race conditions will be avoided

    • @Joshua-dc4un
      @Joshua-dc4un Před rokem +22

      ​@@VincentPride1986 just imagine creating a platform feature that requires the developer to write "good" code for it to work... it has always worked out well, right? 😂

    • @VincentPride1986
      @VincentPride1986 Před rokem

      @@Joshua-dc4un a man can only dream... Anyways, let's wait for LLMs to replace low level programming in a few years

    • @mAcCoLo666
      @mAcCoLo666 Před rokem +13

      Why would you have race conditions by just sharing memory? Your run-of-the-mill program already shares memory with the rest of your computer programs...

    • @perplexedmoth
      @perplexedmoth Před 11 měsíci +4

      There is already SharedArrayBuffer supported in all browsers which allows you to share memory. The other, possibly bigger, issue with sharing memory is the object memory layout difference between that of JS, and the language that uses WASM. Accessing the same objects from both languages requires a language-agnostic memory layout, or pay the penalty of serialization/deserialization.
      Regarding the comment on race conditions, that doesn't make sense, since there's no multi-threading support, and hence there's no "race condition"s as I understand it to mean. If you mean just programmer errors stemming from mutating objects through multiple scopes, that can still happen using JS only.

  • @muhamedkarajic
    @muhamedkarajic Před 11 měsíci +1

    Truly amazing!

  • @d-o-n-u-t
    @d-o-n-u-t Před rokem +47

    I think the biggest thing holding WASM back is its reliance on the JS namespace to access and manipulate the DOM. If there were some way to do it natively, without having to call into JS, I think WASM could be much bigger, and much faster. Interfacing from WASM to JS to the JS engine to the UI takes time - would be nice if there was some API exposed that let you skip the middleman.

    • @walrider7374
      @walrider7374 Před rokem

      JS needs to die, it has been a needed evil for far too long

    • @Yous0147
      @Yous0147 Před rokem +14

      This is the one thing I want from WASM. Being able to interact with the DOM would be a gamechanger for sure, and I genuinely hope it's in the works.

    • @thomasnattestad2450
      @thomasnattestad2450 Před rokem +13

      We actually looked heavily into this and you might be surprised to hear that the interface from JS to wasm is not heavily impacting performance. The only thing that really takes time is converting from linear memory into strings for API calls and this is going away with the new stringRef proposal. JS isn't slowing down wasm.

    • @Yous0147
      @Yous0147 Před rokem +8

      @@thomasnattestad2450 That's good to know but I think the real reason most people want a direct API is moreso because they want to skip that glue code setup and use whatever language WASM supports to manipulate the DOM directly. The added bonus if that is that you then won't need to cross communicate between languages which on all accounts would be simpler and faster.

    • @thomasnattestad2450
      @thomasnattestad2450 Před rokem +4

      @@Yous0147 Yeah, I definitely appreciate that the glue code can be cumbersome to set up. We've considered devtools / tooling changes to hide that more but it's a tough decision since sometimes you will want to debug those connections. The performance impact of communication between languages is the part that should be removed with stringRef (at least for string based API calls, which is most web APIs)

  • @cold_ultra
    @cold_ultra Před rokem +6

    So I no longer need to copy buffers back and forth if I use wasm GC? huge if true, unfortunaltelly I could not find any simple demo to play arround with

    • @MirosawSiwecki
      @MirosawSiwecki Před měsícem

      In C# Blazor webassembly its the fourth year you dont need it

  • @amlivinginhell
    @amlivinginhell Před 10 měsíci

    is wasm used only to compile codes from other languages to wasm?

  • @gzoechi
    @gzoechi Před rokem +10

    Rust works great with WASM in the browser (and backend)

  • @nested9301
    @nested9301 Před rokem +4

    What is the best language to choose for wasm ? Also i hope that the react ecosystem and architecture are not forgotten

    • @kenneth_romero
      @kenneth_romero Před rokem +4

      currently I think Rust has the best support, but Rust is a tough language to learn. Kotlin is pretty nice since you can also code for Android and Apple within the same code. But any language you are comfortable in that is able to compile into web assembly is all you need. Though I heard debugging webassembly is still pretty tough and the debugging tools are not that fleshed out yet.

  • @StefanGoldener
    @StefanGoldener Před rokem +29

    So what's the better cross-platform development stack? DART/FLUTTER or KOTLIN/JETPACK COMPOSE? Kotlin seems still the most popular at Google (amount of Development/News). Furthermore, for new Projects with the new WEB capability, Kotlin can do what Flutter already could do while keeping the existing codebase. So there is no need for Flutter anymore 🤔. Would be great if Google could clear this up a bit so choices on which language/framework to use in long-term cross-platform development/new projects could be made easier.

    • @_umutyilmaz
      @_umutyilmaz Před rokem +6

      I agree that Google should decide about the better long-term option, and continue investing in it. It should be Compose imho.

    • @RomanTchekashov
      @RomanTchekashov Před rokem +10

      With Dart+Flutter you can write UI logic once but with Kotlin KMM you can reuse only bussiness logic. So with Dart+Flutter you can create multiplatform apps faster.

    • @Mzulfreaky
      @Mzulfreaky Před rokem +7

      For me, more options are better

    • @walrider7374
      @walrider7374 Před rokem +9

      I think Flutter UI is far better than Compose...
      But man, Dart is ugly as hell... once you taste the sweet of Kotlin, Dart taste like old Java

    • @RomanTchekashov
      @RomanTchekashov Před rokem +2

      @@walrider7374 I agree with you. I don't know why google engineers cannot develop language which developers gonna like;

  • @mrmoon18
    @mrmoon18 Před rokem

    Nice Pingu at the end!

  • @user-gy1hb1cq8x
    @user-gy1hb1cq8x Před 11 měsíci

    Is webassembly supported in android system webview? and other mobile platform webview? like flutter webview and android webview devtool

  • @SamSiah-tn5pb
    @SamSiah-tn5pb Před 3 měsíci

    @Thank you sir ☺️🙏🏻🇮🇩

  • @thats-no-moon
    @thats-no-moon Před rokem +1

    This is wild

  • @guai9632
    @guai9632 Před 10 měsíci

    I want wasm everywhere. an os with wasm as first-class or even only way to distribute software would be great.

  • @avi12
    @avi12 Před rokem

    1:28 I'm wondering why Google Earth is not listed

  • @IlyaIzr
    @IlyaIzr Před rokem +1

    So, if you're web dev - you might get new faster libraries
    If you're not web dev - you can extend your app to the web via WA

  • @justmichael1
    @justmichael1 Před rokem

    webp-hero does not use WASM as per their documentation on npmjs

  • @bashorov
    @bashorov Před rokem +12

    If you have any questions about Kotlin/Wasm or Wasm GC, don't hesitate to ask below.

    • @jakerunzer
      @jakerunzer Před rokem

      Is there any information on when Wasm GC will be available? Or how to use it currently?
      Also, how will Wasm GC work in non-browser environments such as wasmtime?
      It looks awesome though! Looking forward to using it :D

    • @bashorov
      @bashorov Před rokem +2

      @@jakerunzer standalone VMs, like wasmtime and WasmEdge recently started implementing GC proposal

    • @LEDsellers
      @LEDsellers Před rokem +2

      If there any possibility that a JS codebase (client side) can be compiled to WASM and be run on the desktop as an alternative to electron? Would this JS compiled wasm app be multithreaded and no longer be single threaded?

    • @adsick_ua
      @adsick_ua Před rokem

      Hello, what does Wasm GC means for languages that do not use GC? like Rust for example. Will it improve memory management and perf of calling into DOM/WebGPU?

    • @bashorov
      @bashorov Před rokem

      ​@@adsick_ua those languages can continue using linear memory and ignore new things introduced by GC proposal. The proposal will not help with memory management nor browser APIs. They can use reference types to simplify interop with an external world, maybe it will help a bit with some runtime overheads.

  • @bernardosoccal1981
    @bernardosoccal1981 Před rokem +5

    Blazor hype!

  • @_sonatard2568
    @_sonatard2568 Před rokem +6

    How does WebAssembly render UI in Chrome?

  • @krishanakumar490
    @krishanakumar490 Před 11 měsíci

    Can I use your videos on my CZcams channel if I want.

  • @GillyTech
    @GillyTech Před 9 měsíci +10

    Presentations like this make me feel like Google has a box of generic developers they can Mr. Potato Head up and put in front of a camera and read the script. As genuine as a car salesman.

    • @autohmae
      @autohmae Před 9 měsíci +6

      In the current age, you have to wonder: is it AI-generated ?

  • @activewire-web5710
    @activewire-web5710 Před 6 měsíci

    Why Rust was not mentioned?

  • @Vardiak
    @Vardiak Před rokem +3

    "with no store getting in the way, and no revenue split affecting your profitability" 21:30 🤔

    • @zohaib9381
      @zohaib9381 Před rokem +1

      bro forgot he works for the company taking that split

  • @FlutterShipp
    @FlutterShipp Před 2 měsíci

    ❤‍🔥❤‍🔥❤‍🔥❤‍🔥

  • @rammrras9683
    @rammrras9683 Před rokem

    I don't understand if the end result is HTML or just a cavans rendered ?

    • @HybridLizard_com
      @HybridLizard_com Před rokem +2

      In short it is about fast data computation. What data you compute is up to you and you can exchange it with JS code e.g. to render on canvas, but also to handle some data not related to graphics processing. It is not about DOM manipulation (html elements, its attributes etc.)

  • @jobiej7416
    @jobiej7416 Před rokem

    Kmm on the web is interesting.

  • @juan-ramonsanchis-alberich2509

    EXCELLENT PRESENTATON. VERY VALUABLE. CONGRATS.

  • @DavidAlsh
    @DavidAlsh Před rokem +1

    Would love it if threads were not restricted to same-origin opener and embedder applications as that basically disables any capacity for third party integrations - plus you can't add those headers easily with simple web infrastructure like an S3 website, GitHub pages site - etc
    Looking forward to the day I can write my application entirely in Rust and not thunk everything through JavaScript!

  • @DinoFancellu
    @DinoFancellu Před rokem +2

    What's the status of Java+WASM?

    • @wuxxy
      @wuxxy Před rokem +9

      Why would anyone want to use Java in 2023?

    • @cryMoreLoL
      @cryMoreLoL Před rokem +9

      @@wuxxy Seriously! The only reason why it still exists is because of legacy code. No one is thinking "I'm going to built this new app in Java!" Kotlin would make more sense, but Java? 🤦‍♂

    • @walrider7374
      @walrider7374 Před rokem +3

      Java?

    • @makara2711
      @makara2711 Před 8 měsíci

      kotlin is not a superset of java, you can be perfectly fine with using java wherever you use kotlin @@cryMoreLoL

  • @klafbang
    @klafbang Před rokem +2

    Very cool. You've invented Java applets.

  • @davidlearnforus
    @davidlearnforus Před rokem

    I know its difficult but please someone use this for python web

  • @laughingvampire7555
    @laughingvampire7555 Před rokem

    is this the famous Thom who made JDSL?

  • @bababert8488
    @bababert8488 Před rokem +3

    The places where JavaScript isn't sufficient? So everywhere

  • @ck_naik
    @ck_naik Před rokem +2

    They talked about rust c c++ even Swift but not c# 😅 shows how much they hate. Hopefully it will change

    • @thomasnattestad2450
      @thomasnattestad2450 Před rokem +5

      We love C# and Blazor! We work actively with that team and they have a great experience. Honestly the only reason we didn't cover it is because the team does a killer job already with talks and documentation

    • @ck_naik
      @ck_naik Před rokem

      @@thomasnattestad2450 But still you should mention them atleast once

    • @thomasnattestad2450
      @thomasnattestad2450 Před rokem +3

      @@ck_naik I do mention that there are many other languages adding support. In an earlier draft I did rattle off the languages but there were just so many and I felt guilty leaving any single one out so I went with the generic coverage. Fair complaint tho :)

    • @ck_naik
      @ck_naik Před rokem

      @@thomasnattestad2450 thanks 🙏 Great talk though

  • @wickedtorpedo75
    @wickedtorpedo75 Před 6 měsíci

    кто шарит будь добры скажите пожалуйста (я чет особо не хочу углублять в эту тему просто зашел сюда не на роком), если коммпилированный код flutter/kotlin на web assembly в 2 раза быстрее чем компиляция на js (16:13) то почему вообще компилировать код на js, почему все компилирует на js или есть подводные камни (необходимость переписать в какой то части код)?

  • @nested9301
    @nested9301 Před rokem +1

    See u 15years later when wasm will be production readyy

  • @Ahmarth
    @Ahmarth Před rokem +4

    Uff, doing Rust dirty, saying it cannot keep track of its own memory :D

    • @dmitriidemenev5258
      @dmitriidemenev5258 Před rokem

      You do .forget() because you transfer ownership of closure to JavaScript engine.

  • @melveric1
    @melveric1 Před rokem

    The language about managing memory is quite misleading, but this video is about advertising that google‘s runtime memory managed languages finally work in Washington too, so this must be assumed.

  • @yapet
    @yapet Před rokem +9

    Jetpack compose on web… dies of canvas 💀. This is flutter all over again

  • @gregdee9085
    @gregdee9085 Před 6 měsíci +3

    Ahhh leave it to these yoyos to bring in those crap bloated languages to WASM, there's a reason C++/C is used to do all the real stuff....

    • @josiahparry
      @josiahparry Před 2 měsíci

      I’m only upvoting this because of the term “yo-yo” cracked me up.

  • @pablovaldes6022
    @pablovaldes6022 Před rokem +4

    👀 bye bye JS 😢

    • @mzg147
      @mzg147 Před rokem +12

      👀 bye bye JS 😁

    • @DJenriqez
      @DJenriqez Před rokem +12

      yeah, I'm listening this for 5 years.... it was always about community, frameworks, libraries, exampels, tutorials, never about technology itself

    • @ryanleemartin7758
      @ryanleemartin7758 Před rokem +2

      @@DJenriqez I mostly agree but in this case I think it it's also about the technology.

    • @LEDsellers
      @LEDsellers Před rokem +2

      can’t JS also now compile to WA?

    • @pablovaldes6022
      @pablovaldes6022 Před rokem

      @@LEDsellers I believe so, that's right 🙌🏻

  • @MultiDringus
    @MultiDringus Před rokem

    EggheadAssembly

  • @foobar3770
    @foobar3770 Před rokem

    Whoever said that Rust is an Alloc/free language has no clue about the borrow checker.