~/talk

Node.js N-API for Rust

TalkinRussianat JS Fest 2019 Autumn · 2019-11-08..11-09· [nodejs, rust]
links:none on file
slides:none on file

Describes using Node.js N-API (the stable C ABI) to write native addons in Rust without tying them to V8, with bindgen and procedural macros generating safe Rust wrappers for raw N-API calls. Shows sharing memory between JS and Rust via ArrayBuffer/TypedArray, using rayon parallel iterators in Rust to compute sum-of-squares, reports a 17× speedup compared to JS, and gives examples that compile with node-gyp or in a Docker development container and run end-to-end.

AI-written summary · about

  1. 0:00Introduction
  2. 1:03Native addon issues
  3. 3:17N-API benefits
  4. 5:43N-API bridge for Rust
  5. 8:10N-API low-level improvements
  6. 10:40Building addons with node-gyp
  7. 12:31Basic N-API addon demo
  8. 17:12Error handling in N-API
  9. 22:38Rust headers with napi-rs
  10. 26:00Wrapping Rust code
  11. 27:44Type-safe N-API abstractions
  12. 33:21Macros for simpler code
  13. 39:02Module entry point
  14. 41:22Build and test Rust addon
  15. 43:18Argument validation
  16. 45:55Multithreaded demo
  17. 46:39Rust for compute tasks
  18. 51:27Rust vs JavaScript performance
  19. 53:15Parallel computing with Rust
  20. 54:11Conclusion & Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.