
Write fast, safe native Node plugins with Rust!
Joined December 2015
- Tweets105
- Following0
- Followers713
- Likes46
Replying to @transitive_bs @Brooooook_lyn
Feel free to join the Neon community Slack! The #general channel is a great place to ask for help.
2
150
Replying to @RustNeon @fluffelpuffcode
As for iterating arrays, the easiest way is to convert to a Rust Vec and then iterate over that: neon-bindings.com/docs/array…
15
Replying to @RustNeon @fluffelpuffcode
Then you’ll also need to supply an argument in the parentheses as well, which is a reference to a context. There’s usually a variable in scope called `cx` in idiomatic Neon code, which would get you what you want there.
1
14
Replying to @RustNeon @fluffelpuffcode
What that error message is telling you is that downcast takes two type parameters in the angle brackets < > and you’ve supplied just one (JsObject). Rust can generally infer the second one for you but you still have to put a placeholder there:
.downcast::<JsObject, _>()
1
15
Replying to @fluffelpuffcode
Hey there! We’d be happy to help. Have you joined our community slack by chance? It tends to be easier to troubleshoot and learn together there. Otherwise we’ll do our best to help you here.
1
10
Neon retweeted
In my latest post I'm writing about procedures to improve @nodejs Lambda performance with the usage of @rustlang and @RustNeon .
You can find the blog post in DEV: dev.to/aws-builders/electrif…
Hope you will enjoy it😉
#AWSCommunityBuilders @awsdevelopers
Replying to @jcgsville
So glad it’s working for you—let us know if you have any trouble, we’d be happy to help!
You can use this link to get an automatic invitation: rust-bindings-slackin.heroku… — all are welcome!
1
Some tips for performance, based on a quick review of the code:
- Creating a separate executor for every call is expensive, instead of sharing a single executor.
- Exposing I/O synchronously blocks the JS event loop. You might consider reframing your module as a promise API.
1
1
Replying to @dfrasca80 @tokio_rs
Congrats on your native module! Feel free to join the community Slack if you'd like help optimizing the code. We can also look into making an example of using Tokio with Neon.
1
Replying to @dfrasca80
Agreed! Fixing the footer is just a first step but we'll still prioritize redoing the legacy examples for the latest versions of Neon. We won't remove the legacy branch until it's truly obsoleted.
Replying to @dfrasca80
Thanks for calling this out! We will make sure to put some more time into updating the examples.
1
1
Replying to @DTRomesh @gitconnected
Nice article, thank you for sharing! BTW, the IRC channel is no longer active; these days we encourage anyone interested in community discussion to join our Slack channel. Thanks again for the great writeup!
1
Replying to @kdy1dev @Brooooook_lyn
For a compiler for the web ecosystem it could be useful to offer both prebuilt binary for ease of use + maximum performance, but also offer a Node API for programmatic use cases. Either @RustNeon or napi-rs should work for you & we’d be happy to help if you have questions!
A safer #cratechallenge: whoever fixes the most @rustlang safety bugs in their crate found by github.com/sslab-gatech/Rudr… wins



