SUPPORT THE WORK

GetWiki

Dart (programming language)

ARTICLE SUBJECTS
aesthetics  →
being  →
complexity  →
database  →
enterprise  →
ethics  →
fiction  →
history  →
internet  →
knowledge  →
language  →
licensing  →
linux  →
logic  →
method  →
news  →
perception  →
philosophy  →
policy  →
purpose  →
religion  →
science  →
sociology  →
software  →
truth  →
unix  →
wiki  →
ARTICLE TYPES
essay  →
feed  →
help  →
system  →
wiki  →
ARTICLE ORIGINS
critical  →
discussion  →
forked  →
imported  →
original  →
Dart (programming language)
[ temporary import ]
please note:
- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
{{For|the advertising application formerly called Google Dart|DoubleClick for Publishers by Google}}







factoids
| family = FIRST1=LARSURL=HTTP://GOOGLECODE.BLOGSPOT.COM/2011/10/DART-LANGUAGE-FOR-STRUCTURED-WEB.HTMLPUBLISHER=GOOGLE, 31 January 2016, Lars Bak (computer programmer)>Lars Bak and Kasper Lund| developer = Google| latest release version = 2.1.0weblink| latest preview version = 2.1.1-dev.3.2weblinkOptional typing>Optional,
2.x: Static typing|Static]weblink| scope =
Flutter (software)>Flutter| dialects = C Sharp (programming language)>C#, Erlang (programming language), JavaScript, Smalltalk, StrongtalkWEB LANGUAGES AND VMS: FAST CODE IS ALWAYS IN FASHION. (V8, DART) - GOOGLE I/O 2013PUBLISHER=GOOGLE, 22 December 2013, | influenced = | programming language = | platform = Cross-platform| operating system = Cross-platformBSD licenses>BSDwww.dartlang.org}}| file ext = .dart| fileformat = }}Dart is a general-purpose programming language originally developed by Google and later approved as a standard by Ecma (ECMA-408)weblink It is used to build web, server, desktop, and mobile applicationsweblink is an object-oriented, class defined, garbage-collected languageWEB,weblink A Tour of the Dart Language, www.dartlang.org, 2018-08-09, using a C-style syntax that transcompiles optionally into JavaScript. It supports interfaces, mixins, abstract classes, reified generics, static typing, and a sound type systemweblink

History

Dart was unveiled at the GOTO conference in Aarhus, Denmark, October 10–12, 2011.{{Citation | contribution-url=weblink | format= presentation | type= opening keynote | contribution= Dart, a new programming language for structured web programming | title= GOTO conference | url=weblink | place= Århus conference | date= 2011-10-10}} The project was founded by Lars Bak and Kasper Lund.WEB,weblink What is Dart, August 16, 2014, What is Dart?, O'Reilly, Ladd, Seth, Dart 1.0 was released in November 2013.WEB,weblink Dart 1.0: A stable SDK for structured web apps, news.dartlang.org, 2018-08-08, In August 2018, Dart 2.0 was released, with language changes including a sound type system.WEB,weblink Announcing Dart 2 Stable and the Dart Web Platform, Moore, Kevin, 2018-08-07, Dart, 2018-08-08,
Standardization
Ecma International has formed technical committee TC52WEB,weblink TC52 - Dart, 2013-12-16, to work on standardizing Dart, and inasmuch as Dart can be compiled to standard JavaScript, it works effectively in any modern browser. Ecma International approved the Dart language specification first edition in July 2014, at its 107th General Assembly,WEB,weblink Dart News & Updates, Anders Thorhauge Sandholm, dartlang.org, and a second edition in December 2014.WEB,weblink Dart News & Updates, Anders Thorhauge Sandholm, dartlang.org, The latest specification is available atweblink

Usage

