WebAssembly Threads - HTTP 203

Поділитися
Вставка
  • Опубліковано 24 сер 2024

КОМЕНТАРІ • 84

  • @timwangdev
    @timwangdev 3 роки тому +41

    I love this version of HTTP 203 so much, which has a length of 20-30 mins and more in-depth conversation. Great work! 👻

  • @cat-.-
    @cat-.- 3 роки тому +29

    Woo this is what i wanted to learn about but too lazy to look at docs and specs
    Happy halloween👻

  • @rishabhanand4270
    @rishabhanand4270 3 роки тому +11

    Beautiful explanation surma. Now im onward to find a usecase of wasm threads for my blogging website.

  • @davidedey3623
    @davidedey3623 3 роки тому +3

    Link to the episode on COOP and COEP that Jake mentioned at the end: ua-cam.com/video/vfAHa5GBLio/v-deo.html

  •  3 роки тому +7

    We are hopefully going to see a lot of C libraries, like image and video processing being ported to the web! 👻

    • @jakearchibald
      @jakearchibald 3 роки тому +3

      That's what we did for squoosh.app

    •  3 роки тому

      @@jakearchibald I know, I peeked under the dev tools hood!

  • @sonyarianto
    @sonyarianto 3 роки тому +2

    wow Surma, brilliant, you have deep undertanding of how things work

  • @BrickieBuilder
    @BrickieBuilder 3 роки тому +1

    Really enjoyable breakdown of modern specs mapped to support classical programming paradigms.

  •  3 роки тому +6

    If the slides are skipping, it’s probably the joy-con drift.

  • @hypersonic12
    @hypersonic12 3 роки тому +7

    SIMD intrinsics tutorial in Rust next please!

  • @dandcodes
    @dandcodes 3 роки тому +20

    Does Surma use a Switch controller for navigating slides during these videos?

    • @LuLeBe
      @LuLeBe 2 роки тому

      I think they've done that a few times, yes. Maybe more than a few times but I've only actually seen it like 2 times.

  • @gouravkhator
    @gouravkhator 3 роки тому +4

    Thank you guys this is just another great video which can be learnt or studied through great researches and many years of knowledge and experience

  • @RickBeacham
    @RickBeacham 3 роки тому +2

    I really enjoy learning from both you! Thanks!

  • @timgerk3262
    @timgerk3262 3 роки тому +1

    this is a compliment from the not-quite-dead-and-gone: wasm is becoming what Java always wanted to be, relative to JS as a complete & event-driven job control language...SPOOKY 👻

  • @jaysistar2711
    @jaysistar2711 2 роки тому

    19:30 It can be argued that the OS is outside of the process, and, therefore, the same sort of thing is done to spawn threads: a"system call" or some exposed way of calling something running at a more privledged level.

  • @wobble_cat
    @wobble_cat 3 роки тому +5

    Debugging with alerts? Yeah, I remember the time when I had many of them in a single script to make sure that everything is going how it supposed to be :D

  • @DavidAlsh
    @DavidAlsh 2 місяці тому

    I'd love an update on the state of wasm, threads, etc, Rust in 2024!

  • @tahoemph
    @tahoemph 3 роки тому +1

    The description of something that blocks after checking a value is close to how you would use a condition variable in combination with a mutex than what a bare mutex usually is.

  • @juliasemenova4000
    @juliasemenova4000 3 роки тому

    The perfect playlist for daily watching 👻

  • @fatemehazizkhani5414
    @fatemehazizkhani5414 3 роки тому

    thanks for sharing this helpful and informative talk with us... I am new in programming and watching such videos makes me excited

  • @AndrzejPauli
    @AndrzejPauli 3 роки тому

    If I'm right in anticipating what comes next; I would love to see some next HTTP 203 episode about Atomics and SharedArrayBuffers :-). Specially linking with previous episodes about COOP, CORB and other 4 letter acronyms security features. Maybe after release of Chrome 88 which will have those settled with crossOriginIsolated.

  • @CyberAcidPlanet
    @CyberAcidPlanet 3 роки тому +7

    10:32 should we call that a race condition?

  • @Manivelarino
    @Manivelarino 3 роки тому +9

    You really ran out of easy topics huh. Y u gotta bring assembly to my website I'm just trying to make my buttons look nice 😅

    • @jakearchibald
      @jakearchibald 3 роки тому +5

      fwiw, the next episode is about using CSS/JS to fade something in, and back out again… and all the ways that can go wrong.

    • @dassurma
      @dassurma 3 роки тому +2

      @@jakearchibald nothing is ever simple 😭

    • @dassurma
      @dassurma 3 роки тому +6

      Except vertical centering nowadays 😮

    • @SimonBuchanNz
      @SimonBuchanNz 3 роки тому

      @@dassurma not when you are trying to center the visual boundary of a button label, rather than the logical line boundary (at least from what I could find!)

  • @martixy2
    @martixy2 3 роки тому +2

    9:45 Technically all of javascript is syntactic sugar over hardware machine code (x86, arm, what-have-you).

    • @SimonBuchanNz
      @SimonBuchanNz 3 роки тому +1

      "syntactic sugar" is generally reserved for local translations, so eg functions are out due to things like argument renaming and return addresses being actual features that require agreement between different parts of the code, but a variable declaration might count as it's just an alias for some memory address (so long as you don't count the allocation of those addresses by the compiler)
      So WAT is reasonable to call a sugar, as the translation for each statement is very local and largely doesn't depend on any other part of the file (the only exceptions being a function name table, really)
      But really, sugar is a very ambiguous term, it's very hard to argue convincingly about why something is or isn't.

  • @daniyelme9535
    @daniyelme9535 3 роки тому +1

    Thank you guys!

  • @SmujMaiku
    @SmujMaiku 3 роки тому +3

    "Oh no?" What oh no?

  • @MrUrag
    @MrUrag 3 роки тому +1

    Thank you for sharing this video very informative and helpful.

  • @bahatijustin
    @bahatijustin 3 роки тому +1

    I've been using WebAssembly with rust and c++ but think I should try writing WAT by hand 👻

  • @SamualN
    @SamualN 2 роки тому +1

    is that paul?

  • @lohitakshtrehan6379
    @lohitakshtrehan6379 3 роки тому +1

    Happy Halloween!!! 👻

  • @Aphixx
    @Aphixx 3 роки тому +4

    How expensive is context switching from JS to wasm? Is it different in a worker/thread context?
    Cheers 👻

    • @dassurma
      @dassurma 3 роки тому +2

      Same thread. It’s fairly optimized, but obviously does have a small cost. But for example Emscripten calls into JS for every single OpenGL call (and backs it with WebGL) and it performs really well.

    • @Aphixx
      @Aphixx 3 роки тому

      @@dassurma Interesting, I definitely didn't expect that to be the case for emscripten/OpenGL -- thanks!

    • @SimonBuchanNz
      @SimonBuchanNz 3 роки тому

      There's some work to allow passing JS, including DOM, objects to WASM (which is currently sort of allowed), and allowing it to call into them, which presumably could be quite well optimized.

  • @zuzanahroudova9028
    @zuzanahroudova9028 3 роки тому +2

    Thanks! 👻

  • @GauravYadav-rv7wx
    @GauravYadav-rv7wx 3 роки тому +1

    I see a photo of gentleman, it's written gone but not forgotten, who is he?

  • @djudju8047
    @djudju8047 3 роки тому +1

    The days of C are counted.

  • @kiwiabcdefghijklmnopqrstuvw
    @kiwiabcdefghijklmnopqrstuvw 3 роки тому +1

    "gringo" died but you are still showing him as alive on google

  • @maxb5919
    @maxb5919 3 роки тому +1

    great vid. Thanks :3

  • @patrickc.6183
    @patrickc.6183 3 роки тому +1

    Great video 👻!

  • @florianreuschel2951
    @florianreuschel2951 3 роки тому

    wait surma don't you leave us with that cliffhanger D:

    • @dassurma
      @dassurma 3 роки тому

      Well the episode went live so it seems like everything went okay after all ;)

  • @tmbarral664
    @tmbarral664 3 роки тому

    spooky..ky....ky....ky...👻

  • @srijanreddy
    @srijanreddy 3 роки тому

    Amazing video guys...👻

  • @victornpb
    @victornpb 3 роки тому

    I don’t understand why you can’t have typed arrays like uint8_t as shared arrays, it would make a lot more sense than having everything tied to 64bit, specially for things like strings it puts unnecessary memory pressure specially for mobile devices

    • @dassurma
      @dassurma 3 роки тому +4

      You totally can. `new Uint8Array(new SharedArrayBuffer(128))` works. It often makes more sense to use `DataView` tho

  • @DJTechnostyler
    @DJTechnostyler 3 роки тому

    You should have a look to AssemblyScript

    • @dassurma
      @dassurma 3 роки тому

      Oh I am _very_ aware. I love ASC (to the point where I even wrote a rollup plugin for AssemblyScript. github.com/surma/rollup-plugin-assemblyscript)

  • @EonMack
    @EonMack 3 роки тому +2

    Are you using a joycon for changing slides?

    • @dassurma
      @dassurma 3 роки тому +3

      Yes! Jake introduced me to that

    • @EonMack
      @EonMack 3 роки тому +1

      @@dassurma is that just a joycon driver for bluetooth?

    • @dassurma
      @dassurma 3 роки тому +4

      @@EonMack it doesn't even need a special driver. I just paired it and used Web Gamepad API

    • @EonMack
      @EonMack 3 роки тому +1

      @@dassurma Awesome thanks for the response!

  • @miroslavparvanov
    @miroslavparvanov 3 роки тому +4

    I don't like the fact that we need javascipt glue code in order to use threads in wasm. Javascript will be unremovable legacy even after 100 years :(

    • @dassurma
      @dassurma 3 роки тому +2

      That's why Wasi is so important imo

  • @nathnolt
    @nathnolt 3 роки тому

    Nice

  • @MaxCoplan
    @MaxCoplan 3 роки тому

    Surma says SIMD types in WASM are just 128bits long. Are there any WASM runtimes that take advantage of native AVX instructions or YMM registers where available?
    The true power of SIMD doesn't come from the wide registers, it comes from the cpu-specific instructions that take advantage of them

    • @dassurma
      @dassurma 3 роки тому +1

      That is up to the engine. As I said, wasm is a intermediate format. So they needed a SIMD bit width and instruction set that compiles to native SIMD instructions on as many architectures as possible.

    • @SimonBuchanNz
      @SimonBuchanNz 3 роки тому

      @@dassurma that actually confused me, as I expected that the primary use would be float operations (for matrix math)

    • @dassurma
      @dassurma 3 роки тому

      How is my statement confusing wrt the use case you are stating?

    • @SimonBuchanNz
      @SimonBuchanNz 3 роки тому +1

      @@dassurma not your statement, sorry, the fact that i128 alone was found useful enough to spend the spec and implementation time on.
      I guess there are some uses like bloom filters or bignum (maybe image compression?) that can get a lot of value, but it's a bit of a surprising disappointment to me that float isn't when it's the first example I always see.
      I can see the argument that it's probably in the cases that you need float SIMD that you *need* it to be SIMD, while it's a nice to have for int, but that's just a guess.

    • @dassurma
      @dassurma 3 роки тому +1

      @@SimonBuchanNz Oh I think I understand now! Sorry, I wasn’t completely thorough in what I said. Of course the SIMD proposal also supports interpreting the 128-bit vector as 4x 32-bit float or 2x 64-bit float.

  • @adamtolbert1296
    @adamtolbert1296 3 роки тому

    I assume this has fully replaced the audio podcast then??

    • @jakearchibald
      @jakearchibald 3 роки тому

      We're planning more podcasts, just been pretty busy with Chrome Dev Summit stuff recently.

  • @ratias0
    @ratias0 3 роки тому

    Thanks, 👻

  • @GiangLe-xi5gv
    @GiangLe-xi5gv 3 роки тому

    👻👻

  • @mikehurtado4772
    @mikehurtado4772 3 роки тому

    Spanish subs. Thanks

  • @rlamacraft
    @rlamacraft 3 роки тому

    Cool, but why??

    • @jakearchibald
      @jakearchibald 3 роки тому +1

      Well… threads have some history of success when it comes to application development

    • @rlamacraft
      @rlamacraft 3 роки тому

      @@jakearchibald so is the end goal to turn the Web platform into a fully functional virtual machine?

    • @jakearchibald
      @jakearchibald 3 роки тому +1

      @@rlamacraft I'm not sure what you mean by "fully functional" or "virtual machine". Web pages already run in a sandbox of sorts. Eg, you don't want a web page to be able to access your local filesystem without up-front permission.

    • @rlamacraft
      @rlamacraft 3 роки тому

      @@jakearchibald I’m just observing the fact that it seems like as the Web evolves it’s approaching the full capabilities of a desktop runtime. I get that things are being done in a more secure way, as you say by explicitly requiring permissions for powerful features, so I guess it’s approaching something like iOS’s model. It started off with HTML, and then CSS, and then full Turing completeness with JS, and now we’re at the point where we’re running assembly code in threads. Is the goal to make the Web platform as capable as any desktop environment, albeit once the user has given full permissions?

    • @jakearchibald
      @jakearchibald 3 роки тому +1

      @@rlamacraft I think that's kinda what the whole PWA thing is about web.dev/what-are-pwas/