WebAssembly Threads - HTTP 203

  Рет қаралды 23,746

Chrome for Developers

Chrome for Developers

Күн бұрын

Пікірлер: 84
@timwangdev
@timwangdev 4 жыл бұрын
I love this version of HTTP 203 so much, which has a length of 20-30 mins and more in-depth conversation. Great work! 👻
@davidedey3623
@davidedey3623 4 жыл бұрын
Link to the episode on COOP and COEP that Jake mentioned at the end: kzbin.info/www/bejne/rJekeZRrfKd_n9E
@cat-.-
@cat-.- 4 жыл бұрын
Woo this is what i wanted to learn about but too lazy to look at docs and specs Happy halloween👻
@rishabhanand4270
@rishabhanand4270 4 жыл бұрын
Beautiful explanation surma. Now im onward to find a usecase of wasm threads for my blogging website.
4 жыл бұрын
We are hopefully going to see a lot of C libraries, like image and video processing being ported to the web! 👻
@jakearchibald
@jakearchibald 4 жыл бұрын
That's what we did for squoosh.app
4 жыл бұрын
@@jakearchibald I know, I peeked under the dev tools hood!
@sonyarianto
@sonyarianto 4 жыл бұрын
wow Surma, brilliant, you have deep undertanding of how things work
@BrickieBuilder
@BrickieBuilder 4 жыл бұрын
Really enjoyable breakdown of modern specs mapped to support classical programming paradigms.
@dandcodes
@dandcodes 4 жыл бұрын
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 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
@hypersonic12
@hypersonic12 4 жыл бұрын
SIMD intrinsics tutorial in Rust next please!
@RickBeacham
@RickBeacham 4 жыл бұрын
I really enjoy learning from both you! Thanks!
4 жыл бұрын
If the slides are skipping, it’s probably the joy-con drift.
@timgerk3262
@timgerk3262 4 жыл бұрын
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 👻
@tahoemph
@tahoemph 4 жыл бұрын
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.
@fatemehazizkhani5414
@fatemehazizkhani5414 4 жыл бұрын
thanks for sharing this helpful and informative talk with us... I am new in programming and watching such videos makes me excited
@wobble_cat
@wobble_cat 4 жыл бұрын
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
@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.
@juliasemenova4000
@juliasemenova4000 3 жыл бұрын
The perfect playlist for daily watching 👻
@AndrzejPauli
@AndrzejPauli 4 жыл бұрын
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.
@DavidAlsh
@DavidAlsh 5 ай бұрын
I'd love an update on the state of wasm, threads, etc, Rust in 2024!
@Aphixx
@Aphixx 4 жыл бұрын
How expensive is context switching from JS to wasm? Is it different in a worker/thread context? Cheers 👻
@dassurma
@dassurma 4 жыл бұрын
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 4 жыл бұрын
@@dassurma Interesting, I definitely didn't expect that to be the case for emscripten/OpenGL -- thanks!
@SimonBuchanNz
@SimonBuchanNz 4 жыл бұрын
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.
@daniyelme9535
@daniyelme9535 4 жыл бұрын
Thank you guys!
@martixy2
@martixy2 4 жыл бұрын
9:45 Technically all of javascript is syntactic sugar over hardware machine code (x86, arm, what-have-you).
@SimonBuchanNz
@SimonBuchanNz 4 жыл бұрын
"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.
@MrUrag
@MrUrag 4 жыл бұрын
Thank you for sharing this video very informative and helpful.
@CyberAcidPlanet
@CyberAcidPlanet 4 жыл бұрын
10:32 should we call that a race condition?
@bahatijustin
@bahatijustin 4 жыл бұрын
I've been using WebAssembly with rust and c++ but think I should try writing WAT by hand 👻
@SmujMaiku
@SmujMaiku 4 жыл бұрын
"Oh no?" What oh no?
@lohitakshtrehan6379
@lohitakshtrehan6379 4 жыл бұрын
Happy Halloween!!! 👻
@florianreuschel2951
@florianreuschel2951 4 жыл бұрын
wait surma don't you leave us with that cliffhanger D:
@dassurma
@dassurma 4 жыл бұрын
Well the episode went live so it seems like everything went okay after all ;)
@GauravYadav-rv7wx
@GauravYadav-rv7wx 3 жыл бұрын
I see a photo of gentleman, it's written gone but not forgotten, who is he?
@charlescote3989
@charlescote3989 3 жыл бұрын
I was wondering the same
@EonMack
@EonMack 4 жыл бұрын
Are you using a joycon for changing slides?
@dassurma
@dassurma 4 жыл бұрын
Yes! Jake introduced me to that
@EonMack
@EonMack 4 жыл бұрын
@@dassurma is that just a joycon driver for bluetooth?
@dassurma
@dassurma 4 жыл бұрын
@@EonMack it doesn't even need a special driver. I just paired it and used Web Gamepad API
@EonMack
@EonMack 4 жыл бұрын
@@dassurma Awesome thanks for the response!
@SamualN
@SamualN 3 жыл бұрын
is that paul?
@patrickc.6183
@patrickc.6183 4 жыл бұрын
Great video 👻!
@maxb5919
@maxb5919 4 жыл бұрын
great vid. Thanks :3
@zuzanahroudova9028
@zuzanahroudova9028 4 жыл бұрын
Thanks! 👻
@kiwiabcdefghijklmnopqrstuvw
@kiwiabcdefghijklmnopqrstuvw 4 жыл бұрын
"gringo" died but you are still showing him as alive on google
@adamtolbert1296
@adamtolbert1296 4 жыл бұрын
I assume this has fully replaced the audio podcast then??
@jakearchibald
@jakearchibald 4 жыл бұрын
We're planning more podcasts, just been pretty busy with Chrome Dev Summit stuff recently.
@DJTechnostyler
@DJTechnostyler 4 жыл бұрын
You should have a look to AssemblyScript
@dassurma
@dassurma 4 жыл бұрын
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)
@Manivelarino
@Manivelarino 4 жыл бұрын
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 4 жыл бұрын
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 4 жыл бұрын
@@jakearchibald nothing is ever simple 😭
@dassurma
@dassurma 4 жыл бұрын
Except vertical centering nowadays 😮
@SimonBuchanNz
@SimonBuchanNz 4 жыл бұрын
@@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!)
@djudju8047
@djudju8047 4 жыл бұрын
The days of C are counted.
@srijanreddy
@srijanreddy 4 жыл бұрын
Amazing video guys...👻
@victornpb
@victornpb 4 жыл бұрын
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 4 жыл бұрын
You totally can. `new Uint8Array(new SharedArrayBuffer(128))` works. It often makes more sense to use `DataView` tho
@MaxCoplan
@MaxCoplan 4 жыл бұрын
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 4 жыл бұрын
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 4 жыл бұрын
@@dassurma that actually confused me, as I expected that the primary use would be float operations (for matrix math)
@dassurma
@dassurma 4 жыл бұрын
How is my statement confusing wrt the use case you are stating?
@SimonBuchanNz
@SimonBuchanNz 4 жыл бұрын
@@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 4 жыл бұрын
@@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.
@tmbarral664
@tmbarral664 4 жыл бұрын
spooky..ky....ky....ky...👻
@nathnolt
@nathnolt 4 жыл бұрын
Nice
@ratias0
@ratias0 4 жыл бұрын
Thanks, 👻
@GiangLe-xi5gv
@GiangLe-xi5gv 4 жыл бұрын
👻👻
@miroslavparvanov
@miroslavparvanov 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 4 жыл бұрын
That's why Wasi is so important imo
@rlamacraft
@rlamacraft 4 жыл бұрын
Cool, but why??
@jakearchibald
@jakearchibald 4 жыл бұрын
Well… threads have some history of success when it comes to application development
@rlamacraft
@rlamacraft 4 жыл бұрын
@@jakearchibald so is the end goal to turn the Web platform into a fully functional virtual machine?
@jakearchibald
@jakearchibald 4 жыл бұрын
@@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 4 жыл бұрын
@@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 4 жыл бұрын
@@rlamacraft I think that's kinda what the whole PWA thing is about web.dev/what-are-pwas/
@mikehurtado4772
@mikehurtado4772 4 жыл бұрын
Spanish subs. Thanks
Weak JavaScript - HTTP 203
29:22
Chrome for Developers
Рет қаралды 25 М.
Web animation gotchas - HTTP 203
20:10
Chrome for Developers
Рет қаралды 23 М.
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 2,6 МЛН
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 19 МЛН
Мама у нас строгая
00:20
VAVAN
Рет қаралды 11 МЛН
Slashing layout cost with content-visibility - HTTP 203
18:14
Chrome for Developers
Рет қаралды 34 М.
3.143 ways to synchronize data across documents - HTTP 203
16:21
Chrome for Developers
Рет қаралды 21 М.
Top 10 performance pitfalls - HTTP 203
36:31
Chrome for Developers
Рет қаралды 37 М.
Cross-origin fetches - HTTP 203
23:42
Chrome for Developers
Рет қаралды 39 М.
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,6 МЛН
Rust & Wasm
9:38
No Boilerplate
Рет қаралды 197 М.
AssemblyScript - HTTP 203
28:46
Chrome for Developers
Рет қаралды 23 М.
Surma’s Interop Adventure - HTTP 203
14:43
Chrome for Developers
Рет қаралды 11 М.