alecthomas/participle

A parser library for Go

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 1 hour ago
Added to GitGenius on September 17th, 2026
Created on June 28th, 2016
Open Issues & Pull Requests: 47 (+0)
GitHub issues: Enabled
Number of forks: 216
Total Stargazers: 3,887 (+0)
Total Subscribers: 46 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 16.5 hours
Mean response time: 136.9 days
90th percentile: 165.1 days
Tracked items: 33

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 25
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,638 days
Stale 30+ days: 23
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • proposal (3)
  • bug (2)
  • enhancement (2)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Participle is a parser library for Go that enables developers to define grammars using annotated struct field tags, similar to how the encoding/json package works.

The library solves the problem of building parsers by allowing grammar definitions to be embedded directly in Go struct definitions through tags. Rather than writing separate grammar files or using a domain-specific language, developers annotate struct fields with grammar rules that specify how input should be parsed and mapped to those fields. The parser then uses these annotations to both define the grammar and generate an abstract syntax tree as output. The approach supports both a simple tag syntax using the entire struct tag content and a named tag format using parser:"" that coexists better with other tags like JSON annotations.

Participle suits projects where you need to parse domain-specific languages, configuration files, or custom text formats without the overhead of external grammar tools. It works well for developers already comfortable with Go's tagging conventions and who want parsing logic tightly integrated with their AST definitions. The library includes support for custom parsing logic, stateful lexing, union types, and error reporting. A tutorial walking through creation of an INI parser is available to help new users get started.

The project shows consistent maintenance with regular updates addressing issues and improvements. Development activity includes ongoing refinement of the parser implementation and lexer functionality. The codebase demonstrates attention to both core parsing features and developer experience through documentation and examples. The project maintains backward compatibility considerations while evolving the library through versioned releases.