# swiftlang/swift-syntax

A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.

Repository: https://github.com/swiftlang/swift-syntax
Canonical: https://ross.abutalabs.com/products/swift-syntax
Language: Swift
License: Apache-2.0
License Family: permissive
Last push: 2026-08-25T22:25:39+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 75, longevity 100
- inputs: {"age_days": 2955, "days_push": 8, "days_rel": 86, "gap_med": 47, "n_releases_24m": 8}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3693, forks 542 (observed 2026-08-28T04:08:14.828779+00:00)

## What it is
A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code via a source-accurate syntax tree (SwiftSyntax). It is the backbone of Swift's macro system, letting macros generate SwiftSyntax trees inserted into source files.

## Use cases
- parse Swift source code into a syntax tree
- build Swift macros
- generate Swift source code programmatically
- write linters or refactoring tools for Swift
- transform or rewrite Swift source files
- analyze Swift AST for tooling

## When to choose
- building Swift macros or compiler-adjacent tooling
- writing code generators, linters, or formatters for Swift
- you need a source-accurate, lossless representation of Swift code

## When to avoid
- parsing languages other than Swift
- you only need lightweight regex-based text manipulation of Swift files
- you need a stable API surface across major versions without migration effort

## Facets
- artifact type: library
- maturity: stable
- function: parser, compiler, developer-tools, code-review
- domain: programming-languages, parsers, developer-tools, compilers
- platform: cross-platform
- tags: swift-syntax, ast, source-code-analysis, macros, swiftmacro, code-generation, syntax-tree, swift, macos, linux

## Member repositories
- swiftlang/swift-syntax (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:14.828779+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:31:06.792181+00:00, confidence not recorded.
  - readme: https://github.com/swiftlang/swift-syntax (fetched 2026-08-28T04:08:14.828779+00:00, sha 590f59eb60fb)
- Data as of 2026-08-30T08:39:29.467469+00:00.
