https://github.com/marvindrude/beskar.codegeneration
Lightweight, performance-oriented C# library designed to simplify the creation of Source Generators. Also home of some generators that I use for my private projects. No AI slop invovled.
https://github.com/marvindrude/beskar.codegeneration
csharp developer-tools dotnet high-performance source-generator
Last synced: 21 days ago
JSON representation
Lightweight, performance-oriented C# library designed to simplify the creation of Source Generators. Also home of some generators that I use for my private projects. No AI slop invovled.
- Host: GitHub
- URL: https://github.com/marvindrude/beskar.codegeneration
- Owner: MarvinDrude
- License: mit
- Created: 2026-03-27T21:56:40.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2026-04-25T12:12:25.000Z (2 months ago)
- Last Synced: 2026-04-25T14:15:06.972Z (2 months ago)
- Topics: csharp, developer-tools, dotnet, high-performance, source-generator
- Language: C#
- Homepage: https://marvindrude.com
- Size: 368 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Beskar.CodeGeneration
Moved to: https://github.com/MarvinDrude/Beskar.Memory
Beskar.CodeGeneration is a suite of tools designed to streamline the development of
**C# Source Generators** for **.NET 10** and beyond. Leveraging the latest C# language
features, it provides a robust infrastructure for symbol analysis, metadata extraction,
and type-safe code generation.
> **Note:** I use these mainly just for me and my private projects, but feel free to use them as well.
> Since I already build my generators with .NET 10, it will only work if your IDE supports it.
## Introduction
Developing Source Generators often involves repetitive tasks like manual attribute parsing,
navigating complex symbol trees, and managing diagnostic reporting. This project simplifies
that process by:
* **Archetype-Based Modeling**: Decouples heavy Roslyn `ISymbol` objects into lightweight, comparable "Archetypes"
that are safe for use within the incremental generator pipeline.
* **Fluent Metadata Access**: Provides high-level extension methods to easily extract
values from attributes, handle positional/named arguments, and resolve type information.
* **Modern .NET Standards**: Built from the ground up for .NET 10, utilizing features
like `INumber`, advanced spans, and the latest C# preview features.
## Project Modules
| Package | NuGet | Documentation | Description |
|:---------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------| :--- |:------------------------------------------------------------------------------------------------------------------|
| **Beskar.CodeGeneration.Extensions** | [](https://www.nuget.org/packages/Beskar.CodeGeneration.Extensions) | [README](./Beskar.CodeGeneration.Extensions/README.md) | Core utilities, symbol transformers, and attribute helpers. |
| **Beskar.CodeGeneration.TypeIdGenerator** | [](https://www.nuget.org/packages/Beskar.CodeGeneration.TypeIdGenerator) | [README](./Bundles/Beskar.CodeGeneration.TypeIdGenerator.Bundle/README.md) | A ready-to-use generator for creating type-safe identifiers (e.g., `UserId`). |
| **Beskar.CodeGeneration.LanguageGenerator** | [](https://www.nuget.org/packages/Beskar.CodeGeneration.LanguageGenerator) | [README](./Bundles/Beskar.CodeGeneration.LanguageGenerator.Bundle/README.md) | A ready-to-use generator that transforms simple enumerations into a robust, type-safe translation infrastructure. |
| **Beskar.CodeGeneration.ObserveGenerator** | [](https://www.nuget.org/packages/Beskar.CodeGeneration.ObserveGenerator) | [README](./Bundles/Beskar.CodeGeneration.ObserveGenerator.Bundle/README.md) | A ready-to-use generator that generates meters and activity sources - also simplifies registration. |
| **Beskar.CodeGeneration.PacketGenerator** | [](https://www.nuget.org/packages/Beskar.CodeGeneration.PacketGenerator) | [README](./Bundles/Beskar.CodeGeneration.PacketGenerator.Bundle/README.md) | A ready-to-use generator that generates fast packet routing with support of any serialization. |
| **Beskar.CodeGeneration.ProcessorGenerator** | [](https://www.nuget.org/packages/Beskar.CodeGeneration.ProcessorGenerator) | [README](./Bundles/Beskar.CodeGeneration.ProcessorGenerator.Bundle/README.md) | A ready-to-use generator that generates efficient, type-safe processing pipelines. |
| **Beskar.CodeGeneration.EnumGenerator** | [](https://www.nuget.org/packages/Beskar.CodeGeneration.EnumGenerator) | [README](./Bundles/Beskar.CodeGeneration.EnumGenerator.Bundle/README.md) | A ready-to-use generator that generates nice-to-have performance extensions to enums. |