
Announcing Dart 2 Stable and the Dart Web Platform - ScottWRobinson
https://medium.com/dartlang/dart-2-stable-and-the-dart-web-platform-3775d5f8eac7
======
wnsire
Reading the few comments here is really interesting.

Every-time there is a discussion about Dart , people talk about Flutter...
they very rarely talk about Dart on the Server or on the Web...

A while ago I considered using Dart to build a Web API. I was shocked by the
non-existent ecosystem around this language.

The Redis package has been un-maintained for almost three years now, and
Angular Dart is always a few version behind the TypeScript version and doesn't
support SSR.

I was also very surprised that Google during dart conf never commented on
using Dart on the server but instead always insisted on using it for their
clients (Web and Mobile). I think I'm not lying by saying that a huge part of
Google runs on JVM , Go or Python but definitely not on Dart VM.

For me Dart is the language that developer needed , but never wanted to use.
It failed miserably when it was introduced few years ago, since then
JavaScript took off and has become almost a universal language.

This is very frustrating seeing how much the language is efficient and well
structured but it the same times doesn't mean much now seeing how mature
JavaScript is becoming.

For me Dart took long to become what is it now , and today the only thing that
would make people using this language is really Flutter.

Beside that , I'm afraid they are very little reason to use this language.

[0][https://github.com/dartist/redis_client/tree/master](https://github.com/dartist/redis_client/tree/master)

~~~
sbjs
I think what killed Dart is that they emphasized their plans to make Dart a
first-class scripting language of Chrome, so that you could use <script
type="text/dart"> instead of JavaScript. This had a _lot_ of backlash from
literally everyone, I think mostly because they were bit too hard by IE doing
the exact same thing just a few years before. Only after a few years the Dart
team changed courses and said "never mind about that VM-inside-Chrome thing,
we're just going to compile to JS like everyone else" but it was too late and
nobody cared about Dart anymore and all the excitement and enthusiasm was
gone. I think people don't realize just how much excitement and enthusiasm
from a potential community makes or breaks a project when it's first
announced.

~~~
munificent
I'm on the Dart team and I agree with pretty much all of this.

Personal opinion time:

Lars and Kasper, the original leads and creators of the language came out very
confidently with this mission to get Dart natively supported in the browser
based on the assumption that the language was so good and the VM would be so
fast that users would clamor it.

They had the best of intentions — they really did want to make a delightful,
productive, fast language. They intended to move the entire web forward the
same way V8 had when it first launched, and they believed deeply that Dart
would enable that.

But I think they really underestimated how vastly different _designing and
marketing_ a language is from simply implementing an already-successful one.

It's not enough to just have a good product. The way you present it is often
more important. And you don't even have the luxury of defining "good product"
— you must be mercenary in letting your users' needs override your personal
preferences. All of that was a real struggle for them.

For what it's worth, there's been a lot of staff changes over the years since
Dart first launched. Lars and Kasper have left to try the startup thing again
(which I think is a better fit for their skills and desires than evolving a
big open source language). The team we have now, I believe, is much better
aligned with what you're saying.

It sucks that we do have this baggage, but I hope we can improve our
reputation over time. I'm hopeful we can — it took Java several tries before
it found its footing.

~~~
pier25
Off topic but... are there any plans to adapt Flutter for desktop apps?

~~~
MarkMc
I'm the lead dev on just such a project: [https://feather-
apps.com/](https://feather-apps.com/)

~~~
pier25
Looks great!

I beat the Reversi app on first try. I'm guessing it's not very strong. :)

~~~
MarkMc
Thanks :)

Haha yes I weakened the AI somewhat compared to the original version created
by RedBrogdon. It's not fun to be constantly thrashed by an opponent who takes
0.2 seconds per move! Despite my changes I still lose about 3 out of every 4
games :(

------
deforciant
I mostly spend my days writing Go (previously Python) and when I tried Dart I
really liked it. Could basically start coding and be productive without even
looking at language documentation (VSCode has a nice Dart plugin which tells
you what to do and what not to do).

In my case, I was trying out Dart because of a Flutter (probably majority of
people are now looking at Dart because of Flutter) and I found it really
fantastic. I love the tooling where you can just use their CLI to build/test
the application without complex IDEs like XCode or Android Studio.

If you want to try building a mobile app then definitely go for Flutter+Dart,
even if you don't need to support both Android and iOS I think it's just much
more easy to start with than alternatives (RN/Swift/Android Java).

~~~
styfle
How does your experience with Dart compare to TypeScript in VS Code? I haven’t
tried Dart yet but my TS experience sounds similar to what you described.

~~~
deforciant
I tried to like TypeScript a bit more than a year ago but couldn't, maybe I
should give it another chance. I mostly do my frontend development in Vue.js
so even though it supports TypeScript, I never found any need for it (I use
typed Props to pass data between the components) as I try to make my UI as
thin as possible, just fetching some data from the backend and displaying it.
You can have a look at my project-
[https://webhookrelay.com](https://webhookrelay.com) (management UI is under
my.webhookrelay.com), so far made it quite simple, material UI and only a
little bit of JS.

Obviously coming from Go to frontend I think I would benefit a lot from
TypeScript.. Maybe one day :)

