Neon (@RustNeon) header
Neon (@RustNeon) profile picture

Write fast, safe native Node plugins with Rust!

Joined December 2015
Photo by Neon (@RustNeon)Photo by Neon (@RustNeon)Photo by Neon (@RustNeon)Photo by Neon (@RustNeon)Photo by Neon (@RustNeon)Photo by Neon (@RustNeon)
What's the simplest way to publish a Rust crate as an NPM package in 2023? I'm trying to convert OpenAI's tiktoken BPE tokenizer to JS. Considering @rustneon or napi-rs by @Brooooook_lyn, but I'm not too familiar w/ Rust and keep getting stuck.
4
3
2,786
Feel free to join the Neon community Slack! The #general channel is a great place to ask for help.
2
150
Replying to @RustNeon
@RustNeon Hi is there anyone who can send me a tut or example how to iterate arrays I passed from nodejs? I just want to print the strings in the array and nothing works.
1
1
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
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
2
5
For the latest side project that I'm unlikely to complete, I've decided to try write a parser for #PostgreSQL's specific flavor of SQL Database-driven development has been a powerful tool for us @logixboard. It lets us iterate crazy fast and lean on the power of Postgres. But...
1
6
[2022-04-16] Neon Saves the Day: After more poking around with binding Rust to Node, I found @RustNeon. Kudos to the builders there because it made everything trivial. I've now got a proof of concept for my parser exposed in Node.js 🙌
2
1
So glad it’s working for you—let us know if you have any trouble, we’d be happy to help!
this is a maintainer's love language
3
5
36
@dtromesh the slack space you linked to rustbridge.slack.com says it requires an invitation.
1
You can use this link to get an automatic invitation: rust-bindings-slackin.heroku… — all are welcome!
1
I completed my native module in #Rustlang for Nodejs using @RustNeon, and I am super happy about that. https://teapaw.org/t.co/GswSn7TRXs It is super slow, but I think it is my fault for trying to miss used Neon or @tokio_rs. If anyone has suggestions, please let me know.
1
I think we need an example!!! not for me but for the community
1
2
Working on it as we speak :)
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
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
Hey, @RustNeon, all your examples are based on neon = "0.3.3" while you are at version = "0.9.1," and many examples are not working. Could you please review them? Would be very grateful for someone trying to learn your framework without a lot of documentation.
1
1
Keep them around are very useful to understand how to do things that are not documented at all with the new version
1
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 @RustNeon
Actually, I was in the legacy examples for some reason. github.com/neon-bindings/exa… github.com/neon-bindings/exa… the legacy is more useful
1
Thanks for calling this out! We will make sure to put some more time into updating the examples.
1
1
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
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
1
5