Since both node and Rust use libuv for parallelism. Is it possible to provide the node libuv pool to rust so that they share a single bound on parallel operations? Also, can I use Neon for async callbacks?
Neon: Node plus Rust
51–60 of 71 posts
Re: Neon: Node plus Rust
#52Honest question: Why would someone use Node instead of a Rust web framework when writing part of the code in Rust anyway?
- Node has full garbage collection. Rust has some very clever memory-handling, but it's not quite the same. - Node is javascript. You may want to run the same code on client and server, and it's simpler than compiling Rust to JS. - There may be JS libraries you want to use. I could go on.
What would be the reason to do that?
Re: Neon: Node plus Rust
#53Earlier quoted context omitted.
- Node has full garbage collection. Rust has some very clever memory-handling, but it's not quite the same. - Node is javascript. You may want to run the same code on client and server, and it's simpler than compiling Rust to JS. - There may be JS libraries you want to use. I could go on.
> Node is javascript. You may want to run the same code on client and server, and it's simpler than compiling Rust to JS. What would be the reason to do that?
- DOM manipulation for AJAX states so they can be reached directly from the server without needing client side JS to do anything
- Calculate discounts for products (obviously clients just POST the product they want, but the discounts should be applied on the server consistently to how they were shown to the user)
- Your code is something generic, like recursively checking for a keypath on an object, and totally useful for JS anywhere it runs.
All kinds of other reasons.
Re: Neon: Node plus Rust
#54 require('neon-bridge').load()
So this loads... which rs file, exactly? Where do I specify the Rust file to be loaded? Or is there just a single entry point and you're supposed to have one singular Rust module that is named by convention?Re: Neon: Node plus Rust
#55Re: Neon: Node plus Rust
#56There's an API thing from the JS side I don't understand, and I didn't find anything documentation-wise (maybe it's just because I haven't had my coffee yet): require('neon-bridge').load() So this loads... which rs file, exactly? Where do I specify the Rust file to be loaded? Or is there just a single entry point and you're supposed to have one singular Rust module that is named by convention?
Re: Neon: Node plus Rust
#57There's an API thing from the JS side I don't understand, and I didn't find anything documentation-wise (maybe it's just because I haven't had my coffee yet): require('neon-bridge').load() So this loads... which rs file, exactly? Where do I specify the Rust file to be loaded? Or is there just a single entry point and you're supposed to have one singular Rust module that is named by convention?
Looks like `neon-bridge`, in this case, is an NPM module.
Re: Neon: Node plus Rust
#58Earlier quoted context omitted.
- Node has full garbage collection. Rust has some very clever memory-handling, but it's not quite the same. - Node is javascript. You may want to run the same code on client and server, and it's simpler than compiling Rust to JS. - There may be JS libraries you want to use. I could go on.
> Node is javascript. You may want to run the same code on client and server, and it's simpler than compiling Rust to JS. What would be the reason to do that?
It also enabled me to move functionality freely around.
Calculating report data on the front-end, so it gets ready tomorrow and later moving it into the back-end, for performance reasons.
Re: Neon: Node plus Rust
#59Earlier quoted context omitted.
Looks like `neon-bridge`, in this case, is an NPM module.
Yes, it is, but the point is its load() function apparently takes no parameters.
Re: Neon: Node plus Rust
#60Or even better line.split(' ').filter(|word| matches(word, search)).count()