News for hackers. Stuff that matters.
Re:Angular Announces AngularDart by rdtsc on Tuesday November 05, 2013 @09:45PM (#6680226)
Don't listen to the hate and vitriol.

Dart has a nice IDE, good clean types and language design. People are upset because they jumped on the wrong band-wagon and now something shiner and newer came around so they are not the cool hipsters anymore. Kind of like in the kindergarten the kid with the shiny new bike is boasting then some other kid gets the later, better, shinier model, the first gets upset and throws a tantrum.

Look at Dart's performance benchmarks. Its DartVM is about 2x as fast as v8 (JS) and its compiled to JS version is on par with v8.

https://www.dartlang.org/performance/

Re:Angular Announces AngularDart by pcwalton on Wednesday November 06, 2013 @03:14AM (#6681527)
> Dart has a nice IDE, good clean types and language design.

I have a serious problem with Dart's design: the type system is deliberately unsound around generics because the designers apparently think that supporting variance (which is not that difficult!) is worse than having types tell the truth. I would much rather there be no type system at all than there to be an unsound one, as I don't think compilers and IDE's should lie to you.

I think that's a mistake that the new language of the Web should not make, but Google seems unwilling to change it. Unlike JavaScript's warts, which be worked around for the most part, I don't see any way to fix a flaw that serious in the type system once Dart is stable.

Re:Angular Announces AngularDart by discreteevent on Wednesday November 06, 2013 @04:23AM (#6681743)
I don't understand this. Dart is a dynamic language that gives you the option of adding types that help with tooling, documentation and some type checking at design time. At run time you can run it in checked mode and it will always tell the truth. This means that if you cover your code at all, manually or automatically then it will inform you of type errors. If you don't cover your code before releasing it then you probably are not writing anything very serious anyway. How is this worse than a dynamic language that offers you no optional typing with full checking at runtime?
Re:Angular Announces AngularDart by pcwalton on Wednesday November 06, 2013 @06:11AM (#6682077)
> Dart is a dynamic language that gives you the option of adding types that help with tooling, documentation and some type checking at design time.

But the tooling and documentation aren't telling you what will happen at runtime.

> At run time you can run it in checked mode and it will always tell the truth.

It doesn't tell you the truth. A static type system is designed to rule out errors are compile time. That's what makes a static type system different from type assertions or guards.

Besides, I don't really know what "telling you the truth" means if, for example, function arguments unify under covariance instead of contravariance like they should. Whether that happens at runtime or at compile time makes no difference—it's equally wrong either way.

> This means that if you cover your code at all, manually or automatically then it will inform you of type errors.

This is always true in any dynamic language.

> How is this worse than a dynamic language that offers you no optional typing with full checking at runtime?

In JS's case we can still add a static type system that's actually sound, whereas Dart has already crossed the bridge into unsoundness.

Re:Angular Announces AngularDart by discreteevent on Wednesday November 06, 2013 @08:28AM (#6682538)
>That's what makes a static type system different from type assertions or guards. This system is different from type assertions or guards in that you do not have to write any assertions but will still be informed of most type errors at compile time and virtually all type errors at runtime (Its been a while since I have written some Dart so I'm not 100% sure and don't have time to check if its exactly 100% of scenarios)

> This means that if you cover your code at all, manually or automatically then it will inform you of type errors. >> This is always true in any dynamic language.

No, there's a difference. I will get the error in dart as soon as I try to use the object in any way. In a dynamic language I could call a few methods on it before calling a method it does not support. i.e. it behaves like a compiler would except at run-time. This makes a big difference in how quickly you can debug it and again this is only for the minority of scenarios that are not covered at compile time.