D2

1 program Added 2026-03-06T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: d2lang
Provenance: commit 5253801e8f · authored 2026-03-06T01:16:14+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

3 sources · pl_id: pl/d2
LLM (this repo) · 1PldbLinguist

Extensions claimed by this language

1 claim. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.d2linguistprimary4.3K files

Related languages

D (0.36)Slang (0.31)Dark (0.29)Dart (0.29)Fetlang (0.27)

LLM-contributed programs

Software Architecture Diagram

Provenance: commit 5253801e8f · authored 2026-03-06T01:16:14+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.d2 · added: 2026-03-06T10:00:00Z
# Simple software architecture diagram

frontend: Frontend {
  shape: rectangle
}

backend: Backend API {
  shape: rectangle
}

database: PostgreSQL {
  shape: cylinder
}

frontend -> backend: HTTP/REST
backend -> database: SQL queries

Real programs from Software Heritage

1 sample mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
implementation-components.d2 · 2510 B · ext .d2 · seen 2× in SWH
via unique-primary
swh:1:cnt:e82e05751feab344a7be7a71de6b6be49ddd6f5a;origin=https://github.com/Adhalianna/wit;anchor=swh:1:rev:db89a716a47785862b9324c2311b940e3027d6c5;path=/docs/paper/img/implementation-components.d2
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
vars:{
  d2-config: {
    layout-engine: elk
  }
}

classes: {
  container: {
    icon.near: top-center
    label.near: outside-top-left
    style.stroke-width: 1
  }
  icon: {
    label.near: outside-top-left
    style.bold: false
    style.stroke-width: 1
  }
  libgit2: {
    style.stroke: orangered
    style.fill: papayawhip
    icon: https://icons.terrastruct.com/dev%2Fgit.svg
  }
  rust: {
    style.stroke: black
    style.fill: whitesmoke
    icon: https://icons.terrastruct.com/dev%2Frust.svg
  }
  git2: {
    style.stroke: black
    style.fill: whitesmoke
    icon: https://icons.terrastruct.com/dev%2Frust.svg
  }
  git-odb: {
    style.stroke: orangered
    style.fill: peachpuff
    icon: https://icons.terrastruct.com/essentials%2F117-database.svg
  }
  kademlia: {
    style.fill: thistle
    style.stroke: orchid
  }
  files: {
    style.stroke: darkkhaki
    style.fill: beige
    icon: https://icons.terrastruct.com/essentials%2F257-file.svg
  }
  tier: {
    style.italic: true
    style.bold: false
    style.stroke-width: 1
    label.near: outside-top-center
    grid-rows: 1
    vertical-gap: 15
    horizontal-gap: 20
  }
  stack: {
    horizontal-gap: 25
    vertical-gap: 15
    style.bold: true
    style.stroke-width: 2
  }
}

Server: {
  grid-rows: 3
  class: [stack]
  label: ""

  presentation: - Presentation - {
    class: [container; tier]
    
    Client: CLI Client {
      grid-columns: 1
      class: stack

      clap: {
        class: [rust; icon]
      }

      git2: {
        class: [git2; container]
        libgit2: {
          class: [libgit2; icon]
        }
      }
    }

    browser: Web Browser {
      class: [icon]
      icon: https://icons.terrastruct.com/dev%2Ffirefox.svg
    }
  }

  logic: - Business Logic - {
    class: [container; tier]

    axum: {
      class: [rust; container]

      tower-cgi: {
        class: [rust; container]
        git-http-backend: {
          class: [libgit2; icon]
        }
      }
      markdown-it: {
        class: [rust; icon]
      }
    }

    libp2p: {
      class: [rust; container]
      kademlia: Kademlia DHT {
        class: [kademlia]
      }
    }
  }

  storage: - Data - {
    class: [container; tier]
    git2: {
      class: [git2; container]
      libgit2: {
        class: [libgit2; container]
        git-odb: git ODB {
          class: [git-odb; icon]
        }
      }
    }

    redb: {
      class: [rust; container]

      dbfile: DB File {
        class: [files; icon]
      }
    }
  }
}

Contribute — propose a file extension

Tell us where to find evidence about D2 (mapped to pl/d2). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/D2/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← D1ffe7e45e d3 →