Calling Rust code from Node.JS - Why and How | Rust Lang | JavaScript

  Рет қаралды 9,150

Chris Hay

Chris Hay

Күн бұрын

Пікірлер: 34
@jam_sessions6814
@jam_sessions6814 Жыл бұрын
This is super cool!! Lets go NodeJS * Rust here we go
@MiniKodjo
@MiniKodjo 2 жыл бұрын
cool, but the real thing wouldnt to build rust to webassembly and import wasm module in nodejs?
@Ab-cj6gl
@Ab-cj6gl 3 жыл бұрын
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
@chrishayuk
@chrishayuk 3 жыл бұрын
awesome.. glad you're enjoying. as i said, i believe in a hybrid world, so knowing both will help you
@Saeid-Za
@Saeid-Za Жыл бұрын
Could you please do a video on performance benchmark of calling same functionality from WASM, NAPI & Node addons?
@sortof3337
@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.
@matthewturner6644
@matthewturner6644 2 жыл бұрын
Great video. Any references on how to do this natively as opposed to with ffi?
@chrishayuk
@chrishayuk 2 жыл бұрын
Good shout!!! Let me take a crack at that
@dragonmax2000
@dragonmax2000 2 жыл бұрын
Very nice tutorial. Did not think I can do that. :)
@chrishayuk
@chrishayuk 2 жыл бұрын
glad it was useful
@MrArkus90
@MrArkus90 2 жыл бұрын
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
@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
@chrishayuk Жыл бұрын
Yeah, rust is your best bet for the stuff you’re trying to do
@fluffyunicorn7155
@fluffyunicorn7155 2 жыл бұрын
FFI = Foreign Function Interface
@chrishayuk
@chrishayuk 2 жыл бұрын
Yeah I’m not sure why I kept messing that up
@белка-у8б
@белка-у8б 2 жыл бұрын
So useful, thnks very much!)
@chrishayuk
@chrishayuk 2 жыл бұрын
Glad it was helpful!
@PouyaAtaei
@PouyaAtaei 2 жыл бұрын
Great video, thanks.
@chrishayuk
@chrishayuk 2 жыл бұрын
Glad you liked it!
@flat-line
@flat-line 3 жыл бұрын
Hi cris, quality content, thanks. do you aware deno is written in rust , and you can extend it with native rust code also !
@chrishayuk
@chrishayuk 3 жыл бұрын
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-line
@flat-line 3 жыл бұрын
@@chrishayuk looking forward to that video, cheers :)
@57Javier747
@57Javier747 2 жыл бұрын
Thanks sir! Very helpful!
@chrishayuk
@chrishayuk 2 жыл бұрын
welcome.. glad it was useful
@ChumX100
@ChumX100 3 жыл бұрын
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.
@chrishayuk
@chrishayuk 3 жыл бұрын
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.
@ChumX100
@ChumX100 3 жыл бұрын
@@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....
@chrishayuk
@chrishayuk 3 жыл бұрын
@@ChumX100 yeah it's pretty exciting. edge running wasm is gonna be big as is e-commerce etc
@11WicToR11
@11WicToR11 2 жыл бұрын
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?
@rocketsloth3050
@rocketsloth3050 3 жыл бұрын
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?
@chrishayuk
@chrishayuk 3 жыл бұрын
glad you're enjoying and the vids are helpful. feel free to dm me on twitter
@DavidAlsh
@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
@chonkey
@chonkey 8 ай бұрын
disliked
@chrishayuk
@chrishayuk 7 ай бұрын
appreciate the feedback
Getting Started with WebAssembly (WASM) with Rust Lang
33:10
Chris Hay
Рет қаралды 11 М.
5 traits your Rust types must implement
10:39
Let's Get Rusty
Рет қаралды 63 М.
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
Вопрос Ребром - Джиган
43:52
Gazgolder
Рет қаралды 3,8 МЛН
УЛИЧНЫЕ МУЗЫКАНТЫ В СОЧИ 🤘🏻
0:33
РОК ЗАВОД
Рет қаралды 7 МЛН
Hilarious FAKE TONGUE Prank by WEDNESDAY😏🖤
0:39
La La Life Shorts
Рет қаралды 44 МЛН
Is JSON Blazingly Fast or...?
9:57
ThePrimeagen
Рет қаралды 197 М.
Is TypeScript (NodeJS) Faster than Go?? |  A server comparison
9:54
ThePrimeagen
Рет қаралды 227 М.
Andrew Kelley   Practical Data Oriented Design (DoD)
46:40
ChimiChanga
Рет қаралды 153 М.
rust runs on EVERYTHING (no operating system, just Rust)
18:10
Low Level
Рет қаралды 365 М.
Rust for the impatient
10:43
No Boilerplate
Рет қаралды 763 М.
Node.js: The Documentary | An origin story
1:02:49
Honeypot
Рет қаралды 686 М.
How to make TypeScript Blazingly Fast (JavaScript/NodeJS)
12:49
ThePrimeagen
Рет қаралды 113 М.
Rust is the Perfect language For You
13:13
CoderOne
Рет қаралды 64 М.
Why JavaScript Devs are Switching to Rust in 2024
10:35
warpdotdev
Рет қаралды 264 М.
Rust's Most Important Containers 📦 10 Useful Patterns
17:11
Code to the Moon
Рет қаралды 132 М.
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН