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

preview_player
Показать описание

00:00 Introduction
02:00 Coding Hello World
05:05 Adding 2 numbers
07:45 Creating a Library / Module in Rust Language
11:17 Packaging your app for dynamic languages such as Python, Javascript
14:28 Calling your library from Node.JS
19:20 Outro
Рекомендации по теме
Комментарии
Автор

This is super cool!! Lets go NodeJS * Rust here we go

jam_sessions
Автор

cool, but the real thing wouldnt to build rust to webassembly and import wasm module in nodejs?

MiniKodjo
Автор

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

Ab-cjgl
Автор

Very nice tutorial. Did not think I can do that. :)

dragonmax
Автор

Great video. Any references on how to do this natively as opposed to with ffi?

matthewturner
Автор

Could you please do a video on performance benchmark of calling same functionality from WASM, NAPI & Node addons?

Saeid-Za
Автор

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

MrArkus
Автор

Hi cris, quality content, thanks. do you aware deno is written in rust, and you can extend it with native rust code also !

flat-line
Автор

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 <3

martynclarke
Автор

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.

sortof
Автор

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?

rocketsloth
Автор

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.

ChumX
Автор

ffi-napi is not working any more, i've heard people moving from ffi-napi to koffi.
also rust doesn't generate ".dylib" but (".dll", ".exp"and".dll.lib") instead,
i know it's not that easy but can you make a new video for 2025?

ORIofficialchannel