top | item 42986748

(no title)

blopker | 1 year ago

Dart is crazy because it runs on every platform, compiles to native, has real parallelism via isolates, native async, and native type safety.

There's not really a backend that takes advantage of all that. In theory, one server binary could handle REST, web sockets, background workers, and have generated type safe client packages for every platform. Dart also has a great Rust ffi story. It would be great to see that leveraged.

ServerPod is a great start, but it's really Flutter focused. The web apis feel like second class.

Additionally, database management isn't a solved problem yet. ServerPod uses yaml to define models, and the other main option is just a Prisma wrapper. Dart needs something like Drizzle.

discuss

order

satvikpendem|1 year ago

You could state the same thing as your first sentence for e.g. Rust or many other languages, I personally only see Dart being useful if you already have a Flutter app and you don't want to learn another language, and to have shared types easily, similar to fullstack web devs using TypeScript for their React and Node apps.

I personally use Rust backends and Flutter frontends for my apps. I'd use pure Rust for the entire thing but Rust frontends are nowhere near the capabilities and maturity as Flutter, but I use FFI like flutter_rust_bridge and rinf at least, as you mention.

blopker|1 year ago

I actually can't think of another language that has all of that built in. Rust doesn't, it needs a run time for async. JavaScript doesn't, it needs typescript and it doesn't compile to native.

SpaghettiCthulu|1 year ago

On the topic of databases, I think https://drift.simonbinder.eu/ might interest you. I've been using it in a Flutter app with SQLite, but my understanding is that you could use it on the server too. I recall them having support for at least SQLite and Postgres.