3 ms·
Flutter originally used JavaScript, we ended up switching to Dart after studying dozens of languages. Our choice of Dart very much did not come from wanting to
by Hixie 9y ago
Flutter originally used JavaScript, we ended up switching to Dart after studying dozens of languages. Our choice of Dart very much did not come from wanting to support Dart, in fact, originally, I think the Dart team was a bit confused about what we were doing. :-) You can see this a bit in how, for example, we started with out own style guide and only over time have slowly converged it to match Dart's style guide (it still isn't 100% merged).
- krzat 9y agoGood job. Js is cancer. As a Swift developer I would never use it, but Dart actually looks nice. Have fast is Dart 2? I heard here that it enforces static typing, I assume for performance reasons.
- Hixie 9y ago> How fast is Dart 2? Not really sure how to answer that exactly. Fast enough? :-) Performance is one of our top priorities for Flutter (basically priority #2 after "correctness"). There's still plenty of opportunity to optimize, though. Honestly, so far we haven't found that Dart's intrinsic performance is an issue for Flutter. When we've investigated performance issues in the past, it's usually turned out to be around graphics or bad algorithms in the framework. Our most recent performance issue was related to compiling shaders on the fly; turns out if your shaders are super-optimised to render scenes really quickly, they can end up being so expensive to compile in the first place that you miss a frame or two when you first try to show the scene. > I heard here that it enforces static typing Sort of. It's more that the compiler does type inference if you don't specify types (as opposed to just not having any static types). You can still explicitly specify "dynamic" as a type, and generally if you just don't mention types it feels dynamic, still. (The Flutter framework itself always specifies types explicitly, because that helps catch bugs earlier.) > I assume for performance reasons. As I understand it, it's partly for correctness reasons -- it makes it much easier to catch bugs -- and partly for performance reasons.
- realharo 9y ago>after studying dozens of languages Out of curiosity, have you evaluated Swift as an option? If so, what were the reasons against it?
- Hixie 9y agoYeah, Swift was on our list of languages we considered. At the time, Swift wasn't open source and it wasn't clear what Apple's plans for the language were, so we didn't do a deep dive on its technology. It's possible that if we were to start over today that we would consider Swift more seriously.