Hacker News new | ask | show | jobs
by darpa_escapee 2874 days ago
If you have a well-thought out argument, and not a quippy one-liner, I'd earnestly like to hear it.

Dart's developers think otherwise[1]:

> Q. Is Dart a statically typed language?

> Yes, Dart 2 is statically typed. For more information, see Dart’s Type System.

> With its combination of static and runtime checks, Dart has a sound type system, which guarantees that an expression of one type cannot produce a value of another type. No surprises!

> Even with type-safe Dart, you can annotate any variable with dynamic if you need the flexibility of a dynamic language. The dynamic type itself is static, but can contain any type at runtime. Of course, that removes many of the benefits of a type-safe language for that variable.

[1] https://www.dartlang.org/faq#q-is-dart-a-statically-typed-la...

1 comments

> With its combination of static and runtime checks

Do you personally use it? That "strong mode" is a theory-only thing, it doesn't work with any real code, only with code you wrote without real third-party libraries.

You are, at best, confusing Dart 2 with Dart 1; strong mode was one of several Dart 1 modes, but, yes, it's possible to run into problems because dependencies weren't designed for it.

There is no option in Dart 2; everything is the equivalent of strong mode, which eliminates ecosystem problems.

I mentioned I've only tried Dart 1.x. Glad to hear it's changed in Dart 2.
> only with code you wrote without real third-party libraries.

Your claim was true several years ago, but since then the entire ecosystem has migrated onto the new strict type system. It was a monumental amount of work, but, thanks to lots of effort from our users, we're there.

Aside from a small number of more-or-less dead packages, you should be able to use any third-party Dart packages you want while still using the new type system.