

Ask HN: Why hasn't Dart become mainstream? - vsergiu

There was a lot of hype for Dart a couple of months&#x2F;1 year ago and now it seems it faded away. What happened?
======
tosh
I might be a bit biased (we're happily using Dart in production at
[https://www.blossom.io](https://www.blossom.io)) but:

I see more and more people I know who've been on the fence earlier to actually
start to play around with Dart recently (last few weeks).

Why?

Improved Dart support for IDEs apart from the Eclipse based Dart Editor:

    
    
        * IntelliJ Webstorm/IDEA:  https://www.dartlang.org/tools/webstorm/ & http://plugins.jetbrains.com/plugin/6351
        * Sublime: https://github.com/dart-lang/dart-sublime-bundle
        * Chrome Dev Editor: https://github.com/dart-lang/chromedeveditor
    

The platform itself is also maturing quickly. Some notable recent things from
the top of my head:

    
    
        * Soon: Dart on App Engine: https://www.dartlang.org/cloud/
        * Polymer.dart (replacement for Web UI, interop w/ Polymer.js)
        * Angular.dart (now 6 times faster! http://blog.angulardart.org/)
        * Dart became an official ECMA Standard (http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-408.pdf)
        * More and more incredible packages to use on pub http://pub.dartlang.org/packages?page=1
        * Dart 1.6 soon to be released which supports installing pub packages globally (similar to npm)
        * People start to learn about functional reactive programming and Dart as great native support for its concepts: https://www.dartlang.org/docs/tutorials/streams/
    

Building and releasing non-trivial projects takes some time so there is always
a bit of an incubation period re visibility of adoption and like I said from
my own perception even though it is just a personal anecdote Dart is getting
picked up.

Shameless plug: I've also started a series of posts on why I fell in love with
Dart. If you're interested to learn more check it out:

[https://medium.com/why-dart/why-i-fell-in-love-with-
dart-1f8...](https://medium.com/why-dart/why-i-fell-in-love-with-
dart-1f89554a4171)

------
bussiere
From wikipedia :

=

A special version of Chromium (the open-source browser at the core of Google
Chrome) comes with the Dart virtual machine, allowing it to run Dart
programs.[19] As of May 2013, Microsoft Internet Explorer, Mozilla Firefox,
Opera Software's Opera browser, and Apple Safari have no plan to embed a
separate Dart VM.[citation needed]

Dart source code can be compiled to JavaScript, allowing applications written
in Dart to run in all modern web browsers. In the M1 version, released in
October 2012, the generated JavaScript reached about 78% of the performance of
hand-written JavaScript while native Dart code ran about 21% faster than
similar code in V8.[6]

=

So for me : No browser except a special version of chromium, and slower than
javascript whend compiled in it. So NO ...

We have a lot of problem to have some standards on the web (css anyone ? ) ,
we fight with ie6, so taking such a non standard is nope.

~~~
andreasvc
That explains why it's not used in production. What I don't understand is why
the idea of replacing Javascript with something better hasn't been embraced.
Maybe Dart isn't actually better but I don't see anyone arguing that and that
is the interesting substantial question.

~~~
bad_user
I don't think Dart is better. It is better in some ways, but it's not enough.
You're not seeing arguments because currently people don't care.

Thing is, Javascript works as a target for other languages. For example
ClojureScript and Scala.js are examples of compilers targeting Javascript,
amongst many others. So people that want an alternative to Javascript already
have options.

From a technical point of view, I think Google made a mistake in designing a
new language, instead of a new VM that could be used as a more efficient
target for multiple languages, because even though Google tried copying the
good parts of Javascript's story, you can't beat the incumbents at their own
game. And from a social perspective, Dart is seen as an attempt to fragment
the web, so Google's handling of the situation was poor.

~~~
zevyoura
Dart does have a new VM (that's what Dartium uses after all), and it would
probably make for a better compile target than JS since it has strong typing,
better number types, etc.

------
christopherslee
My developer experience with Dart was not a good one. The most succinct way
that I read from other developer experiences on the internet was, "It's the
worst parts of Java brought into Javascript". Not intended as a trolling
statement, but like other folks have posted, it didn't strike me as having
provided interesting value/productivity gain.

~~~
lgunsch
I had the exact opposite experience. I was vastly more productive in Dart then
in JavaScript. The code result was also more clear and understandable. I would
say "readable", but often pretty looking code is as understandable as the
Brain Fuck language.

~~~
christopherslee
I'd be curious, have you tried coffeescript?

I'm not a javascript fan by itself, but I do like coffeescript. I was probably
making a comparison in my mind of coffeescript vs dart?

~~~
lgunsch
Yes, I wrote coffeescript daily for a few months. It is also much more
productive then JavaScript is, and I do enjoy it more then JavaScript, but I
still find it lacking compared to Dart. Dart gives you the option of static
typing. Static typing speeds up development because the compiler itself gives
you a bunch of free debugging effort. I also find it much easier to manage
includes and layout of the code. There is no need for tools like require.js,
browserify, or bower.

~~~
tosh
I made the same journey.

JavaScript => CoffeeScript => Dart.

I think once you've took the red pill of "There has to be something which is
better than JavaScript" it is hard to go back.

Once you've written some CoffeeScript you will start to long for even more
semantic improvements beyond classes, preventing you from polluting the global
namespace and being able to bind `this` using the fat arrow.

------
rogerbinns
I've been increasingly sceptical of things from Google, because of their track
record. That includes the usual losing interest, as well as general people
avoidance. Quite simply they are not a safe bet.

That all said it takes time for things to become mainstream. See the Joel
article: "Good Software Takes Ten Years"
[http://www.joelonsoftware.com/articles/fog0000000017.html](http://www.joelonsoftware.com/articles/fog0000000017.html)

Go dates from 2007, and is currently 8 years old, and is heading into the
mainstream. Dart is about 3 years old - it will take more time plus a non-
typical Google track record to get there, if it ever does.

------
proussea
I really hoped for something like python/ruby/coffeescript in the browser, and
I got something that looks like Java. And yes, I admit it, I did stop to check
Dart when i saw the curly braces. But others have probably better reasons ...

~~~
Alupis
> python/ruby ... in the browser

not a good idea. any fullfledged programming language that can operate in the
browser becomes a significant security risk. even with sand-boxing, if you can
break out of the sandbox, then you have access to a full-fledged language with
all of it's power. This is the reason Java has got a bad rap; it's due to the
use of Applets in the browser from which people have repeatedly broken out of
the sandboxing and then can execute arbitrary code on your system (without
your knowledge).

The only safe and secure way to have a language run in the browser, is if it
just simply does not have the capabilities that could harm your system (ie.
write directly to the disk, execute other local code, etc). If the language
just can't do it, then there's no sandbox to break out of and due harm with.
One of the (many) reasons Javascript has been successful. (I'm a Java
developer)

~~~
andreasvc
What are you talking about? Javascript _is_ a full-fledged programming
language. You can argue that certain languages are more or less difficult to
sandbox, but then I'd be interested in knowing why this is. I think what
actually happened is that they gave up on the idea of Java applets, and that
led to it becoming a security hazard, not any fundamental property of the
difficulty of sandboxing it.

~~~
brazzy
You think wrong. The inability to reliably restrict access to a rich API
library full of dangerous stuff _is_ a fundamental property of sandboxing as
an in-language mechanism, or at least Java's sandboxing model.

There's been a steady stream of critical security bugfixes for the Java
browser plugin coming out of Oracle for years, and it's never been enough.

~~~
andreasvc
I'm not convinced there is such an inability, or why Javascript would be
particularly better. Simply don't offer the dangerous libraries as part of the
runtime. It's the runtime which has to be secured, not the language.

~~~
Alupis
I'm afraid it's not that simple.

Vanilla javascript simply does not have the API's to make system calls. Java
does, as does Python, etc. Removing from the runtime (like in a java browser
plugin) is fine, until someone can break out of that sandbox and hook into the
runtime installed on the system, or inject a runtime, etc.

The thing that makes javascript a "safer" web language is it just simply
cannot make system calls, period. This was by design, as javascript was
intended for solely residing in the browser. All other languages have had
"web" bolted-on after the fact, and all have failed to be secure in the same
way Javascript has been.

Node.js and derivatives have explicitly added this functionality, which is
what we would then call a "general purpose programming language", aka. full-
fledged language.

There's no debate here. ECMA Script's designers were very public about their
logic in the design process, and the reasons stated here are exactly why they
made the choices they did.

~~~
zo1
A non-issue... All of those things/features you mention as problems could
simply be removed from the python interpreter included with the browser.

Will some of it leak through? Possibly. Does that mean we should do it or try?
Of course not.

~~~
Alupis
This is a straw-man argument. You are not understanding the fundamentals of
web safety and the design decisions behind ECMAScript and derivatives. Put the
fanboyism down (i love python just as much as the next guy).

if it can be removed (features, api's, etc), then it can be added back in
(maliciously or not) or hooked into via a system runtime or a program
installed on the system. If it's just not there at all (the api's nor the
facility for the api's), then it can't be added. that is really the boiled
down version.

every other language that has tried to be a web language without being
explicitly designed as a web language has failed. why do you think python
would be any different? because python is just so awesome?

and to rebut your point in the other thread, i have stated explicitly the
things that make javascript "safer" \-- you have just chosen to ignore them or
brush it off. I'll say it again -- javascript does not have the api's nor
capabilities to make direct system calls. system calls are filesystem actions,
threading actions, process manipulation, executing arbitrary code, writing to
different outputs, manipulating memory, etc. these are all considered highly
dangerous to run from a browser.

~~~
andreasvc
There is a simple strategy to make a sandboxed Python runtime. 1) remove
anything from the standard library that affects files or system stuff. 2)
disallow anything but Pure python libraries.

Arbitrary system calls can only come from either the standard library or an
extension module in C, and these are ruled out by step 1 and 2. Your argument
about adding things back in or hooking into other runtimes is unsubstantiated;
ruling out such things is the very goal of making a sandbox.

------
fmuaddib
I'm being using Dart for months now and I think people will soon realize that
it deserves to be the next javascript.

Here is what Dart really is: Node.js without the JavaScript baggage — I like
Node.js because of the principles on which it was built: run things
asynchronously whenever possible, use data streams whenever you can get away
with it, and tie it all together with futures and callbacks. The problem with
Node.js is that it’s JavaScript. There’s no distinction between types of
numbers, working with arrays is always janky, NaN-infused wat moments abound,
and so on.

But Dart gives you everything that’s great about Node.js without the baggage
of JavaScript clinging to the project like a nagging, alcoholic in-law. Dart
has an incredibly robust stream API and top-notch futures support baked into
the core dart:async library, plus a bunch of other stuff that you get for
free, like WebSockets, SSL support, a decent math library (complete with ints,
nums, and doubles out of the box), as well as the foundations for an Erlang-
flavored actor system in the dart:isolate library.

Basically, server-side Dart is trying to solve the same problems that Node.js
was built to solve, i.e. problems around asynchronous, non-blocking I/O, but
is doing so on a better VM and with a more robust and less flaky language.
Another bit of good news is that Dart in practice is highly reminiscent of
JavaScript, from the basic syntax to callback functions as first-class
citizens, which means that the bridge from Node.js to Dart isn’t a terribly
precarious one.

------
saosebastiao
The web doesn't need another language. It needs a sandboxable VM which has the
DOM as a first class citizen. Dart didn't address that need...it merely
provided another language and tried to strongarm its way into becoming a
standard.

~~~
jenscow
> The web doesn't need another language

Because choice is bad, right?

~~~
saosebastiao
I'm not saying another language is bad, just that it is not a deficiency of
the web. We already have hundreds of them...all of which are hacked onto a
language that was never created with the intent of acting as a VM. A web-
native VM would actually enable _much better selection_ of programming
languages than Javascript currently does. Dart is nothing more than a new soda
selection in a broken vending machine. It hasn't gone anywhere because it
isn't in any better of a position than the rest of the sodas in the vending
machine.

~~~
jenscow
Gotcha.

On a technical level, I would also have preferred something like a "bytecode"
type VM. However, I believe that would have severely hindered the uptake since
all browsers would have to support it before I'd even think about using it.

Dart's "VM" is already supported on all modern browsers.

edit: This was already tried with Java Applets, however I guess Microsoft's
implementation had put people off it. Plus it was before it's time, IMO.

~~~
lgunsch
Chrome already has somewhat of a VM. It has the NaCL, or "Native Client" which
lets you run native machine code.

[http://en.wikipedia.org/wiki/Google_Native_Client](http://en.wikipedia.org/wiki/Google_Native_Client)

------
ReginaldBull
To me Dart is really a great alternative to JS. The less I have to code in JS
the better. Dart gives me the Java/c++ kind of language, has a lot of nice
features out of the box, IntelliJ has a nice Dart-plugin - I can use strong
typeded vars... Sure Dart has its kickups and it's traps but it i envolves and
becomes more mature every day.

What the Dart Team got wrong was that at first there target were all the JS-
Devs out there. I think, a wrong decision. If you like JS, if you are used to
the whole toolstack, you probably stay with JS. But if you like a statically
typed, modern, language then Dart is a greate alternative.

~~~
tosh
I also think that the Dart Team expected more uptake from JavaScript people (I
also thought that) similar to how the Go people expected the most uptake from
C/C++ people.

Turns out that people who already are happy with an alternative solution are
less likely to switch than people who are already unhappy with the alternative
because they are not yet used to it/invested and judge it with fresh eyes
(like people from other camps like Python, Ruby, Scala, C#, Haskell, Clojure,
…).

I personally find it sad that there is such an aggressive backlash against
Dart from people who did not really take a close look at Dart or dislike
Google for some reason (see Paul Graham's essay on how to disagree
[http://www.paulgraham.com/disagree.html](http://www.paulgraham.com/disagree.html)).

If you look at decent JavaScript coders who are fluent with many programming
languages they tend to see Dart in a different light, take it for what it is
and judge it on its own merit.

Maybe focusing on getting the JavaScript community excited was a bit too
optimistic. I don't know, you gotta try right?

That said, Dart seems to have an easier time with people who come from
languages other than JavaScript or with people who only briefly learned
JavaScript to do some stuff and wonder why they have to avoid 90% of the
language and every library out there uses a slightly different not completely
compatible set of conventions to emulate classes, promises, packages …

------
innguest
Remind me again why it's so hard to come up with a better alternative to the
current HTML+CSS+JS mess?

Is the only problem the fact that we need a language that can be easily
sandboxed? Isn't Lua like that?

Supposing we solve the sandboxing problem, what's the next problem? Offering a
decent drawing API? Why not just offer an OpenGL viewport or something like
SVG but with interactivity?

I really need to be educated on what is the hard part about this (besides
widespread adoption - so I guess I'm wondering what's the technical obstacle).

~~~
andreasvc
My impression is that it's mostly a matter of inertia. On the technical side I
don't think any individual part is unsolved or even hard but technologies and
their applications keep changing (e.g., mobile) so it's not possible to create
one unified, elegant framework without it being obsolete immediately; the
alternative is that we incrementally evolve the existing mess ... Furthermore,
perhaps there's also an element of companies making their competitors' lives
more difficult by not embracing standards introduced by others.

------
adrianlmm
IMHO, Is not ready for main stream yet.

1.- There isn't native support in any browser, not even Chrome.

2.- Still has plenty of bugs.

But there are cases where Dart is used, so, the reasons my vary.

------
mark_l_watson
Last year I was very enthusiastic about Dart, and before that Clojurescript.

What put me off both languages was an experiment I did: I coded up the same
non-trivial web app in Clojurescript and Meteor. I wrote the Meteor app in
about half the time and it had more features. I didn't do the experiment with
Dart, but I have written enough server and client experiments in Dart that I
believe that Dart is not as agile as Meteor using plain JavaScript.

That said, Dart is nice, and for some combined client/server projects it makes
sense. I don't understand the complaints about it being a Google project
though. I used GWT a while back on personal projects and for customer work,
and Google did a good job of open sourcing it so betting a company on GWT
seemed safe enough. I have the same opinion about Dart - it could have a life
without Google support.

------
drabiega
I like Dart quite a bit. The tools are pretty nice and it has some good
features. It's biggest problem from my perspective was the largely unfinished
documentation. Many of the methods in the API reference list only signatures.
I'd use it for some projects if they ever fix that.

~~~
spankalee
Most of those methods are in dart:html where the library is generated from web
IDL. We should be pulling in more documentation from MDN, so I'm not sure
what's happening there.

------
aikah
> There was a lot of hype for Dart a couple of months/1 year ago and now it
> seems it faded away. What happened?

I personnaly dont use Dart because IMHO there are better options right now for
people who dont like writing raw javascript.

Coffeescript gives the declarative style i want for quick dev.

Typescript gives me the "type safety" that allows managing large codebases.

Clojurescript for other stuff.

The only reason I would use Dart is if Dart was part of the Android dev
stack,or Chrome for the public.

I see little reason to use Dart right now,though Dart has some very good
libraries,for game development,angular dart ,etc ... So maybe in the future
perhaps.

I think Microsoft strategy (Typescript) is a better one.

------
Derbasti
Or rather, why doesn't there seem to be much discussion about new native
programming languages in the browser?

JavaScript has many flaws, and there are plenty of languages available that
have similar properties as JavaScript that do not exhibit these flaws.

~~~
dandare
Simply because there is no incentive for some of the main players to make the
browser significantly better. Actually the opposite is true - think of what
has Microsoft and Apple to gain (or lose) if the browser becomes de facto
replacement for native OS and their walled gardens? (in case of MS the wall is
rather made of consumers inflexibility)

------
Igglyboo
The only thing that even supports it is a special version of Chromium so why
would anyone support it.

If we could use it in mainline Chrome/Chromium then maybe it could start to
take off but currently the install base is way smaller than even Chromes.

~~~
tosh
Dart runs in every modern browser (you can compile it to JavaScript). You can
use it for real world projects. We use it in production at
[https://www.blossom.io](https://www.blossom.io)

------
Shish2k
I wasn't interested in the first place, because I don't want to replace JS
with a different new browser-centric language; I want to replace it with an
existing good general-purpose language that just happens to run in a browser.

~~~
tosh
Dart is an awesome general purpose language with great performance for the
browser as well as stand-alone.

You can use Dart to write server-side or command line applications:

    
    
        * Soon: Dart support for App Engine http://dartlang.org/cloud
        * Documentation: Dart command-line/server: https://www.dartlang.org/docs/serverguide.html

------
pisabev
Dart is alive and getting better with each release. I'm coding with Dart for 7
months now. I'm using it in production and don't want to look back. I'm not
javascript hater, in fact i like javascript but Dart gives me much more -
better app design, better performance, better productivity. The only downside
is the libraries available (although growing constantly) - needs more time.
We've ported relatively big javascript application (around 50k rows of code)
and we're quite happy with the final result (hope never to write big
javascript app again).

~~~
rogerbinns
How big was the code in javascript versus in dart? The smaller the latter
number the more compelling dart becomes.

~~~
pisabev
Initially the dart vs javascript code were almost 1:1(compiled ~ 2 : 1) at
size We needed it to get it working first. But then we started to use some
dart conventions and the code shrink. The compiled version is still bigger
than compiled js though, but for me the real benefit here is the structure of
the code - it is getting more and more manageble. The app is very close to
ExtJS (custom windows like app)

------
jnowlan
Are there any plans for a coffeescript/python implementation of Dart? Could
that be done as a preprocessor?

As trivial as that sounds, that is part of what has hindered its adoption. I
seem to remember reading about the Dart team learning that many early adopters
were not c++/java people but Pythonista's. You'd think they would have adapted
to that.

~~~
airfoil
There's kind of a Python-To-Dart translator:

[https://github.com/PythonJS/PythonJS](https://github.com/PythonJS/PythonJS)

------
outside1234
TypeScript and CoffeeScript are better in this space. Much more like
JavaScript.

TypeScript in particular, brings something like ES6 to today's browsers.

~~~
jenscow
How are TypeScript and CoffeeScript better?

They are both languages that "compile" into Javascript, just like Dart is able
to.

------
marcosdumay
I'd say that Javascript is currently living a renaissanse, with people
creating libraries that make it operate on completely different (and
incompatible) paradigms.

Untill we have one (or few) winning paradigm, there is no point in replacing
Javascript. Whatever we create will become obsolet before it gets adopted.

------
Mikeb85
I dunno, as far as a compile to JS, statically typed language I prefer Haxe.
But JS is a great language - super flexible and powerful. How some people
choose to use it is questionable at times, but there's no doubt that it's
powerful.

~~~
freehunter
I would love to learn Haxe, but anything I can find about it assumes you've
been a professional Flash developer for 20 years or the example code doesn't
compile (and the errors are quite cryptic to me). I need a Learn Haxe the Hard
Way.

~~~
Mikeb85
Dunno, I never used flash but Haxe is pretty easy to follow. Try the newer
OpenFL examples... It helps to learn using OpenFL since it sets up a project
that compiles for you, then you can mess around with the syntax and language
features.

I also highly recommend using the 'Vaxe' VIM plugin with YouCompleteMe as well
- it will recognize your OpenFL project, and give you context aware auto-
complete, easy compilation of projects, etc..., making things much easier.

While Haxe without any framework can be confusing at first, it's really not
that bad...

------
LBarret
Currently, it is not very compelling, it is well engineered but different
enough to fuel enthusiasm.

But if someone produces something interesting with it, all can change...as
soon as tomorrow.

------
lmm
Mozilla more or less killed it by saying they'd never support it.

~~~
andreasvc
But why did they say that?

~~~
bryanlarsen
Adding support for Dart would be a huge maintenance expense over the years,
for a language that's basically a minor improvement over Javascript.

If they're going to support a new language, how about something with
widespread usage, such as Python?

How about something that offers significantly different capabilities, such as
R?

How about something that supports a huge number of languages and/or
significant speed improvements, such as the LLVM IR?

If they're going to open such a huge can of worms, they're going to want to
see substantial benefits rather than small incremental improvements.

They obviously can't support everything, so to pick a language it has to be
demonstrated that the language is a better choice than (pretty much) any other
choice. Dart has not done that.

~~~
lmm
I think that's a disingenuous argument. Mozilla has been happy to support
extremely marginal standards in the past - speech, the whole microformats
mess, webfonts. Dart had (and has) more momentum behind it, more developers
wanting to use it, than those.

By all means, bring on Python, R, or LLVM IR. I'd support any and all of those
(though including one doesn't have to mean excluding Dart). Any of those would
be a huge improvement over Javascript. But Mozilla seems to see ensuring as
much code as possible gets written in that abominable language as part of its
mission.

------
Joof
This may be naive, but why can't we just have an in-between compiled language
(that isn't JS) that any language can compile to and compile back from?

------
islon
For me it doesn't have any interesting feature that would make me use it over
Clojurescript. No macros, no functional focus, just the old Java way.

------
dgregd
Because it has too few good libraries and frameworks. For example I am waiting
for a good Postgresql driver. The existing drivers have _async_ API.

~~~
luci_pacurar
Why do you consider async a drawback?

------
xyproto
Which types of applications are Dart especially good at? I suspect there are
currently always better alternatives.

~~~
lgunsch
Dart is good at large applications, like 50,000+ lines of code. After 50,000
lines of JavaScript, you really start to miss static typing and hate the type
system that JavaScript uses.

~~~
frowaway001
This kind of ignores the second part of the comment:

> I suspect there are currently always better alternatives.

In my experience, this is true. There is no need for Dart, because there are
languages which are better.

So when people decide to replace JavaScript with something better, why would
they choose "slightly better" over "significantly better"?

~~~
jenscow
Dart has the restriction of "must be compilable to Javascript".

I guess the majority of existing mainstream languages have aspects that would
make meeting this requirement difficult, without breaking the language.

It's also about control. Once they implemented say, Python, there isn't then
much room for improvement/change without it becoming a different language
anyway.

~~~
frowaway001
> I guess the majority of existing mainstream languages

Given the wealth of languages out there, this still gives us a large amount of
languages to pick from.

> It's also about control. Once they implemented say, Python, there isn't then
> much room for improvement/change without it becoming a different language
> anyway.

That's why they should have just standardized some IL format instead, and let
real language designers target that IL.

~~~
jenscow
I almost agree with that (and I've spoke about that in another thread, in case
you're interested)

------
EugeneOZ
By the same reason why Rust hasn't became mainstream yet - just too young.

------
antidaily
I, for one, welcome our new javascript-killing overlords.