------
frollpin
Congratulations to the Dart team on that important milestone! Dart is already
by far the most productive cross-platform web technology I've ever worked
with, and it's getting even better with each new release.

Absolutely love the language, tooling, and "batteries included" mindset.
Everything "just works", and is solid, lightweight, and thought-out. Compared
to many other languages/ecosystems I've worked with (not going to point
fingers), Dart feels like an island of sanity and productivity.

------
dangjc
Flutter seems like the killer app that could revive Dart. In comparison:

Javascript

For mobile with React: no AOT compile. Relies on loading the entire JS VM
which adds startup time and can require bundling a large library on Android.
Cannot easily author customized components that render at native speeds.

C#

For mobile with Xamarin: No hot reload. Dart having its origin as a JS
interpreted language had the foundations to be both dynamic and AOT. C# might
not ever achieve this?

Kotlin, Java, Swift, Objective C:

Not cross platform.

C++:

Is cross platform. No hot reload. Very unfriendly to modern development and
fast iteration.

I don't actively work in mobile. I just like following developments in
language technologies, so correct me if I'm wrong.

~~~
monocularvision
The main negative with Flutter on iOS is that your app ends up looking like an
awful Google app instead of something native.

~~~
equasar
There's a Cupertino theme.

------
jetti
> The other is an interesting quality-of-life change for Flutter developers,
> which allows creating an instance of a class without the “new” keyword. The
> goal of this change is to make Flutter code more readable, less clunky, and
> easier to type, but the principle applies to all Dart code. There have been
> plenty of other improvements happening under the hood, as can be seen in the
> official changelog.

To me it seems kind of odd to design the language towards a framework. Then
again, that framework is probably the only thing increasing the number of
people using Dart so it does make sense to make using the framework as clean
and easy as possible.

~~~
kyrra
Server-side Dart is still there, but not getting a lot of support from Google,
as it's not their primary focus. The renewed effort going into Dart because of
flutter has also allowed AngularDart[0] to gain some of the benefits (better
tooling and IDE integration). AngularDart 5 will actually be a huge quality-
of-life improvement as they are killing the Dartium browser fork, and instead
doing incremental-compiling to javascript with dartdevc.

[0] [https://webdev.dartlang.org/angular](https://webdev.dartlang.org/angular)

~~~
jetti
Right, I know there are still other uses of the language but it seems like the
language design is focused solely on Flutter experience rather than just
overall language experience. I don't recall ever seeing such a design decision
in any other languages and I just find it a bit odd.

------
gonyea
Dart is really interesting. It's a cool programming language, managed by some
incredibly smart people. It could have been what TypeScript is today, but
failed dramatically due to a lack of pragmatism and an outright loathing for
JavaScript.

What soured me towards Dart is its continued history of ignoring community
input. I remember when it was announced--the original "Hello World" transpiled
to JS was around 70kb. 8-years later, and after all the user feedback (and
shock in the original HN announcement), it's now around ~80kb.

Why do this? Why continue to play so poorly with JavaScript? Dart2js is an
indefensible Rube Goldberg machine that no human being can reasonably
understand or debug.

------
leshow
I'm really not a fan of Dart's type system. It feels ancient to me. From what
I can tell, there's no sum types, I don't see any way to bound generics based
on interface/typeclasses/traits or some other equivalent concept on the docs,
it has no non-nullable types. Am I wrong? Why would I want to use a type
system that lacks expressiveness?

~~~
munificent
_> From what I can tell, there's no sum types_

Paraphrasing Qc Na: Subclasses are a poor man's sum type. Also, sum types are
a poor man's subclasses.

:)

But, yes, some nicer notation for declaring a sealed family of types would be
nice along the lines of case classes in Scala. It's something we've talked
about a bunch but haven't had time to get to yet.

 _> I don't see any way to bound generics based on
interface/typeclasses/traits_

It uses the same syntax as Java:

    
    
        class Foo<T extends Bar> {
          T thing;
          method() { thing.methodOnBar(); }
        }
    

_> it has no non-nullable types._