There are three main ways to run Dart code:
Compiled as JavaScript: To run in mainstream web browsers, Dart relies on a source-to-source compiler to JavaScript. According to the project site, Dart was "designed to be easy to write development tools for, well-suited to modern app development, and capable of high-performance implementations."{{Citation | url=weblink | contribution= Why? | title= Dart lang | type= FAQ | quote= We designed Dart to be easy to write development tools for, well-suited to modern app development, and capable of high-performance implementations.}} When running Dart code in a web browser the code is precompiled into JavaScript using the dart2js compiler. Compiled as JavaScript, Dart code is compatible with all major browsers with no need for browsers to adopt Dart. Through optimizing the compiled JavaScript output to avoid expensive checks and operations, code written in Dart can, in some cases, run faster than equivalent code hand-written using JavaScript idioms.WEB,weblink PDF, JavaScript as a compilation target: Making it fast, Dartlang.org, 2013-08-18,weblink" title="web.archive.org/web/20160702204820weblink">weblink 2016-07-02,
Stand-alone:The Dart software development kit (SDK) ships with a stand-alone Dart VM, allowing Dart code to run in a command-line interface environment. As the language tools included in the Dart SDK are written mostly in Dart, the stand-alone Dart VM is a critical part of the SDK. These tools include the dart2js compiler and a package manager called pub. Dart ships with a complete standard library allowing users to write fully working system apps, such as custom web servers.WEB,weblink An Introduction to the dart:io Library, Dartlang.org, 2013-07-21,
Ahead-of-time compiled:Dart code can be AOT-compiled into machine code (native instruction sets). Apps built with Flutter, a mobile app SDK built with Dart, are deployed to app stores as AOT-compiled Dart code.WEB,weblink Flutter FAQ, How does Flutter run my code on iOS?, flutter.io, 2016-10-02,

Isolates

To achieve concurrency, Dart uses isolates, which are independent workers that do not share memory, but instead use message passing. This is similar to Erlang actors. Every Dart program uses at least one isolate, which is the main isolate. Since Dart 2 the Dart web platform no longer supports isolates, and suggests developers use Web Workers instead.WEB,weblink Dart2 Breaking Change: Removing web support for dart:mirrors and dart:isolate, Moore, Kevin, February 23, 2018, Google Groups,

Snapshots

Snapshots are a core part of the Dart VM. Snapshots are files which store objects and other runtime data.
Script snapshots
Dart programs can be compiled into snapshot files. These files contain all of the program code and dependencies preparsed and ready to execute. This allows fast startups.
Full snapshots
The Dart core libraries can be compiled into a snapshot file which allows fast loading of the libraries. Most standard distributions of the main Dart VM have a prebuilt snapshot for the core libraries which is loaded at runtime.
Object snapshots
Dart is a very asynchronous language. With this, it uses isolates for concurrency. Since these are workers which pass messages, it needs a way to serialize a message. This is done using a snapshot, which is generated from a given object, and then this is transferred to another isolate for deserializing.

Native mobile apps

Google has introduced Flutter for native mobile app development on both Android and iOS.Flutter Flutter is a mobile app SDK, complete with framework, widgets, and tools, that gives developers a way to build and deploy mobile apps, written in Dart. Flutter works with Firebase and other mobile app SDKs, and is open source.

Compiling to JavaScript

The Dart SDK contains two Dart-to-JavaScript compilers. During development, dartdevc supports quick refresh cycles. For the final version of an app, dart2js produces deployable JavaScriptweblink first compiler to generate JavaScript from Dart code was dartc, but it was deprecated. The second Dart-to-JavaScript compiler was Frog. It was written in Dart, but never implemented the full semantics of the language. The third Dart-to-JavaScript compiler was dart2js. An evolution of earlier compilers, dart2js is written in Dart and intended to implement the full Dart language specification and semantics.On March 28, 2013, the Dart team posted an update on their blog addressing Dart code compiled to JavaScript with the dart2js compiler,WEB, Ladd, Seth, 2013-03-28,weblink Dart News & Updates: Why dart2js produces faster JavaScript code from Dart, News.dartlang.org., 2013-07-21, stating that it now runs faster than handwritten JavaScript on Chrome's V8 JavaScript engine for the DeltaBlue benchmark.WEB,weblink Dart Performance, Dartlang.org., 2013-07-21,

