Skip to content
SPECIFICTION
Get listed

Cargo vs Dart pub

Cargo

doc.rust-lang.org

Dart pub

dart.dev

Side by side

FigureCargoDart pub
Price fromFree—
Free planYes—
Free trial——
Open source——
WindowsYesYes
macOSYesYes
LinuxYesYes
Plans published10
Spec score · Package Managers8.8 (#6)7.8 (#46)
Command lineCargo is used through a command line interface.Pub can be used from the command line with the `dart pub` tool.
Dependency managementCargo downloads and builds package dependencies and helps ensure repeatable builds.Pub resolves package versions that work together and with the installed Dart SDK.
Dependency resolutionYesPub manages dependency versions to find versions compatible with each other and with the Dart SDK version.
Free planYesYes
Lockfile supportYesYes
Offline installationYesYes
Package formatsRust crates; crates.io packages; alternate registry packages; Git dependencies; local path dependenciesDart packages
Private registry authYesYes
PurposeCargo is the Rust package manager.Pub is Dart’s package manager for managing package dependencies.
Supported platformsWindows; macOS; Linux; other Unix-like systemsWindows,Linux,macOS
Workspace supportYesYes

Plans

Cargo

  • CargoFree

Cargo pricing →

Dart pub

No plans published.

Dart pub pricing →

In their own words

Cargo

Cargo is the free package manager and build tool for Rust, used through a command-line interface. It downloads dependencies, builds packages, and supports repeatable builds with lockfiles. Developers can compile, check, document, test, run, package, install, and publish Rust projects. The `cargo new` command creates a package, defaulting to a binary; adding `--lib` creates a library. Cargo uses crates.io by default and also handles alternate registries, Git dependencies, and local paths. Workspaces allow multiple packages to share a lockfile and output directory. Package features can enable conditional compilation and optional dependencies. In offline mode, Cargo avoids network access and attempts to use cached data. It supports authentication options for registries and new subcommands without modifying Cargo itself. Rustup installs Cargo with the stable Rust release, and installation instructions cover Windows, macOS, Linux, and other Unix-like systems. Cargo is open source under the MIT and Apache License, Version 2.0. Some documented capabilities remain unstable and require a nightly toolchain and `-Z` flags.

Visit doc.rust-lang.org

Dart pub

Dart pub is Dart’s package manager for finding and managing shared libraries and tools. It resolves dependency versions compatible with one another and the installed Dart SDK, and records selected versions in a lockfile so application teams can keep dependency versions consistent. Packages may come from pub.dev, other hosted repositories, Git repositories, local paths, or supported SDKs. Developers can use pub through the dart or Flutter command-line tools, and most Dart-savvy IDEs support package workflows. The `dart pub publish` command uploads packages to pub.dev. Before publishing, pub checks for possible secret leaks using limited patterns and may warn or refuse publication; packages published to pub.dev cannot have Git or local path dependencies in their pubspec. Security advisories draw on the GitHub Advisory Database for Dart and Flutter packages. Pub can often resolve dependencies offline from its shared cache. It supports Windows, Linux, and macOS, and is free and open source.

Visit dart.dev