Getting Started with WebAssembly and Rust: A First Look

  Рет қаралды 70,780

Engineer Man

Engineer Man

Күн бұрын

Пікірлер: 115
@abdullahabd7677
@abdullahabd7677 4 жыл бұрын
Engineer Man - "What's going on 'engineers'?" I guess I don't have imposter syndrome anymore.
@Conlexio
@Conlexio 4 жыл бұрын
personally i consider myself a scientist (.. computer scientist but still)
@hashkeeper
@hashkeeper 3 жыл бұрын
yeah you're right that really had a positive effect actually, i was like "huh, yeah maybe in a bit it i study"
@DucBanal
@DucBanal 4 жыл бұрын
Would be really interested to see a more involved project in WebAssembly with Rust. Thanks for the great content.
@EngineerMan
@EngineerMan 4 жыл бұрын
Yep, expect this in the future.
@the1whoplayz
@the1whoplayz 4 жыл бұрын
I was just starting to get into WebAssembly and Rust. Thanks for uploading it at a convenient time!
@lucianochadru4064
@lucianochadru4064 2 жыл бұрын
Yeah me too and honestly i don't get the point here. I tough we could build weapps with rust but..... i guess that's not exactly that
@jlegolas-YT
@jlegolas-YT 4 жыл бұрын
I was interested in Web Assembly, what a great timing!
@betoharres
@betoharres 4 жыл бұрын
I liked the simplicity; looking forward into more videos
@singhsaubhik
@singhsaubhik 3 жыл бұрын
This was so easy, even easier than using FFI (for other projects). Thank you so much sharing 👏
@scoldingtissue2217
@scoldingtissue2217 4 жыл бұрын
My computer literacy is so low that everything in this video was like a blur to me, still interesting to watch though
@jomy10-games
@jomy10-games 3 жыл бұрын
I would love to see more WebAssembly videos!
@HK-sw3vi
@HK-sw3vi 3 жыл бұрын
my project folder looks exactly the same as yours except 75% of them are either incomplete or empty
@carlosmspk
@carlosmspk 2 жыл бұрын
Don't know about everyone else, but I had to add some stuff to package.json for npm install to work: { "scripts": { "serve": "webpack-dev-server" }, "dependencies": { "wasm-server": "0.0.4", "webpack": "4.43.0", "webpack-cli": "3.3.11" } }
@violentcrumble6720
@violentcrumble6720 4 жыл бұрын
great video thank you, Would love to see more wasm stuff, It would be awesome if you could make a small game in rust that compiles into wasm, I have seen a lot of really awesome visual stuff made with wasm so would love to learn more.
@oyinloluwabalogun4833
@oyinloluwabalogun4833 3 жыл бұрын
Hey, when I try to run the server, it prompts me to download the wasm file. Is this because I did something wrong?
@ChamplooMusashi
@ChamplooMusashi 2 жыл бұрын
Happens to me too
@Tantandev
@Tantandev 4 жыл бұрын
Incredibly well paced and informative!
@JavierHarford
@JavierHarford 2 жыл бұрын
Hey Engineer Man, Thanks for this cool video, hoping that you get round to a more advanced example in the near future
@koensampers5505
@koensampers5505 3 жыл бұрын
where do you clarify that the wasmserver should open index.html? for example if you change that name to index2 it wont load.
@user-if7lb8zy8i
@user-if7lb8zy8i 3 жыл бұрын
I followed all the steps correclty but when I am opening localhost 3000 the wasm file just gets downloaded and I can see any page of any sort
@joaomelo9774
@joaomelo9774 2 жыл бұрын
hi. great intro video. tks! i would love to learn how to render user interfaces in the browser using the rust+wasm combo you introduced here. all I found talked about using some rust framework. but I'm really curious about the underlying mechanism. do you have any video on that?
@pcfreak1992
@pcfreak1992 4 жыл бұрын
So the JS files in the pkg directory are not translated (to JS) versions of the Rust code but just “helpers” for loading the WASM code in JS projects?
@EngineerMan
@EngineerMan 4 жыл бұрын
Yep, wasm-pack basically makes a module for you. Although you can just use the .wasm file directly and ignore the rest, if you desire.
@jakubsebek
@jakubsebek 4 жыл бұрын
Can you program graphics such as webGL with it?
@wrong1029
@wrong1029 4 жыл бұрын
yes rustwasm.github.io/wasm-bindgen/examples/webgl.html
@waynevanson277
@waynevanson277 4 жыл бұрын
I'd recommend parcel because there's no tedious config required (unless you want to). It supports rust and wasm.
@pavelkostetskiy7561
@pavelkostetskiy7561 4 жыл бұрын
overwhelming quality of content)) thank you)
@ElijahLM01
@ElijahLM01 4 жыл бұрын
for some reason when i attempt to put a function that calls wasm.add into init.js then link it to a button click it gives me an error saying that the function im calling isnt defined. any ideas?
@atridgedcosta4374
@atridgedcosta4374 4 жыл бұрын
Thanks for this video! Would be great to see a video on how to debug the webassembly/rust in the browser.
@_prothegee
@_prothegee 3 жыл бұрын
So basically variables or function from another language translated to javascript? and default runtime is from the browser engine?
@ledues3336
@ledues3336 4 жыл бұрын
Does NGINX support the Wasm MIME type?
@diarmaidmac2149
@diarmaidmac2149 4 жыл бұрын
A naiive question but why can't all that be done with just rust? It looks like a mess to me to cross reference javascript and wasm and complete all those tedious steps etc. It would be great to just use a single rust crate to write and compile to wasm without using javascript at all. Thanks for the tutorial! It would be great to see a practical example at some point to increase the incentive to dabble with wasm.
@kartikjavali205
@kartikjavali205 4 жыл бұрын
Great content! concisely delivered!!
@SayWhat6187
@SayWhat6187 4 жыл бұрын
Damn, I was just looking at Yew (Framework for Rust WASM) right now haha!
@ry_fpv
@ry_fpv 3 жыл бұрын
maybe webpack should be installed as devdependencies, but anywhere,very good intro video!!!
@escapefelicity2913
@escapefelicity2913 4 жыл бұрын
OT: How do I tell python to use a GPU or ASIC for sha256?
@iilugs
@iilugs 3 жыл бұрын
This madlad is using atom. Much respect
@RobertWildling
@RobertWildling 4 жыл бұрын
Would it be possible to "just" import a root file of a RUST library, convert it to wasm and the access the library's API from Javascript? Any chance to take you up on your statement that you might make more videos on that topic? Would be awesome! Maybe something with audio (maybe file converter? or an effect thingy...)
@ablanchi
@ablanchi 4 жыл бұрын
Cant wait to see more practical uses. Right now it just seems like 'thats pretty neat, but JS is already pretty fast'. Thanks for the videos as always!
@MrCutter
@MrCutter 4 жыл бұрын
JS pretty fast? Not really compared to others
@ablanchi
@ablanchi 4 жыл бұрын
@@MrCutter For the kind of stuff we ask JS to do in the browser, how much faster do you really need? Id love to see examples of parts of web applications that justify using wasm, with all its drawbacks.
@nangzdk
@nangzdk 4 жыл бұрын
Man people really hate javascript. Lot of steps to just write in a different language! Kidding! Nice video!
@ErnestGWilsonII
@ErnestGWilsonII 4 жыл бұрын
Thank you for taking the time to make this video and share it with all of us! Can you please be more specific about how a function in Rust apparently named fn was mapped up to a method in JavaScript with .add? I am still a little bit lost, as I do not know Rust (but I am trying to learn). Can you give the same super simple example where you have a couple of functions in Rust and then you call those functions from JavaScript? I am currently tripped up on how it maps up from JavaScript into Rust and I suspect if we had a couple of functions with various names that would help clarify things for me. Again thank you for making this video, I am subscribed with notifications turned on and of course thumbs up!
@EngineerMan
@EngineerMan 4 жыл бұрын
I think you just misread. It's written as `pub fn add`. `pub fn` is the designator in rust for a public function and then `add` is simply the name of the function.
@ErnestGWilsonII
@ErnestGWilsonII 4 жыл бұрын
@@EngineerMan thank you for responding, yes lack of understanding on my part and your clarification was excellent!
@y09i_
@y09i_ 4 жыл бұрын
why would it not replace javascript though if it is just faster? We can probably compile javascript to webassebly too, if we want to keep using javascript.
@rodrigocorrea7708
@rodrigocorrea7708 4 жыл бұрын
Hey Engineer Man, thanks for the video! May I ask which theme are you using in Atom?
@EngineerMan
@EngineerMan 4 жыл бұрын
It's the default, One Dark.
@rodrigocorrea7708
@rodrigocorrea7708 4 жыл бұрын
Engineer Man Thank you!
@codebroker_
@codebroker_ 4 жыл бұрын
When i run the wasm-server and go to localhost:3000, it just downloads the index.html file. What did I do wrong?
@elthomas_
@elthomas_ 4 жыл бұрын
Me too I fixed it by using npm "serve" instead of "wasm-server"
@89blumenkohl
@89blumenkohl 3 жыл бұрын
@@elthomas_ serve what?
@89blumenkohl
@89blumenkohl 3 жыл бұрын
cd dist; python -m http.server 3000
@therealdjflip
@therealdjflip 4 жыл бұрын
which plugin are you using to display the errors on the eft ?
@EngineerMan
@EngineerMan 4 жыл бұрын
What do you mean errors?
@therealdjflip
@therealdjflip 4 жыл бұрын
@@EngineerMan bad wording on my part @ 2:21 where the red! comes up etc
@EngineerMan
@EngineerMan 4 жыл бұрын
It's rls which is part of the rust-ide package.
@therealdjflip
@therealdjflip 4 жыл бұрын
Engineer Man cheers
@MichaelMantion
@MichaelMantion 4 жыл бұрын
Exactly the video I needed from the youtuber I prefer. Am I dying?
@EngineerMan
@EngineerMan 4 жыл бұрын
Nope you're very much alive.
@rish1459
@rish1459 4 жыл бұрын
Awesome content; do you foresee any issues where wasm may not be universally implemented across servers? That is, could the implementation be server dependent (write the implementation one way for one server and another way for others)? When do you foresee widespread server support for WASM?
@EngineerMan
@EngineerMan 4 жыл бұрын
I expect there to be widespread support among modern browsers. The stakeholders with respect to WASM include folks like Mozilla, Google, Microsoft, and Apple. None of the four stand to gain by bucking the system.
@rajeshwaris6663
@rajeshwaris6663 4 жыл бұрын
What distro youre on ?
@zemariagp
@zemariagp 4 жыл бұрын
Great stuff
@T1Oracle
@T1Oracle 4 жыл бұрын
This isn't working, "wasm-server" is serving my bundle.js as "text/html"
@adamturner6249
@adamturner6249 4 жыл бұрын
I only know Python and have been wanting to branch out into a lower-level, statically typed language. Recently I’ve been looking into Rust and this video helped me settle on it as the one I want to move forward with. Thanks, Engineer Man!
@EngineerMan
@EngineerMan 4 жыл бұрын
Rust is a fine choice indeed!
@unsafecast3636
@unsafecast3636 4 жыл бұрын
Wasm doesn’t get compiled to native. It’s a stack machine
@IoannisAudet
@IoannisAudet 3 жыл бұрын
Wait.... why does MDN Rust Webassembly tutorial looks exactly like this tutorial?
@coryulrich6489
@coryulrich6489 4 жыл бұрын
This reminds me of that programming parody where you just pay some code and suddenly have Minecraft.
@user-or7ji5hv8y
@user-or7ji5hv8y 4 жыл бұрын
When does JavaScript breakdown?
@hashkeeper
@hashkeeper 3 жыл бұрын
epic! thanks
@Dev_Everything
@Dev_Everything 2 жыл бұрын
Please do this in C++
@Eugensson
@Eugensson 4 жыл бұрын
Does not work for me - firefox suggests downloading the WASM file
@heidtmare
@heidtmare 4 жыл бұрын
this is happening to me too, i also tried Brave
@elthomas_
@elthomas_ 4 жыл бұрын
Fixed this by using npm "serve" instead of "wasm-server"
@89blumenkohl
@89blumenkohl 3 жыл бұрын
cd dist; python -m http.server 3000
@martinmaurer3935
@martinmaurer3935 2 жыл бұрын
His face at 6:33 ... priceless :D ..
@DeLaCruzer11
@DeLaCruzer11 2 жыл бұрын
Didnt Java tried that before?
@619frank
@619frank 4 жыл бұрын
Awesome
@SteveHazel
@SteveHazel 4 жыл бұрын
i mean, i shouuuld learn webpack and rust (i guess? webpack at least). i kiiiiiinda wish ya used c instead of rust though... for us old timers...
@avi12
@avi12 4 жыл бұрын
Omg, you can just in time! I'm trying to mess with WebAssembly and C++
@Chaosman88
@Chaosman88 4 жыл бұрын
whould you do a similar series with python?
@potatify6829
@potatify6829 4 жыл бұрын
Hey peeps
@sunhsiang6644
@sunhsiang6644 4 жыл бұрын
Emmm Response has unsupported MIME type
@dieweltentdecker5878
@dieweltentdecker5878 4 жыл бұрын
Pls make a AI video over adb.
@btarg1
@btarg1 4 жыл бұрын
this is a very complicated way to add two numbers together... lol
@Nexus-rt1bm
@Nexus-rt1bm 4 жыл бұрын
"This is a library you can get very quickly" No, not at all.
@alexandervonkoenigsegg1069
@alexandervonkoenigsegg1069 4 жыл бұрын
I read "Getting stabbed with WebAssembly"
@Nexus-rt1bm
@Nexus-rt1bm 4 жыл бұрын
Same thing at this point
@diablo.the.cheater
@diablo.the.cheater 4 жыл бұрын
webassembly is the thing of the devil, the browser should only have javascript, and the desktop application ought to be made in electron, the mobile apps as pwa and the servers run only node.js, that is the way
@baddlyghost5509
@baddlyghost5509 4 жыл бұрын
First
@ashishbisoi7488
@ashishbisoi7488 4 жыл бұрын
second
@TechdubberStudios
@TechdubberStudios 4 жыл бұрын
"We were able to add two numbers without writing any javascript" *literally writes import * as wasm let res = wasm.add(2,8) console.log(2,8)" No, this does not show the potential of webassembly. This could be done with just JavaScript in fewer lines of code, without using a bundler. To actually show the potential of WASM you'll have to actually do highly computational stuff, and create a benchmark between javascript code and wasm code @ runtime. If i didn't know what WASM is all about, I would've stuck with JavaScript without even considering looking into WASM.
@HotRatsAndTheStooges
@HotRatsAndTheStooges 4 жыл бұрын
This wasn't meant to show the potential of wasm, it was meant to show how you can use wasm in your own project. hence the title "Getting started"
@zemariagp
@zemariagp 4 жыл бұрын
Potential Noun 1. latent qualities or abilities that may be developed and lead to future success or usefulness. According to this, I see the potential.
@ZacKoch
@ZacKoch 4 жыл бұрын
Oof. This one went way over your head didn't it @Aruxandei Cosmin
@tayfun6378
@tayfun6378 4 жыл бұрын
so can we say it's for lazy people who cannot learn JS?
@shekishral6570
@shekishral6570 2 жыл бұрын
No, mainly meant to be used by javascript developers for performance reasons
@tayfun6378
@tayfun6378 2 жыл бұрын
@@shekishral6570 thanks man
@leonie9248
@leonie9248 3 жыл бұрын
Can you read down your text any more annoyingly?
Kevin Hoffman - Building a Containerless Future with WebAssembly
26:59
WebAssembly Summit
Рет қаралды 23 М.
Ridiculous NPM (Node.js) Packages that I wish didn't exist
6:16
Engineer Man
Рет қаралды 101 М.
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Rust Demystified 🪄 Simplifying The Toughest Parts
14:05
Code to the Moon
Рет қаралды 192 М.
Porffor: Compile Your JavaScript To WebAssembly
20:49
Theo - t3․gg
Рет қаралды 61 М.
Tonic makes gRPC in Rust stupidly simple
19:08
Dreams of Code
Рет қаралды 54 М.
WebAssembly (WASM) vs. Docker - Our Expert Analysis
19:53
KodeKloud
Рет қаралды 95 М.
Why WebAssembly is the future of Web development
7:33
ROULZ
Рет қаралды 184 М.
Engineer Breaks Down Hollywood Programming Scenes
11:02
Engineer Man
Рет қаралды 22 М.
Rust & Wasm
9:38
No Boilerplate
Рет қаралды 200 М.
8 deadly mistakes beginner Rust developers make
14:14
Let's Get Rusty
Рет қаралды 177 М.
An introduction to WebAssembly
25:23
Coding Tech
Рет қаралды 191 М.
Embedded Rust setup explained
23:03
The Rusty Bits
Рет қаралды 96 М.