Pular para o conteúdo

Conheça Walt Disney World

Dart (programming language)

Dart
Dart-logo.png
Appeared in 2011
Developer Google
Preview release 0.06[1] (December 13, 2011; 40 days ago (2011-12-13))
Typing discipline optional
Influenced by CoffeeScript,[citation needed] Java, JavaScript, Strongtalk[citation needed]
Usual filename extensions .dart
Website www.dartlang.org

Dart (originally called Dash)[2] is a Web programming language developed by Google. It was unveiled at the GOTO conference in Aarhus, 2011 October 10-12.[3] The goal of Dart is "ultimately to replace JavaScript as the lingua franca of web development on the open web platform."[2]

Contents

Motivation

Dart is intended to solve JavaScript's problems (which, according to a leaked memo, cannot be solved by evolving the language) while offering better performance, the ability "to be more easily tooled for large-scale projects" and better security features.[2] Google will offer a cross compiler that compiles Dart to ECMAScript 3 on the fly, for compatibility with non-Dart browsers. There will also be a facility to convert typed Closure code to Dart.[4] Google also plans to integrate a native VM into Chrome (there is now a Chromium branch available[5]) and encourage competitors to do the same with their browsers. The Dart VM and Dart Cross Compiler could be available in late 2011.

Compilers

dartc compiles Dart to plain JavaScript. Frog is a new Dart compiler written in Dart; while it does not yet have all the capabilities of dartc, it generates much more optimized code.[6] On November 18, 2011, Google released Dart Editor, an open-source Dart editor based on Eclipse components, for Mac OS X, Windows, and Linux.[7]

Example

The famous Hello World example:

main() {
    print('Hello World!');
}

A function to calculate the nth Fibonacci number:

int fib(int n) {
    return (n <= 1) ? n : (fib(n - 1) + fib(n - 2));
}
 
main() {
    print('fib(20) = ${fib(20)}');
}

Competitive landscape

As of January 2012, Microsoft Internet Explorer, Mozilla Firefox, and Apple Safari do not have plans to implement support for Dart.

Microsoft's JavaScript team has stated in Nov. 2011 that, "Some examples, like Dart, portend that JavaScript has fundamental flaws and to support these scenarios requires a 'clean break' from JavaScript in both syntax and runtime. We disagree with this point of view."[8]

Apple engineer Oliver Hunt, working on the WebKit project (which powers both Safari and Google's own Chrome browser) has stated, "Adding an additional web facing language (that isn't standardized) doesn't seem beneficial to the project, if anything it seems harmful (cf. VBScript in IE)."[9]

Hunt goes on to say, "Adding direct and exposed support for a non-standard language [Dart] is hostile to the open-web by skipping any form [of] 'consensus' driven language development that might happen, and foisting whatever language we want on the web instead. This implicitly puts any browser that supports additional proprietary extensions in the same position as a browser supporting something like vbscript, and has the same effect: breaking the open web by making content that only works effectively in a single product."[10]

Mozilla's Brendan Eich, who developed the JavaScript language, has stated, "I guarantee you that Apple and Microsoft (and Opera and Mozilla, but the first two are enough) will never embed the Dart VM. So 'Works best in Chrome' and even 'Works only in Chrome' are new norms promulgated intentionally by Google. We see more of this fragmentation every day. As a user of Chrome and Firefox (and Safari), I find it painful to experience, never mind the political bad taste."[11]

See also

References

  1. ^ Walrath, Kathy (2011-12-13). "Dart language spec v0.06 now available". dartlang.org. Google. http://www.dartlang.org/news/2011/12/13/dart-language-spec-0.06.html. 
  2. ^ a b c Miller, Mark S. (November 16, 2010). ""Future of Javascript" doc from our internal "JavaScript Summit" last week". [email protected] mailing list. https://gist.github.com/1208618. Retrieved 2012-01-22.  Leaked internal Google email.
  3. ^ Presentation: "Opening Keynote: Dart, a new programming language for structured web programming" - GOTO Aarhus 2011 conference. Planned official presentation of the Dart language, on October 10.
  4. ^ Rauschmayer, Axel (11 September 2011). "Google Dart to “ultimately ... replace JavaScript”". 2ality. http://www.2ality.com/2011/09/google-dart.html. 
  5. ^ Dart is on Chromium – and Dart meets Scala
  6. ^ TurboManage: Dart-to-JS compilation with Frog
  7. ^ Google Releases Dart Editor for Windows, Mac OS X, and Linux
  8. ^ JavaScript Team (Shanku Niyogi, Amanda Silver, John Montgomery, Luke Hoban, Steve Lucco) (November 22, 2011). "Evolving ECMAScript". IEBlog. Microsoft. https://blogs.msdn.com/themes/blogs/generic/post.aspx?WeblogApp=ie&y=2011&m=11&d=22&WeblogPostName=evolving-ecmascript&GroupKeys=. Retrieved 2012-01-22. 
  9. ^ Hunt, Oliver (13:36:26 PST, 5 December 2011). "WebKit branch to support multiple VMs (e.g., Dart)". webkit-dev mailing list. https://lists.webkit.org/pipermail/webkit-dev/2011-December/018787.html. Retrieved 2012-01-22. 
  10. ^ Hunt, Oliver (23:24:43 PST, 5 December 2011). "WebKit branch to support multiple VMs (e.g., Dart)". webkit-dev mailing list. https://lists.webkit.org/pipermail/webkit-dev/2011-December/018813.html. Retrieved 2012-01-22. 
  11. ^ Eich, Brendan (2011-09-10). ""Even Brendan Eich admitted...". As if I would not expect, nay demand, that Gila...". Hacker News. Y Combinator. https://news.ycombinator.com/item?id=2982949. Retrieved 2012-01-22. 

External links

Personal tools
  • Log in / create account
Namespaces
Variants
Actions
Navigation
Toolbox
Print/export