> I couldn't help reading the emphasized "types" in "optional types" as a yell for the Typescript developers
Dart was saying this before it was cool!
Historically, Dart was (in part) born out of Gilad Bracha's Pluggable Type Systems[1] paper, so the concept of optional types is the very heart of Dart, and was so long before TypeScript.
It's sad that Gilad's obsession with Smalltalk led to this.
I feel that Dart could have been a more serious competitor in that space if it was fully statically typed. No optional types. This would lead to a more credible language and, obviously, a more performant one.
A number of people on the Dart team are working on strong mode[1], which is very close to what you're asking for.
I say "very close" because "No optional types" is ambiguous. Type annotations are still optional in strong mode because in most cases it will infer the static type for you. Strong mode still also supports a dynamic type—much like C# does—because that's useful for things like interop or working with data.
Strong mode was initially created because it helps produce cleaner JS (unsurprising that static types help with static transpilation) but what we're hearing from customers is that they like it for better type safety and tooling. Even many of the Flutter[2] folks, who don't compile their Dart code to JS at all, are using strong mode because they get better static checking.
Not really. Counter-intuitively, all annotated types are thrown out at runtime, as far as I recall. The VM learns about types in the same way that JS VMs do. Dart's performance wins over JS are elsewhere (object construction and access (designed without prototypes to avoid the performance pitfalls of V8's hidden classes), lack of global object, with and eval…).
> The VM designers say that in practice, type guarantees really don’t help them nearly as much as you might think, because type checks are not a major drain on performance.
Dart was saying this before it was cool!
Historically, Dart was (in part) born out of Gilad Bracha's Pluggable Type Systems[1] paper, so the concept of optional types is the very heart of Dart, and was so long before TypeScript.
[1]: http://bracha.org/pluggableTypesPosition.pdf