Dart SDK

repository·main·Indexed 11 days ago

https://github.com/dart-lang/sdk

A multi-platform, strongly typed programming language for building high-quality apps on mobile, desktop, server, and web. The SDK includes flexible compilation strategies (JIT and AOT), the Dart Language Server (LSP), and the analysis_server for continuous codebase analysis.

Tokens
241.3K
Snippets
664
Records
1.1K
Agent score
95%

What's inside Dart

  1. Overview of Dart language and platforms

    main

    Dart is a strongly typed, productive language designed for high-quality applications across multiple platforms. It supports modern features like null safety and patterns.

    Compilation Targets

    Depending on your target platform, Dart uses different compilation technologies:

    • Dart Native: Targets mobile, desktop, and server. It utilizes a Dart VM with JIT (just-in-time) compilation for development and an AOT (ahead-of-time) compiler to produce optimized machine code (ARM, x64, or RISC-V) for production.
    • Dart Web: Targets the web. It uses dartdevc (development time compiler) for fast iteration and dart2js (production time compiler) for optimized JavaScript output. It also supports WebAssembly.
  2. Overview of the Dart Analysis Server (DAS)

    main

    The analysis_server package implements the Dart Analysis Server (DAS). The server provides the underlying logic for both IDE-based development experiences (providing features like code completion, error highlighting, and refactoring) and command-line tools. Key command-line tools powered by the analysis server include:

    • dart analyze: Used for static analysis of Dart code.
    • dart fix: Used to automatically apply code fixes to resolve issues identified by the analyzer.
  3. Overview of D3.js

    main
    D3.js (Data-Driven Documents) is a JavaScript library designed for manipulating documents based on data. It enables the creation of dynamic visualizations by leveraging web standards such as HTML, SVG, and CSS. Unlike proprietary frameworks, D3 provides direct access to the full capabilities of modern browsers through a data-driven approach to DOM manipulation and powerful visualization components.
  4. Overview of the Dart Web Developer Service (DWDS)

    main

    The Dart Web Developer Service (DWDS) enables developer tools designed for the native Dart VM to function with Dart Web applications. It acts as a proxy between tools using the Dart VM Service Protocol and execution environments (like Chrome) that use the Chrome DevTools Protocol.

    DWDS is specifically designed for applications that are:

    • Compiled with DDC (Dart Dev Compiler).
    • Built or served with webdev.
    • Running in the Chrome browser.
  5. Overview of the Dart Development Service (DDS) Protocol

    main
    The Dart Development Service (DDS) Protocol version 2.1 is an extension of the Dart VM Service Protocol. It implements the VM Service Protocol in its entirety and uses JSON-RPC 2.0 for communication. Developers building tooling for Dart can use DDS to access enhanced features like event history and coordinated isolate resumption.
  6. Overview of the js_runtime package

    main
    The js_runtime package provides shared code used by both the dart2js compiler and the dart2js runtime libraries. It serves as a bridge to ensure consistency between the compilation phase and the execution environment in JavaScript.
  7. Overview of Dart Runtime Services

    main

    Dart Runtime Services is a collection of implementations based on package:dart_runtime_service. It provides a framework for creating Dart developer services with a shared frontend and pluggable backends. This architecture allows services to share common platform-agnostic behaviors while delegating specific protocol implementations to custom backends.

    Common features provided by the shared frontend include:

    • Launching and advertising a server
    • Handling connections via multiple protocols (WebSockets, SSE, HTTP)
    • Authentication code verification
    • Notification routing via stream subscriptions
    • Client-registered service extension routing
    • DevTools hosting
  8. Overview of the CFG package

    main

    The pkg/cfg package provides a Control Flow Graph (CFG) intermediate representation (IR) for Dart programs. It is designed to facilitate optimization passes performed on the CFG.

    The package is structured into four main areas:

    • front_end/: Handles the translation from the Kernel AST to the CFG.
    • ir/: Contains the CFG/SSA (Static Single Assignment) IR and logic for computing its properties.
    • passes/: Implements various optimization passes.
    • utils/: Provides general-purpose utilities for CFG operations.
  9. Overview of package:dap_adapters

    main
    The package:dap_adapters provides implementations of the Debug Adapter Protocol (DAP) specifically for Dart. It acts as a translation layer that converts DAP requests from an IDE or debugger client into the Dart VM Service protocol. This allows developers to use standard DAP-compatible tools to debug Dart applications.
  10. What is package:dartpad?

    main

    The package:dartpad library allows you to build web applications that provide a browser-based prototyping environment for Dart and Flutter.

    It manages two primary components:

    1. A Worker: A dart2wasm compiled Web Worker that provides an in-memory file system, the Dart LSP server, the Dart Development Compiler (DDC), and a subset of dart pub commands for dependency resolution.
    2. A Sandbox: An isolated iframe that runs, hot-reloads, and hot-restarts DDC-compiled Dart code, while proxying console output and unhandled exceptions to the host application.

    To build a custom experience, you launch the worker, connect the language server to your editor, compile code, and instruct the sandbox to execute it.

  11. Overview of the dart2bytecode package

    main

    The dart2bytecode package is a Dart bytecode compiler.

    Warning: This package is currently experimental. It is not published as a standalone package and is not included in the standard Dart SDK. Users should avoid depending on this package in production environments as it is subject to breaking changes or complete removal without notice.

  12. Overview of Dart Kernel

    main

    Dart Kernel is a high-level intermediate language derived from Dart. It serves as an intermediate format for whole-program analysis, transformations, and as an input for code generation and execution backends.

    Key characteristics:

    • In-memory representation: Implemented using Dart structures.
    • Serialization: Supports both binary and text formats.
    • Stability Warning: Both the language and its implementations are currently unstable and under active development. There is no semver contract; developers should depend on specific individual versions rather than ranges.