Not yet. :( I hope we can get to them.

~~~
leshow
> Paraphrasing Qc Na: Subclasses are a poor man's sum type. Also, sum types
> are a poor man's subclasses.

One of the great things about disjointed unions is (usually) exhaustiveness
checking. Not to mention usually some form of pattern matching. Case classes
would do the trick. It would be interesting to see those features in Dart,
congrats on the release.

------
cookiecaper
This is exciting. Dart is vastly underrated due to some bad press garnered
around its announcement. I'm somewhat disappointed that they've reoriented to
focus aggressively on front-end and dropped their custom runtime, but I
understand this was mostly dictated by market realities. After they re-
establish a foothold, I look forward to the return of a fully-fledged Dart
environment and ecosystem.

~~~
mraleph
> dropped their custom runtime

Dart VM is very much alive, nobody dropped it - it's used by Flutter to run
Dart code, used by all Dart CLI tools (and Flutter CLI tools too) and on
server side underneath pub.dartlang.org (and used on server by some other
companies too).

------
fullofsid
Anybody using only dart for their mobile apps, how has been your experience
with it? Where does it triumph & fail over RN??

~~~
kasperpeulen
Pros:

* Flutter is faster. You really notice that for example the animations in flutter are much smoother than in RN

* Flutter has really fast development cycle with hot reload (< 1s)

* Writing UI only once for both iOS and Android

* Better documentation

* Better tooling support in editors (VSCode and Intellij)

Cons:

* The Flutter ecosystem is quite small, there are many lacking plugins

* The Dart ecosystem is way smaller than JS

* RN uses the native widgets, in Flutter they are mimicked and sometimes wrongly, for example the iOS datepicker

~~~
beckler
My only complaint so far is some things are not documented very well.

I started leveraging the json_serializable lib and all my responses were
returning null... it took me a few days of heavy debugging to figure out it
was how I crafted my constructors and how the code generators worked with it.

~~~
devxpy
Thankfully, the community is really welcoming. Not like RN where issue are
closed for no reason all the time..

------
AdmiralAsshat
I have no experience with Dart, other than having watched a livestream of
Notch recreating Doom with Dart:

[https://www.youtube.com/watch?v=6p-Z6TXoN10](https://www.youtube.com/watch?v=6p-Z6TXoN10)

------
parvenu74
Now that Dart 2 is final, I'm guessing we're a couple weeks out from Flutter
going 1.0 -- which will mean a ramping up of the Fuchsia rumors.

------
irq-1
> The Dart language, libraries, build system, and web development tools have
> changed.

[https://www.dartlang.org/dart-2](https://www.dartlang.org/dart-2)

> ...announcing Dart 2, a reboot of the language to embrace our vision of
> Dart: as a language uniquely optimized for client-side development for web
> and mobile.

[https://medium.com/dartlang/announcing-
dart-2-80ba01f43b6](https://medium.com/dartlang/announcing-dart-2-80ba01f43b6)

------
Maultasche
I think that I would find Dart a lot more compelling if it emitted WebAssembly
instead. There aren't a lot of languages that can compile to WebAssembly at
the moment.

~~~
mraleph
That's because compiling non-C++/Rust-like language to WASM is unpleasant and
associated with completely unneccessary overheads.

------
dfischer
Who’s using Dart for Web (angular dart?). I’m interested in hearing pro’s /
con’s especially if you have any experience with react as well.

Thanks!

~~~
bseidensticker
I work for Google on Search Ads 360 (formerly DoubleClick Search). All the
frontend code I write uses Angular Dart and I love it. The best thing about it
is the Intellij integration. I've never worked with an editor with semantic
auto complete and jump to definition, so it's unbelievably awesome. Static
analysis catches tons of errors, dev cycle is super short even for our giant
codebase.

I have some experience with React. My impression is that the React model is
easier to understand and use at first, but may run into issues as the project
grows. I have only ever worked on solo projects from scratch in React, and
only ever on multiple 100k loc projects in Angular Dart.

------
syspec
> The other is an interesting quality-of-life change for Flutter developers,
> which allows creating an instance of a class without the “new” keyword. The
> goal of this change is to make Flutter code more readable, less clunky, and
> easier to type

Wait, not typing new accomplishes all those amazing things? Here i thought it
was just three letters, which showed intent - hence easier to grok the
surrounding code

~~~
losvedir
You'd be surprised. In Flutter you construct new objects _all the time_ and
mostly inline (think React without JSX). The `new`'s really do get tedious
when you're making a tree like:

    
    
        Container(
          child: Column(
            children: [
              Text("One"), 
              Text("Two"), 
              Text("Three"),
            ]
          )
        )
    

It's not _major_ but I don't think your quote is overselling it either. It is
a quality-of-life change that does those things.

~~~
solidr53
I love how Container takes 'child', but Column takes 'children'.

~~~
Macha
One must be singular, the other takes a list? Doesn't seem too crazy.

------
jorblumesea
Flutter is going to make/break Dart. If flutter takes off, Dart is saved.
Otherwise, looks bleak.

~~~
mixmastamyk
When do you think flutter will support running on a stock Linux system?

~~~
wstrange
[https://github.com/google/flutter-desktop-
embedding](https://github.com/google/flutter-desktop-embedding)

~~~
mixmastamyk
Thanks, not officially supported.

------
kevingadd
Dart's history of breaking on browser updates because of weird technical
decisions really soured me on the idea of ever using it. It's apparently a
really good language for native targets, but for the web...

[https://github.com/dart-lang/sdk/issues/13285](https://github.com/dart-
lang/sdk/issues/13285)

[https://bugzilla.mozilla.org/show_bug.cgi?id=1027011](https://bugzilla.mozilla.org/show_bug.cgi?id=1027011)

I can't really blame the language designers, but it's a good example of how if
your goal is to cross-compile you have to be _very careful_ about how your
language is going to interact with the realities of the platforms it runs on.
The idea of my deployed websites or apps breaking every couple browser
releases really bums me out. (I've had to deal with it with other cross-
compilers too.)

------
hota_mazi
Between Javascript and TypeScript on the front end and Kotlin on the back end,
I don't see any area where Dart could ever grow to a meaningful mind share.

------
andrepd
>we were able to ship a full-featured experience that is fully interactive in
one second on modern devices and under five seconds on a modest mobile device
on a slow 3G network

Somehow, loading a text newsfeed in less than 5 seconds is an achievement in
lightweightness. Sigh.

~~~
dexterjs
So we are going to ignore the slow 3g network aspect in the quote you are
referring to then. Sigh.

~~~
andrepd
The very minimum admissible speed of 3G is 144kbps (barely faster than a 56k
dialup, this is what we're talking about). The hn site should load in less
than 3 seconds even on such an unrealistically slow network.

------
beefsack
I wouldn't be interested in Dart at all if it wasn't for Flutter. I can't help
but wonder if there will be Flutter bindings implemented for other languages
sometime.

~~~
pjmlp
That is the only way to keep Flutter relevant.

Right now, in what concerns iOS and Android, Qt and Xamarin also compile to
native, use mature languages (JS, C++, C#, VB.NET, F#), can also target
desktop and have an endless list of libraries to choose from.

Also Chrome team is quite interested in making PWAs succeed on mobile Web, and
they have Microsoft on board with them, given how JavaScript has first class
support on UWP.

------
jillesvangurp
They should de-emphasize Dart and refocus Flutter development around Kotlin
and make that a first class citizen and untangle flutter from Dart. Kotlin
already is the language of choice for Android development has a very similar
style to Dart (as in Dart provides few if any advantages that I'm aware off).
Google already supports Kotlin in Android studio and adoption over the last
few years has been enormous. Providing continuity for Android developers is
hugely important.

There's a Kotlin native compiler in the works that will support IOS, Android
(native), servers, and WASM as outputs. This makes it a proper full stack
language. Compiling to WASM to target frontend code is the sensible thing to
do. As far as I can tell, Dart 2 compiles directly to javascript instead of
using WASM. This does not make sense to me as a thing to push in 2018. Kotlin
has one as well but they have shifted development towards their native
compiler and supporting javascript vial wasm.

~~~
rehemiau
With Dart they can completely ditch the JVM and Oracle

~~~
pjmlp
Except that Google is actually part of the OpenJDK contributors.

They only have themselves to blame for Android Java.

If they actually bothered to buy Sun instead of hoping it would sink in
silence, the situation would be quite different and most likely cheaper than
what they already spent in lawyer wages and court expenses.

~~~
geodel
> most likely cheaper than what they already spent in lawyer wages and court
> expenses.

Not really. They would have spent max 100 million dollars in Oracle lawsuit.
Still lot less than billions to buy Sun with its mostly non-profitable crap
assets.

Anyway I think Oracle seemed natural fit for Sun. The were already using in
large number of their products and also selling licenses for turd technologies
like J2EE app servers, portals, enterprise service buses and so on. Java EE
was suppose to be big enterprise play and bring in lots of consulting revenue.

It is only recently they finally called it a day and dumped EE assets in
Eclipse backyard.

------
jswizzy
Flutter is the groundbreaking thing about Dart. Other than that it's just Java
1.5 without the killer opensource ecosystem that makes Java relevant to this
day. Rust, Swift, and Kotlin all blow Dart out of the water and are much
better investments unless Google wants to make Dart the only language their
new OS for some weird reason.

------
karmakaze
I'm very interested in Dart with Flutter being a better React-native. I have
no interest in the browser, having already bet once in v1/we components. There
are already great js frameworks. One thing that could win me over is if a
sensible, composible layout hierarchy is used that always outputs the needed
CSS.

------
EugeneOZ
I tried 1.x and I regret for wasted time. TypeScript is better for every niche
Dart is trying to fill.

~~~
munificent
I'm sorry Dart didn't work out for you, but I'm glad you found another
language that's helping you. We're lucky to live in a time where there are
lots of languages to choose from, each with its own strengths.

------
iffycan
As someone trying to make his first mobile app, I just ran through the Flutter
getting started guide and it was a much better experience than getting a
React-Native hello world going.

Just a couple pros I see:

* flutter doctor - what a helpful tool! * hot reload without losing state!?

If Dart can use my existing TypeScript code, I'll definitely use it.

~~~
skybrian
I don't believe it exists, but in theory someone could write a Flutter plugin
to evaluate JavaScript on V8 (Android) or JavaScriptCore (iOS).

------
khkjb80
i would have totally jumped on the flutter bandwagon except i feel flutter
missed a huge opportunity by not supporting web as a target. microsoft's
react-native-xp seems like the right direction. i'd love to hae a combination
of dart's sound typesystem + react-native-xp's api.

------
setheron
How's dart as a server ?

~~~
bovermyer
I believe that Google is now pushing Dart only for mobile development, and
that the server-side Dart is dead on the vine.

I could be wrong, but that's the impression I got.

~~~
munificent
It's not _dead_ , we (the Dart team) just haven't had the bandwidth to invest
much in it for a while. It's still supported. Most of our own tools —
compiler, analysis server, formatter, etc. — are all written in Dart, so we
are heavily entrenched in Dart being a good tool for command-line
applications.

Being a good _server-side_ language is a little different because then the
ecosystem needs get much larger. You need things like database bindings,
logging, etc. The current ecosystem for that on Dart isn't large but I hope we
get there eventually.

~~~
bovermyer
This is great to hear!

------
c-smile
I have a feeling that Dart is just D (or at least they are comparable syntax
and feature wise).

So is the question: why Dart?

Or is its goal to be a Java-on-Android killer? So always to have some
[inspectable] bytecodes as a delivery media and JIT those on a device? But
JavaVM is already there for that purpose so is that sacramental question
again...

------
e12e
"... the new keyword is now optional...".

Why optional and not deprecated?

~~~
munificent
Deprecating it is a breaking change and would make migrating code more
difficult. It's like how semicolons are allowed but rarely used in Ruby, Go,
etc.

The style guide says to omit "new" [1], and our formatter can remove them for
you [2], so the effect is that they are gone without the pain of a forced
migration.

[1]: [https://www.dartlang.org/guides/language/effective-
dart/usag...](https://www.dartlang.org/guides/language/effective-
dart/usage#dont-use-new)

[2]: [https://github.com/dart-lang/dart_style](https://github.com/dart-
lang/dart_style)

------
moomin
Is it just me or do the first few paragraphs sound a bit desperate: “We’re
relevant, really we are!”

Don’t get me wrong, there’s plenty of languages that haven’t set the world
alight that are nonetheless being used by a fair few people to do worthwhile
things.

------
qop
Dart excommunicated server side dart. If I were someone who has already been
let down once by that decision and is already frustrated by the extremely
lackluster library story for server side dart, why should I use dart?

Flutter is the only reason. I don't care about mobile. Hell, if they take
android to flutter-only, it'll finally give me the fire to switch to iOS. I
been meaning to anyways.

I'm happy that Bracha got out of there. What a shame such a bright man's work
has been so foully steeped in Google nonsense.

------
timsneath
Official announcement here: [https://medium.com/dartlang/dart-2-stable-and-
the-dart-web-p...](https://medium.com/dartlang/dart-2-stable-and-the-dart-web-
platform-3775d5f8eac7)

~~~
sctb
Thanks, we've updated the link from
[https://www.dartlang.org/dart-2](https://www.dartlang.org/dart-2) and
[https://9to5google.com/2018/08/06/version-2-of-googles-
dart-...](https://9to5google.com/2018/08/06/version-2-of-googles-dart-
programming-language-is-now-available/).

------
myself248
The Dart always was my favorite Dodge.

