# hirrolot/datatype99

Algebraic data types for C99

Repository: https://github.com/hirrolot/datatype99
Canonical: https://ross.abutalabs.com/products/datatype99
Language: C
License: MIT
License Family: permissive
Topics: type-system, algebraic-data-types, c99, sum-types, reflection-library, introspection, variant, adt, algebraic, tagged-unions, pattern-matching, metaprogramming, derive, metalang99
Last push: 2025-03-17T03:16:52+00:00

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

## Adoption (not part of the score)
Stars 1508, forks 28 (observed 2026-08-28T04:04:55.568468+00:00)

## What it is
A single-header C99 library providing safe algebraic data types (sum types/tagged unions) with exhaustive pattern matching and compile-time introspection, built on the Metalang99 macro metaprogramming library. It requires no external tools and generates predictable data layouts with compile-time type safety.

## Use cases
- define sum types in pure C99
- get exhaustive pattern matching in C
- replace error-prone hand-written tagged unions
- derive serialization for C data types
- model ASTs or binary trees in C
- write type-safe variant types without external code generators

## When to choose
- you are writing portable standard C99 and want ADTs with compile-time safety
- you want a header-only solution with no external tooling
- you need guaranteed, documented data layout for generated types
- you are building parsers, interpreters, or protocol implementations in C

## When to avoid
- your compiler lacks a conforming C99 preprocessor or chokes on heavy macro expansion
- you want runtime reflection or garbage-collected language ergonomics
- your team avoids preprocessor metaprogramming due to compile-time cost or error readability

## Facets
- artifact type: library
- maturity: stable
- function: type-system, parser
- domain: programming-languages, developer-tools
- platform: c, cross-platform
- tags: algebraic-data-types, sum-types, tagged-unions, pattern-matching, metaprogramming, c99, header-only, variant

## Member repositories
- hirrolot/datatype99 (main) score 28

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:55.568468+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-30T04:32:33.000563+00:00, confidence not recorded.
  - readme: https://github.com/hirrolot/datatype99 (fetched 2026-08-28T04:04:55.568468+00:00, sha a0f26dc6f957)
- Data as of 2026-08-30T08:39:29.467469+00:00.
