This is super cool!! Lets go NodeJS * Rust here we go
@MiniKodjo2 жыл бұрын
cool, but the real thing wouldnt to build rust to webassembly and import wasm module in nodejs?
@Ab-cj6gl3 жыл бұрын
awesome video, i've been learning how to code for 8 months now (just JS). i'm new to this world but i'm fascinated with Rust. i'll def learn it after i get a dev job i also loved the style of the video
@chrishayuk3 жыл бұрын
awesome.. glad you're enjoying. as i said, i believe in a hybrid world, so knowing both will help you
@Saeid-Za Жыл бұрын
Could you please do a video on performance benchmark of calling same functionality from WASM, NAPI & Node addons?
@sortof3337 Жыл бұрын
It did not work for me. :( I am literally doing the same thing but getting symbol not found when napi tries to load funcs. I am on linux.
@matthewturner66442 жыл бұрын
Great video. Any references on how to do this natively as opposed to with ffi?
@chrishayuk2 жыл бұрын
Good shout!!! Let me take a crack at that
@dragonmax20002 жыл бұрын
Very nice tutorial. Did not think I can do that. :)
@chrishayuk2 жыл бұрын
glad it was useful
@MrArkus902 жыл бұрын
Thanks for the video, it gives some starting point. But I wonder, how do I share a custom struct (and it's methods) to Node? I would like to have my common code be usable both on Node and Rust, so I don't want to "rewrite" code just to work with Node
@martynclarke8400 Жыл бұрын
So I was considering learning c++ for node addons, mainly for the more cpu intensive processes. But I heard about rust and have started doing some digging. Im struggling to find reasons why I would choose anything but rust at this stage. Thanks a lot for this video
@chrishayuk Жыл бұрын
Yeah, rust is your best bet for the stuff you’re trying to do
@fluffyunicorn71552 жыл бұрын
FFI = Foreign Function Interface
@chrishayuk2 жыл бұрын
Yeah I’m not sure why I kept messing that up
@белка-у8б2 жыл бұрын
So useful, thnks very much!)
@chrishayuk2 жыл бұрын
Glad it was helpful!
@PouyaAtaei2 жыл бұрын
Great video, thanks.
@chrishayuk2 жыл бұрын
Glad you liked it!
@flat-line3 жыл бұрын
Hi cris, quality content, thanks. do you aware deno is written in rust , and you can extend it with native rust code also !
@chrishayuk3 жыл бұрын
yep. i plan to do a video on this soon, and do a comparison to this one :D. great comment and glad you're enjoying
@flat-line3 жыл бұрын
@@chrishayuk looking forward to that video, cheers :)
@57Javier7472 жыл бұрын
Thanks sir! Very helpful!
@chrishayuk2 жыл бұрын
welcome.. glad it was useful
@ChumX1003 жыл бұрын
I can see the benefits of targetting WebAssembly for use in the browser, where only JS is available. But in a server environment, where you can run native code, wouldn't it be simpler and more maintainable to just use Rust if you need the performance it offers? It would be nice to explore the scenarios where Node provides advantages over Rust, in order to justify the "hybrid server" vision.
@chrishayuk3 жыл бұрын
great comment.. i discuss some of this in this vid here.. kzbin.info/www/bejne/oqikgpx7bMeIY5o quick version is.. sandboxing and hosting code on others behalf such as sandboxes.
@ChumX1003 жыл бұрын
@@chrishayuk I see now. Indeed, very important use cases. I'm a very optimistic about edge computing as a cloud alternative, but hadn't yet thought about eCommerce companies and banks allowing users to run sandboxed code in their platform. That really opens up so many possibilities....
@chrishayuk3 жыл бұрын
@@ChumX100 yeah it's pretty exciting. edge running wasm is gonna be big as is e-commerce etc
@11WicToR112 жыл бұрын
your point makes sense, but imagine how many projects are written for node at this point. There for sure are some new features that wouldnt have good enough performance, but simply getting this interface where result can be returned is all you need. The thing i dont understand is how is this better from running external command (in rust) and collecting its output from stdout? I mean that one requires parsing but this video also requires to specify return types and all, theres a little difference, right?
@rocketsloth30503 жыл бұрын
Really enjoyed this video. You explain things in such a good way. I have some questions about some coding issues (cause I’m only about 5 months into coding) that I would like to get your input on. Where would be the best way to get ahold of you?
@chrishayuk3 жыл бұрын
glad you're enjoying and the vids are helpful. feel free to dm me on twitter
@DavidAlsh Жыл бұрын
Can't seem to find your video on using wasm with Node.js - any chance you could share that? EDIT: nevermind - kzbin.info/www/bejne/d53Wepukp7aCb6M