3 ms·
When there is no Dart VM in the browser I honestly don't see any advantage over TypeScript. Two VMs inside each other (with two garbage collectors) will always
by brodo 11y ago
When there is no Dart VM in the browser I honestly don't see any advantage over TypeScript. Two VMs inside each other (with two garbage collectors) will always be slower and use more memory than just one. Additionally, you always need to ship the runtime with all your scripts. You also have to use FFI to interact with Javascript. All the advantages over plain JS you mentioned above are also present in TypeSctipt (or not needed).
There is also a nice discussion about TypeScript and Dart here: https://www.youtube.com/watch?v=5AqbCQuK0gM https://www.youtube.com/watch?v=5AqbCQuK0gM
- wtetzner 11y ago> Two VMs inside each other (with two garbage collectors) will always be slower and use more memory than just one. Is that how it works? I just assumed it would compile to JS and just use the JS garbage collector.
- vadimtsushko 11y agoDefinitely so
- tree_of_item 11y agoIt does compile to JS and use the JS garbage collector. The posting you're replying to is very misinformed.
- tosh 11y agoAs far as I understand you are also less likely to run into unpredictable performance (runtime bailing out) scenarios using Dart + dart2js.
- tree_of_item 11y agoWhat second garbage collector are you referring to? There aren't "two VMs inside each other" when you compile with Dart. I think Dart's biggest weakness is the fact that most web developers don't understand how compile to JS languages work and go around spreading all kinds of silly FUD. I remember posting a Gist on the day of Dart's release showing the compiled runtime, and the thread exploding with hundreds of comments from people laughing at the fact that it was 17,000 lines or so, nevermind the fact that that's how every compile-to-JS language that's more than a thin skin over JS semantics works.
- tosh 11y agoTypeScript is definitely an improvement over JavaScript but it is less ambitious compared to Dart (something that is also mentioned in the video you linked to). Dart is more than 'just' a language with cleaner semantics (which is already an improvement upon TypeScript which still is closely tied to JavaScript re type coercion problems etc). See my other posting. The Dart VM exists and can be used on the server side, for command line apps and in Dartium (fast dev cycle & debugging). There is advanced tooling, a very clean standard library, a mobile optimized runtime, bundler inspired package management (pub), a well staffed team of people working on the analyzer and compiler toolchain and a lot of stuff surrounding "Dart the language".