WEBASSEMBLY STACK MACHINE | Introduction to WebAssembly (WASM)

  Рет қаралды 6,310

Chris Hay

Chris Hay

Күн бұрын

this video gives you a brief tutorial into webassembly and how the webassembly stack machine operates.
chris first shows you how webassembly does math calculations using stacks by hand, and then in javascript. we then hand code squares, echo, multiply, add, subtract functions in webassembly text format (WAT) and then compile into WASM and executing in node.js. this video will get you super deep into understanding how webassembly operates under the hood.

Пікірлер: 29
@rebolyte
@rebolyte 2 жыл бұрын
Excellent intro! Starting with an understanding the foundation is great - no libraries, no dependencies, minimal tools. Please cover more topics 👏
@chrishayuk
@chrishayuk 2 жыл бұрын
thank you :)
@cxfuzion7824
@cxfuzion7824 3 жыл бұрын
dude your videos are solid gold, please continue to make more!
@chrishayuk
@chrishayuk 3 жыл бұрын
Thaaaanks that’s really kind of you to say, I have a few more webassembly ones in the pipeline. Glad it was useful
@ΝικΝοκ
@ΝικΝοκ Жыл бұрын
hi, nice videos. I'm more like into circuits in general (like working with verilog), but I find this web assembly very interesting
@ArlindoHonkRP
@ArlindoHonkRP 2 жыл бұрын
Excelent video, deserves more views!
@chrishayuk
@chrishayuk 2 жыл бұрын
thanks. glad you liked
@DmitryIvanovDfcreative
@DmitryIvanovDfcreative 2 жыл бұрын
Very helpful, thanks! Btw pretty cool short notation for params is (func $multiply (param i32 i32) (result i32) (i32.mult (local.get 0) (local.get 1)))
@chrishayuk
@chrishayuk 2 жыл бұрын
it's a good point.. i shyed away from doing short notation for simplicity but then forgot to mention it altogether, lol. great comment
@rmschindler144
@rmschindler144 Ай бұрын
note that you don’t need the `-o` flag when calling `wat2wasm`, and it will simply use the filename
@xtremewolve
@xtremewolve 3 жыл бұрын
Another fine video.
@chrishayuk
@chrishayuk 3 жыл бұрын
Glad you enjoyed it
@pss_crs
@pss_crs 3 жыл бұрын
Why video like this have 39 views, thanks you gave me great thoughts 👍.
@chrishayuk
@chrishayuk 3 жыл бұрын
Thanks :) I hope it will get more views too, glad it was thought provoking
@DysoniaMultiverseNews
@DysoniaMultiverseNews 3 ай бұрын
For example, RPN for stack is like the following: Like doing math vertical when in school 100 (first number entered... Bottom of Stack) 10 (Second Number entered (Higher up in stack or on top in this case)) - ___________ ( Do the mathematical operation: Subtract ) Hope the format remains.
@DysoniaMultiverseNews
@DysoniaMultiverseNews 3 ай бұрын
Will be interesting when doing something particularly fancy like complex compound math sequences and also with loops. I think we can do it with enough getting our minds around the syntax. The most extreme would be understanding how the binaries work on the instruction by instruction level and wrapping our minds around that and write it in a HEX EDITOR (old days, we called that ML Monitors).
@samferrer
@samferrer 2 жыл бұрын
At 9.48 you could just write return stack.pop() * stack.pop(), since push followed by pop is the identity function
@tgsoon2002
@tgsoon2002 2 жыл бұрын
we know that, he jsut try to replicate to stack machine as close as possible.
@enjoywatching2700
@enjoywatching2700 2 жыл бұрын
very nice 👍👍👍
@chrishayuk
@chrishayuk 2 жыл бұрын
Thank you very much, glad you liked 😀
@When_am_I
@When_am_I 2 жыл бұрын
Why didn’t I learn 1st grade math from you sir!
@chrishayuk
@chrishayuk 2 жыл бұрын
i'm hoping that was a complement, lol
@When_am_I
@When_am_I 2 жыл бұрын
@@chrishayuk yes sir, definitely a compliment!
@stal1963
@stal1963 3 ай бұрын
Not Alan Turing invented the stack, but F.L. Bauer and Samelson invented it independently in the 1920s. -> en.m.wikipedia.org/wiki/Stack_(abstract_data_type)
@lynndemarest1902
@lynndemarest1902 Жыл бұрын
Lovely video, but this from ChatGPT: Alan Turing did not invent the stack. The concept of a stack in computer science predates Turing's work. The stack is a fundamental data structure used in computer science and programming, and its origins can be traced back to the early development of electronic computers. The concept of a stack was introduced as part of the von Neumann architecture, which is the foundation for most modern computer systems. This architecture, proposed by John von Neumann in the mid-1940s, included the idea of a "last in, first out" (LIFO) storage mechanism, which is the fundamental characteristic of a stack. So, while Alan Turing made many significant contributions to computer science and mathematics, he was not the inventor of the stack. The concept of the stack emerged as a natural component of the early computer architectures.
@chrishayuk
@chrishayuk Жыл бұрын
the implementation of the turing machine is single-stack pushdown automaton which is fundamentally a stack. so it does pre-date von neumann architecture, sure the concept of a stack as we know it today was formalized in von neumanns work but remember the two worked together in princeton prior to this. i stick with my claim in terms of computing turing invented the stack, even if it wasn't formalized as that
@lynndemarest1902
@lynndemarest1902 Жыл бұрын
@@chrishayuk I, and Chat GPT, stand corrected! Never mind. Great video. Thank you! This stuff is moving fast for an old man like me! :)
@lynndemarest1902
@lynndemarest1902 Жыл бұрын
en.wikipedia.org/wiki/Stack_(abstract_data_type)#:~:text=Klaus%20Samelson%20and%20Friedrich%20L,invention%20of%20the%20stack%20principle.
@chrishayuk
@chrishayuk Жыл бұрын
@@lynndemarest1902 no worries, tough to keep track of these things, glad you enjoy and find the vids useful
Getting started with AssemblyScript | WebAssembly | Tutorial
22:44
Шок. Никокадо Авокадо похудел на 110 кг
00:44
Getting Started with WebAssembly (WASM) with Rust Lang
33:10
Chris Hay
Рет қаралды 11 М.
The Truth about Rust/WebAssembly Performance
29:47
Greg Johnston
Рет қаралды 181 М.
Coding raw WebAssembly Text - Dive into Wat
9:25
Context Free
Рет қаралды 7 М.
WASM is Awesome! Explained with Examples | Ft Docker
13:43
ByteMonk
Рет қаралды 5 М.
Why WebAssembly is the future of Web development
7:33
ROULZ
Рет қаралды 182 М.
Шок. Никокадо Авокадо похудел на 110 кг
00:44