3 ms·
Your problem isn't hard to solve in Rust. Reasoning about allocations is a foundational idea of Rust and is solved using lifetimes. Basically, lifetimes are al
by adamnemecek 8y ago
Your problem isn't hard to solve in Rust. Reasoning about allocations is a foundational idea of Rust and is solved using lifetimes.
Basically, lifetimes are allocators as a first-class language construct. You can reason about what happens if values are stack or heap allocated and specialize your code based on that. Lifetimes are definitely an advanced feature and I think you can do some crazy optimizations with them. But your use case is not hard to implement. If you show me the C++, I'll show you how to achieve the same semantics.
Cargo helps because Rust lets you build cleaner abstractions and abstractions that compose nicer. So integration is super easy.
> For typical web front-end projects NPM or Cargo probably make sense.
I might misunderstand your sentence, but neither Rust nor cargo are for front-end?
- steveklabnik 8y agonpm is used a lot for front end code, incidentally. Node is an environment for a lot of build tooling.