Editors

On November 18, 2011, Google released Dart Editor, an open-source program based on Eclipse components, for Mac OS X, Windows, and Linux-based operating systems.WEB,weblink Google Releases Dart Editor for Windows, Mac OS X, and Linux, The editor supports syntax highlighting, code completion, JavaScript compiling, running web and server Dart applications, and debugging.On August 13, 2012, Google announced the release of an Eclipse plugin for Dart development.WEB,weblink Google Release Dart Eclipse Plugin, On April 18, 2015, Google announced that the Dart Editor would be retired in favor of the JetBrains integrated development environment (IDE),WEB,weblink The present and future of editors and IDEs for Dart, 2015-04-30, 2015-05-18, Dart News & Updates, Google, Ladd, Seth, which is now the recommended IDE for the language. The Dart pluginWEB,weblink JetBrains Plugin Repository : Dart, Plugins.intellij.net, 2013-07-21, is available for IntelliJ IDEA, PyCharm, PhpStorm and WebStorm. This plugin supports many features such as syntax highlighting, code completion, analysis, refactoring, debugging, and more. Other plugins are available for editors like Sublime Text, Atom, Emacs, Vim and Visual Studio Code.WEB,weblink Dart Tools, www.dartlang.org, 2016-11-15,

Chrome Dev Editor

In 2013, the Chromium team began work on an open source, Chrome App-based development environment with a reusable library of GUI widgets, codenamed Spark.WEB,weblink François, Beaufort, The chromium team is currently actively working, The project was later renamed as Chrome Dev Editor.WEB,weblink A Chrome app based development environment, It was built in Dart, and contained Spark which is powered by Polymer.WEB,weblink Chrome Story: Spark, A Chrome App from Google is an IDE for Your Chromebook, In June 2015, Google transferred the CDE project to GitHub as a free software project and ceased active investment in CDE.WEB,weblink Sri, Saroop, Chrome Dev Editor: Announcements,

DartPad

The Dart team created DartPad at the start of 2015, to provide an easier way to start using Dart. It is a fully online editor from which users can experiment with Dart application programming interfaces (APIs), and run Dart code. It provides syntax highlighting, code analysis, code completion, documentation, and HTML and CSS editing.WEB,weblink Announcing DartPad: A friction-free way to explore Dart code, 2015-05-06, 2015-05-18, Dart News & Updates, Google, Ladd, Seth,

SIMD

In 2013, John McCutchan announcedWEB,weblink Bringing SIMD to the web via Dart, that he had created a performant interface to single instruction, multiple data (SIMD) instruction sets for Dart.The interface consists of two types:
  • Float32×4, 4× single precision floating point values
  • Uint32×4, 4× 32-bit unsigned integer values
Instances of these types are immutable and in optimized code are mapped directly to SIMD registers. Operations expressed in Dart typically are compiled into one instruction with no overhead. This is similar to C and C++ intrinsics. Benchmarks for 4×4 matrix multiplication, 3D vertex transformation, and Mandelbrot set visualization show near 400% speedup compared to scalar code written in Dart.

Example

A Hello World example:main() {
print('Hello World!');
}A function to calculate the nth Fibonacci number:int fib(int n) => (n > 2) ? (fib(n - 1) + fib(n - 2)) : 1;// this is a fibonacci function implementation with a ternary operator in Dart// this code shall be read as:// If int n > 2, return fib(n - 1) + fib(n - 2); // otherwise, return int 1 as resultvoid main() {
print('fib(20) = ${fib(20)}');
}A simple class:// Import the math library to get access to the sqrt function.import 'dart:math' as math;// Create a class for Point.class Point {
// Final variables cannot be changed once they are assigned.
// Create two instance variables.
final num x, y;


