What are the limits of dart compilation in javascript?

I know that the dart is still in the technical preview. Dart can also be compiled for JavaScript.

But what are the limits of dart compilation in javascript? Should a dart have some specific features or concepts in the language that cannot be simply translated into JavaScript code?

The reason is because a friend asked me if Dart could compile everything possible in JavaScript or that, for example, 5% of language elements (you know, really cool improved stuff) would not be compiled.

http://www.dartlang.org

+8
javascript compiler-construction dart
source share
2 answers

Can I include frequently asked questions ?;)

Q. Will any valid Dart code be compiled for JavaScript or is there a limitation? Yes, we intend to use any valid Dart code to compile JavaScript . If any of the compilers lacks any support, that error (in the compiler or in the specification).

So, if that is not the case, at least Google’s goal is to compile any part of the Dart JavaScript code .

+3
source share

My startup developed an application with more than 50,000 lines in Dart, and so far has imposed very few restrictions on compiling Dart to JavaScript. Dart was designed from the very beginning to convert it to JavaScript, so it does not suffer from compilation problems that suffer from GWT (Java class allocation cannot be serialized in JWascript GWT, as a result of which people wrap the material for no other reason than how to make the GWT compiler happy).

Having said that, there are many limitations when compiling Dart to JavaScript, but most of them are related to server-side technology, which cannot work in the browser, for example, sockets and access to IO and, therefore, is very reasonable. There are also a few restrictions regarding the transfer of objects in isolation, but I believe that they will be sorted in future releases of dart2js .

+7
source share

All Articles