Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I hope this isn't off topic. What is the draw of Dart? In other words, what does it claim to do special or emphasize over other langauges? Like if you were going to try to convince someone they should give Dart a try, what reasons would you give?


I would say that the best benefits are:

- Cross Compilation (even wasm and js) out of the box - Simple concurrency model, similar to NodeJS - Ability to use it on a popular cross platform framework (flutter) - Hot reload capibilities (has JIT and AOT mode) - Strong developer tool chain

All of these are built on top of a language that has a pretty syntax and supports many language paradigms.

The biggest con is the (weak) package ecosystem and community.


I think it's also important generally speaking - not just Dart/Flutter, but really any language ecosystem, to not blindly start adding packages. You'll end up with conflicts and Dart is no exception. Sometimes it is sensible to vendor a library into your own source code tree, or just build it yourself ("Own it").


When making bullet points, I think you have to add a empty line in-between each point so it gets rendered as a list


The language is a little nicer than Typescript (though not in all ways), the performance is better and the tooling is excellent. Even better than Go's. And it can be AoT compiled to a self-contained binary or transpiled to Javascript.

The LSP server in particular is amazingly fast and reliable - better than Java IDEs. It's practically instant from typing something to seeing the squiggles update. C++, Rust, Go, Typescript etc. don't come close.

Obviously there are downsides: relatively tiny ecosystem, sometimes weird syntax (why is a match expression and match statement different??), this very annoying issue that I see remains unsolved after 5 years: https://github.com/dart-lang/language/issues/1188


Having developed Flutter apps for a few years now (albeit not full time), I have to say that Dart is simply a pleasure to work in. The language - at least - doesn't hold you back at all. I guess it's kinda like Java should have been.


Off the top of my head:

- Properly cross platform (including first-class JS/WASM interop)

- AOT & cross compilation

- Hot reload

- Static typing with many nice features (generics, extension types, enhanced enums, etc)

- Expressive without being overly verbose

- Well-supported by the language & SDK teams (i.e. it's not dead)

- Easy build/package system

The only things I really feel are missing are (1) union types and (2) access modifiers like protected/friend.


When coming from TS to Dart, the lack of union types was a huge bummer. But I saw a discussion somewhere that you can achieve something close with sealed classes to model union types combined with exhaustive pattern matching, but Idk.

Another user hinted at this package https://pub.dev/packages/extension_type_unions, have you seen it before?

Also it's worth noting that sum types can be achieved with Dart 3!


I'm a heavy user of exhaustive pattern matching with sealed classes, definitely a great feature. You can achieve the same outcome as union types, but it's a lot more leg work, e.g.:

```

sealed class MyParam {}

class Bar extends MyParam { String val; }

class Baz extends MyParam { int val; }

void foo(MyParam param) {

  switch(myParam) { 

      case Baz(val: final val):

      case Bar(val: final val):

  }
} ```

compared to:

```

void foo(Bar | Baz myVar) {

    switch(myVar) { 

        case Bar:

        case Baz:

    }
} ```

I hadn't seen the extension_type_unions package, though, I'll check it out.


Modern, but sane syntax (readable), good defaults (strong typing, null safety...), good-enough runtime performance, good APIs and tooling out of the box, cross-platform (also hot-reload on some, AOT). The list goes on, what specifics do you care about more?


Dart/Flutter imo is basically a better React Native.

It doesn't have 30 years of JavaScript legacy code.

The problem is Google cut significant funding to Flutter, it's not clear if it'll be supported for much longer.

I've built several toy apps in flutter for myself and friends. I like Flutter. But Google's lack of commitment is concerning.

Dart itself feels like a safer Typescript. The tooling is just better.


> The problem is Google cut significant funding to Flutter

Just to be clear, Google slashed teams across their entire organization, not just the Flutter / Dart team. So it wasn't like Google targeted the Flutter / Dart project

> it's not clear if it'll be supported for much longer

> Google's lack of commitment is concerning

I had similar feelings. When looking this up, it showed that Google continues to actively develop and invest in Flutter, with regular updates, new features, and performance improvements being released for both Flutter and the Dart language.

The official Flutter roadmap has been updated through 2025

https://www.reddit.com/r/FlutterDev/comments/1jrz4cd/googles...


I understand that, I still don't know if I trust Google here.

To be fair, I can get things done much faster in flutter than in other frameworks.

I did build a small Kotlin project though, I might switch to Kotlin Multiplatform if something happens with Flutter.


If Flutter didn't exist would Dart be worth looking into? ATM It sounds like Dart w/Flutter) is good for "making native apps" and that maybe doesn't excel outside that niche?


I mostly use it in a non Flutter context and yes, incredibly strong recommendation from me there too. It’s my new default language for the past few years for a reason.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: