Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsApr 25, 2026·3 min de lecture

Dart — Client-Optimized Language for Fast Apps on Any Platform

Dart is a client-optimized programming language by Google designed for building fast apps on mobile, web, desktop, and server from a single codebase, and is the language behind Flutter.

assetLangBanner.body

Introduction

Dart is a statically typed, garbage-collected language created by Google that compiles to native ARM and x64 code, JavaScript, and WebAssembly. It is the primary language for Flutter and increasingly used for server-side, CLI tools, and full-stack web applications.

What Dart Does

  • Compiles ahead-of-time to native machine code for fast startup and low memory on mobile and desktop
  • Compiles to optimized JavaScript and WebAssembly for web deployment
  • Provides a JIT compiler for fast development cycles with hot reload in debug mode
  • Offers sound null safety that eliminates null reference exceptions at compile time
  • Includes an async/await model with streams and isolates for concurrent programming

Architecture Overview

Dart runs on the Dart VM in development mode with JIT compilation for sub-second hot reload. For production, the AOT compiler generates native binaries (ARM, x64) or JavaScript/Wasm output. The type system enforces sound null safety, meaning the compiler guarantees that non-nullable variables never hold null at runtime. Concurrency uses isolates, which are independent memory heaps that communicate through message passing, avoiding shared-state bugs. The dart:io library provides server-side I/O, while dart:html and package:web target browser environments.

Self-Hosting & Configuration

  • Install the Dart SDK standalone or as part of the Flutter SDK
  • Manage dependencies with pubspec.yaml and the dart pub package manager
  • Configure analysis options in analysis_options.yaml for linter rules and strictness levels
  • Use dart compile exe for native executables or dart compile js for web deployment
  • Set up server applications with shelf or dart_frog frameworks and deploy as native binaries

Key Features

  • Sound null safety prevents null reference errors by distinguishing nullable and non-nullable types at the language level
  • Hot reload via JIT compilation enables instant UI updates during development without losing app state
  • Single codebase compiles to native mobile (iOS/Android via Flutter), web (JS/Wasm), desktop, and server
  • Rich standard library with async primitives, collections, JSON handling, HTTP client, and file I/O
  • Strong tooling with built-in formatter (dart format), analyzer, test runner, and documentation generator

Comparison with Similar Tools

  • TypeScript — targets JavaScript only; Dart compiles to native code, JS, and Wasm with sound type safety
  • Kotlin — JVM-based with Kotlin Multiplatform for cross-platform; Dart compiles natively and is the foundation of Flutter
  • Swift — Apple-only ecosystem; Dart is cross-platform with first-class support for iOS, Android, web, and desktop
  • Go — excels at server-side concurrency with goroutines; Dart adds client-side strengths with Flutter and hot reload
  • JavaScript — ubiquitous but loosely typed; Dart offers sound null safety, AOT compilation, and better tooling for large codebases

FAQ

Q: Is Dart only useful with Flutter? A: No. Dart is used for server-side apps (with shelf, dart_frog), CLI tools, and standalone web apps. Flutter is the most popular use case, but Dart stands on its own.

Q: How does Dart's performance compare to native languages? A: AOT-compiled Dart approaches C-level performance for many workloads. On mobile, Flutter/Dart apps run at 60-120 fps with native compilation.

Q: What is sound null safety? A: Sound null safety means the type system guarantees that a non-nullable variable can never be null at runtime. The compiler enforces this statically, eliminating an entire class of runtime errors.

Q: How large is the Dart package ecosystem? A: The pub.dev registry hosts over 50,000 packages covering HTTP clients, database drivers, state management, serialization, and more.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires