An open API service indexing awesome lists of open source software.

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.

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** | [![NuGet](https://img.shields.io/nuget/v/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** | [![NuGet](https://img.shields.io/nuget/v/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** | [![NuGet](https://img.shields.io/nuget/v/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** | [![NuGet](https://img.shields.io/nuget/v/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** | [![NuGet](https://img.shields.io/nuget/v/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** | [![NuGet](https://img.shields.io/nuget/v/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** | [![NuGet](https://img.shields.io/nuget/v/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. |