# dtolnay/syn

Parser for Rust source code

Repository: https://github.com/dtolnay/syn
Canonical: https://ross.abutalabs.com/products/syn
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: proc-macro
Last push: 2026-08-26T03:15:20+00:00

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

## Adoption (not part of the score)
Stars 3415, forks 373 (observed 2026-08-28T04:08:03.695233+00:00)

## What it is
Syn is a Rust parsing library that converts a stream of Rust tokens into a syntax tree of Rust source code. It is primarily designed for use in Rust procedural macros, providing syntax tree data structures, parsing APIs, and span-based error reporting.

## Use cases
- parse rust source code into a syntax tree
- write a rust procedural macro
- build a custom derive macro
- generate compiler-style error messages with token spans
- parse custom DSL syntax in rust

## When to choose
- you are building Rust procedural macros (derive, attribute, or function-like)
- you need a full syntax tree representation of Rust code
- you want precise span information for error reporting in macros
- you need to parse custom token-stream syntaxes in Rust

## When to avoid
- you need to parse languages other than Rust
- you only need lightweight token manipulation without a syntax tree
- you want to format or pretty-print Rust code rather than parse it

## Facets
- artifact type: library
- maturity: stable
- function: parser, compiler, developer-tools
- domain: parsers, programming-languages, developer-tools
- platform: rust, cross-platform
- tags: proc-macro, syntax-tree, rust, token-parsing, derive-macros

## Member repositories
- dtolnay/syn (main) score 99

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:03.695233+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:38:28.397299+00:00, confidence not recorded.
  - readme: https://github.com/dtolnay/syn (fetched 2026-08-28T04:08:03.695233+00:00, sha 1af19e64eeab)
- Data as of 2026-08-30T08:39:29.467469+00:00.
