Hello. I want to see Dart VM inside Node.js. But will be Dart use as Node.js Engine (sub-engine).
I think about scenario, where Dart work as Node.js native module. And runs like coffeescript runs through "coffee script.coffee".
I'd love to be able to run dart code compiled to JavaScript on node.js. I tried doing this with the old js interop package, but quickly ran into issues with I/O and finding a working preamble. It'd be great to have node.js be a target platform for dart2js or ddc. Dart packages could then theoretically serve two communities at once. If the resulting JS is readable, it would also help mitigate the whole "what if Google gives up on Dart?" fear since there would be a migration path. Does the new JS interop provide a better story for this?
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
I tried doing this with the old js interop package, but quickly ran into issues with I/O and finding a working preamble. It'd be great to have node.js be a target platform for dart2js or ddc.
Dart packages could then theoretically serve two communities at once. If the resulting JS is readable, it would also help mitigate the whole "what if Google gives up on Dart?" fear since there would be a migration path.
Does the new JS interop provide a better story for this?
--
Yes! Readable, debuggable, JS is a key goal of DDC (as opposed to dart2js where it never was).
Yes! Readable, debuggable, JS is a key goal of DDC (as opposed to dart2js where it never was).I understand that the reasoning behind choosing ES6 instead of ES5, as with ES5 the output will still not be really readable.The downside is of course, that we probably still need to use babel, for compiling it to ES6.Therefore, I would hope the team to consider maybe having an option compiling Dart to typescript instead of ES6. I think this makes sense, as when compiling to typescript, the types, annotations, and soon also async/await code would not get lost in the process.
Dart --> ES6 (with an ES5 module pattern)
Dart --> "typed JS AST" ---> ES6 w/ modules --> ES6+ES5 module pattern
|--> TypeScript
\--> ES6 w/ Closure Compiler comments/modules
So basically, compiling dart to typescript would probably give more readable code than compiling to ES6. Only then you would use the typescript compiler to target es5 (or es3), instead of babel.I wonder if in that way, I could write angular2 components in Dart, that could be used by angular 2 typescript devs.