4 ms·
I've been down the path of picking the defeated tech myself, I would give this simple tip: If the project is likely to hit production and be supported for the
by hirako2000 3y ago
I've been down the path of picking the defeated tech myself, I would give this simple tip:
If the project is likely to hit production and be supported for the many years to come, architect the code base to separate concerns. Most logic isn't part of the bindings to any framework.
That way potential migration isn't off the table. And it gives a certain peace of mind.
This small pet project isn't a demonstration of that, but building a web application that serves data can quite simply abstract things like routing and parsing, keeping all the core business logic independent.
Just don't have any Actix, bevy, dioxus imports except where they belong.
Add abstraction layers where needed, it's sometimes inevitable given how frameworks can spread their tantacles.
Wasm isn't going anyway, so on that front given first class wasm support by Rust itself, no worry to have.
- berkes 3y ago"hexagonal architecture" (aka ports and adapters) offers some nice practical ideas on how to achieve this. I find it works well with rust. Rust traits are well suited for a ports and adapters setup. And in the rust ecosystem, "frameworks" are most often designed to get out of the way. To be pulled into a project as library, rather than to enforce itself all throughout the codebase (like Rails, Django, Laravel etc tend to do)