Hacker News new | ask | show | jobs
by sethladd 3878 days ago
(disclaimer: I work on the Flutter team.)

It's true that Dart is an optionally-typed system, and that type annotations are ignored at runtime. That may seem scary at first, but we built an analyzer that statically analyzes your program and gives you feedback (errors, warnings, and hints).

Dart is used at Google to build very big and complex apps, and our engineers use the analyzer in their build/CI systems to check their program. The analyzer is also wired into their IDEs. So they get feedback if a method doesn't exist, or you are trying to pass a variable into a method that is expecting something else.

The Dart team is also working on an optional analyzer feature called "strong mode", which does even more static checking. In strong mode, you can't write code that is incorrectly typed (but, you can still write code that is dynamically typed, if you want to).

Our experience, at least internally, is that as your program matures and grows in complexity, developers appreciate the extra checks provided by strong mode. The win is that it's something you can turn on later, when you're ready. Early on in the program's development, you are probably refactoring a lot and you don't want to bother with strong mode. This scalability is a win for us.

4 comments

So for those of use outside of Google, it's not a "smooth" environment to work in. I wish we have the tools that you have. Are they available outside of Google?
Yes, strong mode and the Dart analyzer are all available in the Dart SDK. (Strong mode is in development, but it's still quite useful.)
Yes, but do we also get the custom IDE and whatnot? I'd really like to play with Dart, but I hope it isn't a dead-end for non-Google projects.
Yes we get all of the whatnots ;)

The developers on this project are using Atom https://github.com/atom/atom/ for their day to day Dart development. They are contributing to the Dart plugin https://github.com/dart-atom/dartlang, and implementing a Flutter specific plugin https://github.com/flutter/atom-flutter-dev. The Dart SDK https://github.com/dart-lang/sdk provides the basic source code analysis tools. All of these projects are open source, on github, and see regular commits.

Dart + "Unfortunately, due to iOS restrictions, updating your Flutter app over the network is not possible" means 100% no thanks from me.

I don't want another language in my build ecosystem. Between javascript (necessary for web), objective-C, Java, C++ for shared stuff, adding another one that provides no genuinely useful semantics or performance implications is a sheer non-starter.

> Dart + "Unfortunately, due to iOS restrictions, updating your Flutter app over the network is not possible" means 100% no thanks from me.

Indeed. One of _the_ biggest selling points of React Native is the promise of near-instant over-the-air updates for iOS and Android.

How do you do things like text input without native widget integration?

Are you familiar with Codename One (https://www.codenameone.com/ )?

It seems to me that what we implemented there is roughly in the same direction although not as mature.

Oh great news on the strong mode. One of my biggest issues with Dart is it not being actually statically typed.

Could you potentially generate smaller js libraries if the language was statically typed?

A lot of the push for strong mode comes from a project to create a "plain JavaScript" compiler for Dart: https://github.com/dart-lang/dev_compiler