Hacker News new | ask | show | jobs
by frowaway001 4102 days ago
> This is only about the Dart VM, not about the Dart language.

The writing is on the wall already. If Dart hasn't the chance to become a natively supported language, why would anyone pick it as a compile-to-JavaScript language, given there are so many superior options?

6 comments

> If Dart hasn't the chance to become a natively supported language, why would anyone pick it as a compile-to-JavaScript language, given there are so many superior options?

I don't think that the premise ("given there are so many superior options") is a non-controversial assertion. Which is probably why people who reject it would (and have been) picking it as a compile-to-JS language for web-facing projects.

The focus on compile-to-JS and JS interop for the web announced in the blog post makes Dart a more, rather than less, attractive language for web development, because it eases fears that taking full advantage of Dart might, in the near future, mean "works better on Chrome" rather than "targets the whole web", and because it means that Dart will work better with the universe of browser-targeted tools that aren't all written in Dart.

Dart is natively supported outside browsers. There is the standalone VM, which you can use just like Node.js, and the VM library, which you can embed in native applications.

The VM is crossplatform and it even supports ARM and MIPS.

They are also working on an interpreter which will get around the JIT restrictions on iOS and Windows Phone.

So why would I use this given there are languages which

  - are much better than Dart,
  - run in the browser and
  - run on a crossplatform VM which is much better than DartVM?
I think the obvious answer is that some people disagree with your first point. I think people should be programming in whatever language makes them happiest. For you that may not be Dart. For others, it is.
For me, it is.

Well, its semi-useless enums suck, but other than that I'm quite happy with it.

Nobody on this thread agrees with you that there are "so many superior options".

As far as I can tell, the Dart team set out to create a clean slate approach to what web developers need in a language (front-end and on the server) to address today's complexities. What the Dart team couldn't foresee how many developers would come down with Stockholm syndrome regarding JavaScript.

What people don’t get: adding more crap to JavaScript doesn’t make things easier, it makes things more complex. Think about it: the entire web is depending on a language that was thrown together in like 10 days and renamed from LiveScript to it would contain the word 'Java' because Java was the new hotness back in the day even though it had nothing to do with Jsva.

And now we’re going to add all of the stuff we didn't think about back then when JavaScript was considered a weird, fringe toy language, when the most complex thing anyone did was image rollovers.

JavaScript didn't "win" because it was great; it won because it good enough and we were literally stuck with it.

Not everyone wants good enough; some people want an excellent, purpose built language for the web with all of the goodies we’ve come to expect on Day 1--no polyfills, no hacks, no waiting for a years long standards process to run its course.

I’m looking forward to the Dart conference next month to see what’s next: https://www.dartlang.org/events/2015/summit/.

> Not everyone wants good enough; some people want an excellent, purpose built language for the web with all of the goodies we’ve come to expect on Day 1--no polyfills, no hacks, no waiting for a years long standards process to run its course.

Yes, absolutely; and Dart just doesn't fit that bill.

I find Dart to be far and away the best compile-to-JS language. That's more than enough for me.
Sounds more like you never actually checked the available options.
Sounds more like he has an individual opinion about the things that work best for him.
> given there are so many superior options?

If there are so many, can you list at least 5 superior options for us please.

What do you find superior to Dart?
Scala.js, Elm, PureScript, ...
I'm a big fan of Elm but it's still experimental. Major non-backward-compatible changes to the languages still happen sometimes in new releases. Not the same thing, really.

(Don't know that much about the others.)

Then pick Scala.js.

Solid, mature, great libraries and one of the best languages out there, even when competing against real (in the sense of not compile-to-JavaScript-only) languages.

People are different and not all thinks Scala is great language...
I'm unlikely to give it a serious try because I find the complexity of the Scala language to be pretty scary. Still, I'm curious: how fast is the compiler? Does it generate compact code? Clear error messages?
I started using Scala a few weeks ago. I'm finding it's pretty easy to ease yourself into it. So far I'm not doing much that I couldn't do in C#, but it's more concise in Scala. I was productive with it the first day.

I haven't tried scala.js yet, but I've gone through some presentation slides...they're claiming compact code that runs as fast as javascript, clear error messages that point to the line of scala sourcecode, and even some advantages over jvm scala (though I forget the details). Don't know about compile speed.

Aren't those, with the exception of Elm, much younger and less mature than Dart? I think a language has to reach a certain level before the majority of people will use it in production. And the tooling should be stable also. I think PureScript looks great but it has a different syntax (Haskell like) which may make it a hard sell and I'm not sure they have any debugger at all. When you use a compile-to-js language I think the debugger and editors are important, at least if your language is not very close to js (which Dart is).
Whoo, seems I am getting old. Thats the first time I hear anything of those languages.