4 ms·
So this is the problem with any cross-platform GUI toolkit: you have to make one of two choices: 1. Implement the lowest common denominator between all your su
by cletus 9y ago
So this is the problem with any cross-platform GUI toolkit: you have to make one of two choices:
1. Implement the lowest common denominator between all your supported platforms so you miss out on key features on each platform; or
2. Bypass native widgets so you end up with your own versions of everything where nothing quite behaves the same as native widgets do (ie Java Swing) and/or you incur a huge performance cost (ie Electron).
This is a touch hyperbolic but only a touch.
But consider this: Android uses garbage collection. iOS uses ref-counting. On a mobile platform, IMHO ref-counting is clearly superior and is a competitive avantage for iOS. GC leads to unpredictable behaviour, unpredictable resource usage and the inevitable stop-the-world GC pauses (at least I haven't seen a GC system yet that doesn't suffer from STW GC pauses to some degree).
On a server, this is less clearcut. The locking for ref counting itself can become hot but this just isn't really the case on an app on a phone.
It boggles my mind that years later (ARC came in in iOS 5), iOS still has this competitive advantage and not only does Android still not have it, nor does the Android-wannabe Fuchsia.
But back to Flutter, it uses Dart. I honestly don't see the point of Dart. Maybe it's just me but I don't want optional typing, or rather optional type hinting. I want static typing. The romance with dynamic typing over the last decade I think is on a downward trajectory with the rise of the likes of Go (really a better Python) and Rust.
- Harimwakairi 9y ago> But back to Flutter, it uses Dart. I honestly don't see the point of Dart. Hackernoon's got a recent article covering this exact topic: https://hackernoon.com/why-flutter-uses-dart-dd635a054ebf https://hackernoon.com/why-flutter-uses-dart-dd635a054ebf
- bombita 9y ago> But back to Flutter, it uses Dart. I honestly don't see the point of Dart. Maybe it's just me but I don't want optional typing, or rather optional type hinting. I want static typing. The romance with dynamic typing over the last decade I think is on a downward trajectory with the rise of the likes of Go (really a better Python) and Rust. FYI Dart2 is no longer optionally typed.
- Hixie 9y agoDart2 is optionally typed in that you don't have to enter the types. It's different from original Dart in that previously, if you didn't enter the type Dart would assume you meant "dynamic", whereas Dart2 will infer the type based on what you are actually doing. The net result is that the compiler/analyzer will catch more bugs but the code looks more or less the same.
- cbracken 9y ago> Maybe it's just me but I don't want optional typing, or rather optional type hinting. I want static typing. A ton of the community (and in particular teams using Dart at Google) felt the same way and the Dart team has been adapting the language to reflect that. Flutter uses Dart 2, which is statically and strongly typed. > Garbage collection GC is a nice value-add to the developer — most of us don’t really want to spend a ton of time thinking about reference cycles etc. but as you note, it has the downside of being a potential source of jank. We mitigate this in Flutter by timing the work we do building frames and scheduling small GCs during idle time. Code here: https://github.com/flutter/engine/blob/8109be8e21604df249b87702b86e4b266ce44225/shell/common/animator.cc#L100 https://github.com/flutter/engine/blob/8109be8e21604df249b87...
- solarkraft 9y agoInteresting approach. I'd read some articles about the inner workings.
- markdog12 9y agoThat 100ms hard-coded value is interesting. What about 120fps devices?
- markdog12 9y agoAh, ic, this is only allowed during idle time and nothing is getting painted.
- sjindel 9y ago"iOS has reference counting"
- sjindel 9y ago> Android uses garbage collection. iOS uses ref-counting. I hope you meant to say "Dart uses GC, Swift uses ref-counting". > On a mobile platform, IMHO ref-counting is clearly superior and is a competitive avantage for iOS. Reference counting can also cause pauses since decrementing a single reference can cause a arbitrarily large set of objects to be simultaneously deallocated. Dart's GC performs memory compaction and allocations are performed by bumping a pointer in the new space. Swift's allocations are much slower since they comb a free-list and it has no facility for compaction.
- imtringued 9y ago> (at least I haven't seen a GC system yet that doesn't suffer from STW GC pauses to some degree). Well I can already think of three languages that have solved this problem: Erlang, Elixir, ponylang. Every actor has it's own isolated heap with it's own GC. If the actor doesn't allocate then it will never have to stop for garbage collection and even if it does, the pause times are extremely low because the heaps are tiny. It's surprising to me that modern languages like dart aren't even attempting to pick up this low hanging fruit. Modern languages are all converging to the same good feature set but don't have anything to differentiate from each other. Kotlin, Groovy, Ceylon, Typescript, Dart? All basically look the same to me, there is no real reason to choose one over the other.
- vorg 9y ago> Modern languages are all converging to the same good feature set but don't have anything to differentiate from each other You said "good feature set" rather than "feature set". I'd agree those languages are converging to the same feature set, but the features they're each really good at does differentiate them. Typescript is good for Javascript generation. Kotlin and Eclipse Ceylon are good at generating statically typed JVM bytecodes. Apache Groovy's good for those 20-liners in Gradle for specifying builds on the JVM and Android. Kotlin's good for Android code.