News for hackers. Stuff that matters.
Re:Flutter and Dart, or how to quickly build a mobile app wi... by hota_mazi on Sunday March 01, 2020 @01:08AM (#22455408)
Dart

- Is dynamically typed at the core

- Has no support for nullability

- Has old school syntax for constructors, semi colons

In other words, Dart on the wrong side of history for pretty much every single important feature for programming languages in 2020.

Even C# looks more modern than Dart from a design perspective, and C# is fifteen years old.

Re:Flutter and Dart, or how to quickly build a mobile app wi... by brabel on Sunday March 01, 2020 @03:56AM (#22455903)
- Dart 2 has a sound type system and the compiler has been receiving lots of optimisations based on types since then (several years now). So this is no longer true.

- that's currently true but in the next release (at least that's what the Dart team have been working on for the past several months) it will have nullable types just like Kotlin.

- That's a strange criticism. Dart has excellent constructor syntax, I don't know a language that is more flexible with constructors.

e.g.

    class Person {
        String name;
        int age;
        Person(this.name, this.age);
        String toString() => "Person($name, $age)";
    }

    main() => print(Person("Joe", 40));
Looks pretty good compared to most other languages?!
Re:Flutter and Dart, or how to quickly build a mobile app wi... by hopia on Sunday March 01, 2020 @09:51AM (#22457048)
Dart has some annoying traits that hurt productivity with it. For example, the lack of union types or some kind of sealed classes is fairly annoying when the language is actually statically typed.

There's some work being done to overcome this but so far no solution has seen the daylight in practice.

Re:Flutter and Dart, or how to quickly build a mobile app wi... by scalatronn on Friday March 06, 2020 @12:16PM (#22505325)
Relax, it's being speced now, give them time to make non-nullables first.
Re:Flutter and Dart, or how to quickly build a mobile app wi... by krzat on Sunday March 01, 2020 @05:31AM (#22456257)
The fun starts when you want to have final field that needs to be calculated in the constructor.
Re:Flutter and Dart, or how to quickly build a mobile app wi... by filleduchaos on Sunday March 01, 2020 @08:32AM (#22456772)
So do that in the initializer list?
Re:Flutter and Dart, or how to quickly build a mobile app wi... by joe_fishfish on Sunday March 01, 2020 @03:59AM (#22455912)
If they had figured out a way to make Flutter use Kotlin back in 2015 before Android officially adopted it, I think it would have gained much more developer adoption.

I don't think Kotlin is performant enough for Flutter though.

Re:Flutter and Dart, or how to quickly build a mobile app wi... by pjmlp on Sunday March 01, 2020 @05:43AM (#22456287)
The hard work is done by Skia, implemented in C++.

ART is able to do several nice optimizations, including vector instructions, and uses a mix of JIT/AOT with PGO.

Kotlin is performance enough, hence Jetpack Composer.

Re:Flutter and Dart, or how to quickly build a mobile app wi... by filleduchaos on Sunday March 01, 2020 @08:34AM (#22456774)
At the time (and to a large extent even now) Kotlin would have required shipping a JVM along (on non-Android platforms at least, and not a straightforward task at all on iOS).

That's _far_ from performant for the use case in question.

Re:Flutter and Dart, or how to quickly build a mobile app wi... by pjmlp on Sunday March 01, 2020 @08:44AM (#22456798)
As if Dart doesn't ship a runtime into all the platforms it runs on.

A quite big one actually.

That has nothing to do with performance, and plenty to do with storage space and download times, as anyone knowledgable how compilers work is well aware of.

Re:Flutter and Dart, or how to quickly build a mobile app wi... by scalatronn on Friday March 06, 2020 @12:17PM (#22505338)
> As if Dart doesn't ship a runtime into all the platforms it runs on. > A quite big one actually.

yeah, whole 4,5 mb....

Re:Flutter and Dart, or how to quickly build a mobile app wi... by filleduchaos on Sunday March 01, 2020 @01:43PM (#22458375)
Do you _really_ want to compare the size on disk and [default] memory requirements of, say, HotSpot to the Dart AOT runtime?
Re:Flutter and Dart, or how to quickly build a mobile app wi... by pjmlp on Sunday March 01, 2020 @02:05PM (#22458517)
Yes, specially because we aren't speaking about Hotspot here, rather ART, Kotlin/Native.
Re:Flutter and Dart, or how to quickly build a mobile app wi... by filleduchaos on Sunday March 01, 2020 @06:26PM (#22460146)
- rather ART

Is Android-specific, created specifically for Android, and it's almost as if the aim here was to develop a cross-platform framework that could at least target the two major mobile OSes in existence, one of which ships with literally zero Java anything. I brought up HotSpot because that's (part of) the canonical, actually-built-to-run-on-multiple-platforms JRE.

- Kotlin/Native

The state of Kotlin/Native is _far_ shabbier than the state of AOT-compiled Dart, and that's in 2020 (not, you know, 2014 when Flutter (then Sky) initially kicked off). It's interesting to me how in discussions like this people act as though the development of the project in question started literally yesterday.

Re:Flutter and Dart, or how to quickly build a mobile app wi... by pjmlp on Monday March 02, 2020 @12:51PM (#22466804)
If Fuchsia never gets out the door, Dart is guaranteed to be another CoffeeScript.

I guess the lack of mature libraries and integration issues with Android native APIs is one reason why we consider it a language started yesterday.

Re:Flutter and Dart, or how to quickly build a mobile app wi... by filleduchaos on Monday March 02, 2020 @01:54PM (#22467497)
When I refer to a project starting yesterday, in case it was too difficult to understand, I was implicitly asking you for non-posthoc justifications for choosing Kotlin _in 2014_ to build a UI framework that

- should target multiple mobile and desktop platforms (and not, like you seem to think, Android first or alone)

- is a game engine style, Skia-backed project, which you are essentially trying to pick a scripting language for.

So, do you actually have anything to back up Dart's runtime being a worse investment than your proposed ideas (which seem to be "go the way of Multi-OS Engine, that notoriously successful project" and/or "wait half a decade more for AOT compilation that would still be in beta and in a worse state than what we already have")?

Re:Flutter and Dart, or how to quickly build a mobile app wi... by filleduchaos on Monday March 02, 2020 @01:33PM (#22467266)
Okay, so what does that have to do with Kotlin being an even worse choice I
Re:Flutter and Dart, or how to quickly build a mobile app wi... by pjmlp on Sunday March 01, 2020 @02:35AM (#22455673)
And you weren't counting the matury of the eco-system.