# Sergio0694/PolySharp

PolySharp provides generated, source-only polyfills for C# language features, to easily use all runtime-agnostic features downlevel. Add a reference, set your C# version to latest and have fun! 🚀

Repository: https://github.com/Sergio0694/PolySharp
Canonical: https://ross.abutalabs.com/products/polysharp
Language: C#
License: MIT
License Family: permissive
Topics: csharp, dotnet, dotnet-core, dotnet-framework, dotnet-standard, roslyn, roslyn-analyzer, roslyn-generator
Last push: 2026-05-25T23:24:22+00:00

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

## Adoption (not part of the score)
Stars 2222, forks 72 (observed 2026-08-28T04:06:27.681831+00:00)

## What it is
PolySharp is a Roslyn source generator that emits source-only polyfill types (nullability attributes, Index/Range, records support types, etc.) so newer C# language features can be used on older .NET runtimes like .NET Framework or UWP. You add the NuGet reference, set the language version to latest, and the generator automatically supplies the compiler-required 'magic types' for your target framework.

## Use cases
- use latest C# language features on .NET Framework
- enable nullable reference type attributes in old projects
- use records and pattern matching on UWP or .NET Standard 2.0
- avoid upgrading runtime just to use new compiler features
- polyfill compiler-required types via source generator

## When to choose
- you're stuck on an older .NET runtime but want modern C# syntax
- you maintain libraries targeting .NET Standard 2.0 or .NET Framework
- you want zero-runtime-dependency, source-only polyfills

## When to avoid
- you already target the latest .NET runtime with all BCL APIs
- you need features requiring runtime support like static abstract interface members
- you're on .NET Framework 3.5 where many polyfills are limited

## Facets
- artifact type: library
- maturity: active
- function: compiler, developer-tools, plugin-system
- domain: developer-tools, programming-languages, compilers
- platform: dotnet, cross-platform
- tags: csharp, roslyn-source-generator, polyfills, nuget-package, language-features, downlevel

## Member repositories
- Sergio0694/PolySharp (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:27.681831+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-30T02:45:45.139797+00:00, confidence not recorded.
  - readme: https://github.com/Sergio0694/PolySharp (fetched 2026-08-28T04:06:27.681831+00:00, sha f75a2c0a81ed)
- Data as of 2026-08-30T08:39:29.467469+00:00.
