4 ms·
> Dart doesn't introduce that many advantages over JS for all of its differences As someone with experience in both languages, I could not disagree more. > Da
by markdog12 10y ago
> Dart doesn't introduce that many advantages over JS for all of its differences
As someone with experience in both languages, I could not disagree more.
> Dart was originally presented as a wholesale replacement of Dart
I think you meant replacement of JS here. I guess it depends entirely on what you think of JS as a language. I, for one, would rather a language that fixes core issues with JS, instead of just being a superset of JS.
- gsnedders 10y ago> I think you meant replacement of JS here. I guess it depends entirely on what you think of JS as a language. I, for one, would rather a language that fixes core issues with JS, instead of just being a superset of JS. If I were aiming to replace JS, I'd fix what Dart does, but I wouldn't stop with merely fixing what Dart does. Dart, despite being an entirely new language, has a less expressive type system than TS. It's transpiler (and it's VM) also does no optimisation based on the type system, instead heavily relying on the JIT to infer what the types already imply (e.g., it would be nice to do things like LICM at compile-time).
- markdog12 10y ago> has a less expressive type system than TS Care to elaborate on that? As for the rest of your comment, I'm with ya. I guess they're reasoning behind that was they thought a lot of development would start out untyped with additional types added as development progressed. I think that assumption didn't pan out, at least that's not how I do it. Official answer from https://www.dartlang.org/faq https://www.dartlang.org/faq: "Q. But don’t you need sound typing information to get high performance? Sound types can help with performance but aren’t essential. What we need are uniform, simple semantics. Modern VMs can use actual runtime behavior as a valuable signal for optimizations."
- logicchains 10y ago>Care to elaborate on that? I'm not the OP, but TypeScript supports union types (A | B ; a type that can be either type A or type B) and intersection types (A & B ; a type that is both A and B), while Dart doesn't. https://www.typescriptlang.org/docs/handbook/advanced-types.html https://www.typescriptlang.org/docs/handbook/advanced-types.... Typescript also has structural types, like Go and OCaml, which many people find nicer than nominal types. Structural types mean if I have an interface Blaz with two methods Foo and Bar, if I have an object MyObject with Foo and Bar methods of the same types then my object counts as a Blaz, while nominal types mean I have to write something like MyObject extends Blaz.
- skybrian 10y agoThat's how dart2js works today but the goal for Dart 2.0 is to move to a sound type system. The beginning of this is available today as "strong mode" and the Dart Dev Compiler.
- coldtea 10y ago>As someone with experience in both languages, I could not disagree more. Elaborate then. Because one's major advantages can be another's (and sometimes, objective) trivialities...
- markdog12 10y agohttps://www.dartlang.org/guides/language/language-tour https://www.dartlang.org/guides/language/language-tour