GitHub - sebastienros/comptime: Comptime brings meta-programming capabilities to C#, enabling compile-time code generation and evaluation.
github.com·14h·
Discuss: Hacker News
🤖AI Codegen
Preview
Report Post

Comptime

A .NET source generator that executes methods at compile time and serializes their results to C# code. Comptime brings meta-programming capabilities to C#, enabling compile-time code generation and evaluation.

Overview

Comptime allows you to mark methods with the [Comptime] attribute to have them executed during compilation. The return values are serialized into C# source code and used at runtime, eliminating the need for runtime computation of values that can be determined at build time.

This meta-programming approach enables developers to shift expensive computations from runtime to compile time, resulting in faster application startup and execution.

Features

  • Compile-time execution: Methods marked with [Comptime] are executed during compilation …

Similar Posts

Loading similar posts...