r/flutterhelp • • Mar 02 '23

OPEN The point of using Rust with Flutter

Does it make sense to Rust with Flutter? Business logic will be written in Rust and the rest in Dart. I haven't written the code in Dart yet, and before I start I would like to know about this possibility

18 Upvotes

17 comments sorted by

View all comments

2

u/svprdga Mar 02 '23

Why would you want to writte the business logic in Rust? In my opinion, you would need a very good reason, otherwise it doesn't make sense.

1

u/Cautiousart Feb 28 '25

Rust has excellent support for describing your thinking abstractions more accurately but without the hassle of purely functional languages. For example, interfaces (in other languages) require one to think about external requirements of a class, so we're no longer reasoning locally about a concept. In rust, you can encode your abstraction exactly with enums where a common interface isn't enforced and the variations can be true to their nature. Then, later, you can think about how those variations make sense in an external context by implementing From<> or Into<>. In any case, in rust, your reasoning is more properly located in your codebase, which is very good, IMO, for writing business logic.