最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

What are the limits of compiling dart to javascript? - Stack Overflow

programmeradmin11浏览0评论

I know, that dart is still in technical preview. Dart can also be piled to JavaScript.

But what are the limits of piling dart to javascript? Dart has to have some specific features or concepts within the language, that can not just be translated to JavaScript code?

The reason is, that a friend asked me if Dart can pile everything possible to JavaScript or that e.g. 5% of the languageelements (you know, the really cool improved stuff) will not be pileable.

I know, that dart is still in technical preview. Dart can also be piled to JavaScript.

But what are the limits of piling dart to javascript? Dart has to have some specific features or concepts within the language, that can not just be translated to JavaScript code?

The reason is, that a friend asked me if Dart can pile everything possible to JavaScript or that e.g. 5% of the languageelements (you know, the really cool improved stuff) will not be pileable.

http://www.dartlang

Share Improve this question edited Oct 31, 2024 at 21:20 Jonas 129k103 gold badges328 silver badges405 bronze badges asked Jul 20, 2012 at 19:27 GeroGero 13.6k28 gold badges70 silver badges112 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

My startup has developed a 50.000+ lines application in Dart and have so far stumpled upon very few limitations with regards to piling Dart to JavaScript. Dart was engeneered from the start to be converted to JavaScript so it does not suffer from the pilation issues that plagued GWT (allot of Java classes could not be serialized into Javascript by GWT, causing people to wrap stuff for no other reasons than to make the GWT piler happy).

Having said that, there do exists a few limitations when piling Dart to JavaScript but most of them are related to server side technology that cannot run in the browser like sockets and IO access and are thus very reasonable. There are also a few limitations with regards to passing objects to isolates, but I belive these will be sorted out in future releases of dart2js.

May I include a FAQ quote? ;)

Q. Will any valid Dart code pile to JavaScript, or are there limitations? Yes, we intend for any valid Dart code to pile to JavaScript. If some support is missing from one of our pilers, that's a bug (in either the piler or the spec).

So if it's not the case now, at least Google's goal is to pile any piece of Dart code to JavaScript.

发布评论

评论列表(0)

  1. 暂无评论