// A constructor, with syntactic sugar for setting instance variables.
// The constructor has two mandatory parameters
Point(this.x, this.y);


// A named constructor with an initializer list.
Point.origin()
: x = 0,
y = 0;


// A method.
num distanceTo(Point other) {
var dx = x - other.x;
var dy = y - other.y;
return math.sqrt(dx * dx + dy * dy);
}


// Example of Operator Overloading
Point operator +(Point other) => Point(x + other.x, y + other.y);
// When you Instantiating a class such as Point, in Dart 2+, new is
// an optional word
}// All Dart programs start with main().void main() {
// Instantiate point objects.
var p1 = Point(10, 10);
var p2 = Point.origin();
var distance = p1.distanceTo(p2);
print(distance);
}

Influences from other languages

Dart is a descendant of the ALGOL language family,WEB,weblink Algol Family, c2.com, alongside C, Java, C#, JavaScript, and others.The method cascade syntax, which provides a syntactic shortcut for invoking several methods one after another on the same object, is adopted from Smalltalk.Dart's mixins were influenced by Strongtalk{{Citation needed|reason=Just seeing a citation implies it is true, the paper on Smalltalk/Strongtalk predates Dart so does not say for sure. Maybe someone know it is based on Strongtalk mixins. Strongtalk wasn't first to introduce mixins. No expert on mixins – are there different variants and for sure Strongtalk the first to use this variant? Even then would someone have to say that it is based on that language?|date=March 2014}}JOURNAL, Bracha, Gilad, Griswold, David, September 1996, Extending the Smalltalk Language with Mixins,weblink OOPSLA Workshop, OOPSLA, and Ruby.Dart makes use of isolates as a concurrency and security unit when structuring applications.WEB,weblink The Essence of Google Dart: Building Applications, Snapshots, Isolates, InfoQ, The Isolate concept builds upon the Actor model, which is most famously implemented in Erlang.The Mirror API for performing controlled and secure reflection was first proposed in a paperJOURNAL, Bracha, Gilad, Ungar, David, 2004, Mirrors: design principles for meta-level facilities of object-oriented programming languages,weblink ACM SIGPLAN Notices, ACM, 39, 10, 331–344, 10.1145/1035292.1029004, 15 February 2014, by Gilad Bracha (who is a member of the Dart team) and David Ungar and originally implemented in Self.

Criticism

Dart initially had a mixed reception and the Dart initiative has been criticized by some for fragmenting the web, due to the original plans to include a Dart VM in Chrome. Those plans were dropped to focus instead on compiling Dart to JavaScript.WEB,weblink Dart News & Updates, Seth Ladd, dartlang.org,

See also

References

{{Reflist|30em}}

Bibliography

  • BOOK, Kathy, Walrath, Seth, Ladd, March 7, 2012, What is Dart?, O'Reilly Media, 1st, 20, 978-14493-32327,weblink
,
  • BOOK, Kathy, Walrath, Seth, Ladd, November 7, 2012, Dart: Up and Running, O'Reilly Media, 1st, 144, 978-1449330897,weblink
,
  • BOOK, Chris, Buckett, December 28, 2012, Dart in Action, Manning Publications, 1st, 475, 978-1617290862,
,

External links

  • {{Official website|www.dartlang.org}}
{{Programming languages}}{{Google Inc.|corporate=yes|products=yes}}{{JavaScript}}

- content above as imported from Wikipedia
- "Dart (programming language)" does not exist on GetWiki (yet)
- time: 5:13am EST - Sun, Feb 17 2019
[ this remote article is provided by Wikipedia ]
LATEST EDITS [ see all ]
GETWIKI 09 MAY 2016
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
GETWIKI 20 AUG 2014
GETWIKI 19 AUG 2014
GETWIKI 18 AUG 2014
Wikinfo
Culture
CONNECT