4 ms·
> Dart is a language on top of JavaScript Isn't Dart a compiled language that can be compiled to JS via dart2js and not "on top of JavaScript"?
by asow92 4y ago
> Dart is a language on top of JavaScript
Isn't Dart a compiled language that can be compiled to JS via dart2js and not "on top of JavaScript"?
- giancarlostoro 4y agoOriginally it was built on top of v8 itself if I'm not mistaekn, so the author might be referencing some historical knowledge that has kind of changed.
- mraleph 4y ago> it was built on top of v8 Was never built on top of V8 in any shape of form. Dart VM does not even share any code with V8. Dart 1 was designed by people who originally started V8 (Lars Bak and Kasper Lund), that's the only connection.
- giancarlostoro 4y agoSeems I too may be misremembering as well, I do know there used to be a custom Chromium build that included a Dart runtime so I assumed that was why v8 was used. But I remember now, there was an original effort to include dart in Chrome which met no fanfare.
- synergy20 4y agoyes, Dart has little to do with JS now, it's made for Flutter for the most part nowadays, and it is great.
- doodlesdev 4y agoYes, at first it reminds me a bit of Haxe [0], which compiles to a multitude of languages. Originally it was made to "replace" JavaScript, there's Angular Dart for instance as an example of what that would work like. But nowadays Dart can compile to JavaScript or "Dart Native" [2] which instead of Haxe reminds much more of Java or C# since it runs inside a VM in JIT mode. It can run on ARM32, ARM64 and x84_64 natively as machine code through the Dart runtime when compiled AOT and performance is of course much better than compiling to JavaScript so you can see why it's a really interesting option for the development of Flutter which targets web, desktop, and mobile. You write the code once and get to have JIT for development with hot reloading, debugging and live metrics, and AOT compilation for your desktop and mobile targets while also getting a JavaScript bundle for your web target. [0]: https://haxe.org/ https://haxe.org/ [1]: https://github.com/angulardart https://github.com/angulardart [2]: https://dart.dev/overview#platform https://dart.dev/overview#platform
- sarchertech 4y agoWorth noting Haxe can also compile to bytecode that runs on the HashLink VM.