Dart (programming language): Difference between revisions

Content deleted Content added
No edit summary
m remove arbitrary fixed sizes
Line 5:
| title=Dart
| logo=Dart programming language logo.svg
| logo size = 230px
| logo caption=
| screenshot=<!-- Image name is enough -->
Line 46 ⟶ 45:
Dart 2.6 introduced a new extension, <code>dart2native</code>. This extended native compilation to the Linux, macOS, and Windows desktop platforms.<ref>{{Cite web |title=Dart language evolution |url=https://dart.dev/guides/language/evolution |access-date=2023-06-20 |website=dart.dev |language=en}}</ref> Earlier developers could create new tools using only Android or iOS devices. With this extension, developers could deploy a program into self-contained executables. The Dart SDK doesn't need to be installed to run these self-contained executables.<ref>{{Cite web |title=Dart overview |url=https://dart.dev/overview.html |access-date=2023-05-12 |website=dart.dev |language=en }}{{Dead link|date=March 2024 |bot=InternetArchiveBot |fix-attempted=yes }}</ref> The [[Flutter (software)|Flutter]] toolkit integrates Dart, so it can compile on small services like backend support.<ref>{{Cite web|url=https://www.infoworld.com/article/3454623/dart-26-brings-native-compilation-to-the-desktop.html|title=Dart 2.5 brings native compilation to the desktop|website=Infoworld|date=20 November 2019|access-date=2019-11-28}}</ref><ref>{{Cite web|url=https://sdtimes.com/goog/dart-2-6-released-with-dart2native/|title=Dart 2.6 released with dart2native|website=SDtimes|date=7 November 2019|access-date=2019-11-28}}</ref>
 
Dart 3.0 was released in May 2023<ref>{{Cite web |title=Dart language evolution |url=https://dart.dev/guides/language/evolution |access-date=2024-01-09 |website=dart.dev |language=en}}</ref> with changes to the type system to require sound null safety. This release included new features like records, patterns,<ref>{{Cite web |title=Patterns |url=https://dart.dev/language/patterns.html |access-date=2023-05-12 |website=dart.dev |language=en }}{{Dead link|date=March 2024 |bot=InternetArchiveBot |fix-attempted=yes }}</ref> and class modifiers.<ref>{{Cite web |title=Class modifiers |url=https://dart.dev/language/class-modifiers}}</ref>
 
Dart can compile to [[WebAssembly]] since version 3.4.<ref name=":3">{{Cite web |last=Thomsen |first=Michael |date=2024-05-14 |title=Landing Flutter 3.22 and Dart 3.4 at Google I/O 2024 |url=https://medium.com/flutter/io24-5e211f708a37 |access-date=2024-05-17 |website=Flutter |language=en}}</ref>
Line 216 ⟶ 215:
</syntaxhighlight>
 
A simple [[for-loop]]:<ref>{{Cite web | title=Loops in Dart {{!}} Fluter World {{!}} Dart and Flutter Tutorials | url=https://www.flutterworld.tech/tutorials/dart-tutorials/dart-basics/loops-in-dart/#for-loop}}</ref>
 
<syntaxhighlight lang="dart">
Line 293 ⟶ 292:
 
==Influences from other languages==
Dart belongs to the [[ALGOL]] language family.<ref>{{cite web|url=http://c2.com/cgi/wiki?AlgolFamily|title=Algol Family|work=c2.com}}</ref>{{NotFailed in refverification|date=September 2023}} Its members include C, Java, C#, JavaScript, and others.
 
The [[Method cascading|method cascade]] syntax was adopted from Smalltalk.<ref>{{Cite web |title=Method Cascades in Dart |date=10 September 2019 |url=https://news.dartlang.org/2012/02/method-cascades-in-dart-posted-by-gilad.html |access-date=2023-05-13 |language=en}}</ref> This syntax provides a shortcut for invoking several methods one after another on the same object.