ArticleslgStudy

computer science

Dart (programming language)

Dart (programming language) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Dart (programming language) rather than just read about it. In short: Dart is a programming language designed by Lars Bak and Kasper Lund and developed by Google. It can be used to develop web and mobile apps as well as server and desktop applications.

Dart (programming language) — main illustration
Dart (programming language) — illustration

Key takeaways

  • Dart (programming language) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Dart (programming language) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Dart (programming language) from memory before moving on to harder problems.

Reference excerpt

Dart is a programming language designed by Lars Bak and Kasper Lund and developed by Google. It can be used to develop web and mobile apps as well as server and desktop applications. Dart is an object-oriented, class-based, garbage-collected language with C-style syntax. It can compile to machine code, JavaScript, or WebAssembly. It supports interfaces, mixins, abstract classes, reified generics and type inference. The latest version of Dart is 3.14.2 .

History Dart was unveiled at the GOTO conference in Aarhus, Denmark, October 10–12, 2011. Lars Bak and Kasper Lund founded the project. Dart 1.0 was released on November 14, 2013. Dart had a mixed reception at first. Some criticized the Dart initiative for fragmenting the web because of plans to include a Dart VM in Chrome. Those plans were dropped in 2015 with the Dart 1.9 release. Focus changed to compiling Dart code to JavaScript. Dart 2.0 was released in August 2018 with language changes including a type system. In November 2019, Dart 2.6 introduced a new extension, dart2native. This extended native compilation to the Linux, macOS, and Windows desktop platforms. 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. The Flutter toolkit integrates Dart, so it can compile on small services like backend support. Dart 3.0 was released in May 2023 with changes to the type system to require sound null safety. This release included new features like records, patterns, and class modifiers. Dart can compile to WebAssembly since version 3.4.

Specification Dart released the 5th edition of its language specification on April 9, 2021. This covers all syntax through Dart 2.10. A draft of the 6th edition includes all syntax through 2.13. Accepted proposals for the specification and drafts of potential features can be found in the Dart language repository on GitHub. ECMA International formed technical committee TC52 to standardize Dart. ECMA approved the first edition of the Dart language specification as ECMA-408 in July 2014 at its 107th General Assembly. Subsequent editions were approved in December 2014, June 2015, and December 2015.

Deploying apps The Dart software development kit (SDK) ships with a standalone Dart runtime. This allows Dart code to run in a command-line interface environment. The SDK includes tools to compile and package Dart apps. Dart ships with a complete standard library allowing users to write fully working system apps like custom web servers. Developers can deploy Dart apps in six ways:

Deploying to the web Dart 3 can deploy apps to the web as either JavaScript or WebAssembly apps. Dart supports compiling to WebAssembly as of May 2024.

JavaScript To run in mainstream web browsers, Dart relies on a source-to-source compiler to JavaScript. This makes Dart apps compatible with all major browsers. Dart optimizes the compiled JavaScript output to avoid expensive checks and operations. This results in JavaScript code that can run faster than equivalent code handwritten in plain JavaScript. The first Dart-to-JavaScript compiler was dartc. It was deprecated in Dart 2.0. The second Dart-to-JavaScript compiler was frog. Written in Dart, it was introduced in 2013 and deprecated in 2020. This should not be confused with Dart Frog, an open-source Dart framework for building backend systems from Very Good Ventures. The third Dart-to-JavaScript compiler is dart2js. Introduced in Dart 2.0, the Dart-based dart2js evolved from earlier compilers. It intended to implement the full Dart language specification and semantics. Developers use this compiler for production builds. It compiles to minified JavaScript. The fourth Dart-to-JavaScript compiler is dartdevc. Developers could use this compiler for development builds. It compiles to human-readable JavaScript. On March 28, 2013, the Dart team posted an update on their blog addressing Dart code compiled to JavaScript with the dart2js compiler, stating that it now runs faster than handwritten JavaScript on Chrome's V8 JavaScript engine for the DeltaBlue benchmark. Prior to Dart 2.18, both dart2js and dartdevc could be called from the command line. Dart 2.18 folded these functions into the Dart SDK. This removed the direct command line wrappers but kept the two compilers. The webdev serve command calls the dartdevc compiler. The webdev build command calls the dart2js compiler. The Dart SDK compiles to JavaScript in two ways. To debug code, run webdev serve to compile a larger JavaScript file with human-readable code. Dart-generated JavaScript can be debugged using Chrome only.

To create production apps, run webdev build to compile a minified JavaScript file.

WebAssembly With the Dart 3.4 release, Google announced support for compiling Dart code to WebAssembly. Full support for Wasm requires adoption of the WasmGC feature into the Wasm standard. Chrome 119 supports WasmGC. Firefox 120 and later could support WasmGC, but a current bug is blocking compatibility. Safari and Microsoft Edge are integrating WasmGC support.

Deploying to native platforms Dart can compile to native machine code for macOS, Windows, and Linux as command line tools. Dart can compile apps with user interfaces to the web, iOS, Android, macOS, Windows, and Linux using the Flutter framework.

Self-contained executable Self-contained executables include native machine code compiled from the specified Dart code file, its dependencies, and a small Dart runtime. The runtime handles type checking and garbage collection. The compiler produces output specific to the architecture on which the developer compiled it. This file can be distributed as any other native executable.

Ahead-of-time module When compiled ahead of time, Dart code produces performant and platform-specific modules. It includes all dependent libraries and packages the app needs. This increases its compilation time. The compiler outputs an app specific to the architecture on which it was compiled.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Dart (programming language)

Start with the simplest possible case. Write down what Dart (programming language) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Dart (programming language) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Dart (programming language) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Dart (programming language)

In research
Dart (programming language) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Dart (programming language) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Dart (programming language) is common in secondary-school and first-year university syllabi. It links to neighbouring topics 2011 software, C programming language family, Concurrent programming languages, so understanding it makes those chapters shorter.
In everyday life
Look for Dart (programming language) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Dart (programming language)” →

How to study Dart (programming language) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Dart (programming language) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Dart (programming language) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Dart (programming language) in simple terms?

Dart is a programming language designed by Lars Bak and Kasper Lund and developed by Google. It can be used to develop web and mobile apps as well as server and desktop applications.

Why does Dart (programming language) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Dart (programming language)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Dart (programming language).

Tags

  • 2011 software
  • C programming language family
  • Concurrent programming languages
  • Dynamically typed programming languages
  • Free software projects
  • Google software
  • JavaScript programming language family
  • Object-oriented programming languages
  • Programming languages created in 2011
  • Programming languages with an Ecma International standard
  • Scripting languages
  • Software using the BSD license

Keep exploring