# Code generation tools

> AI-ranked search results for `compile time code generation` on awesome-repositories.com — ordered by an LLM for relevance, best match first. 110 total matches; showing the top 30.

Explore on the web: https://awesome-repositories.com/q/compile-time-code-generation

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [this search on awesome-repositories.com](https://awesome-repositories.com/q/compile-time-code-generation).**

## Results

- [dotnet/roslyn](https://awesome-repositories.com/repository/dotnet-roslyn.md) (20,241 ⭐) — The .NET Compiler Platform is a collection of open-source APIs for C# and Visual Basic that provides deep code analysis, refactoring, and automated source code generation. It serves as the core infrastructure for building development tools, offering a platform to inspect, modify, and understand source code through immutable syntax trees and semantic models.

The platform distinguishes itself by providing full-fidelity syntax trees that preserve every character of source code, including whitespace and comments, alongside an incremental compilation pipeline that enables near-instant feedback dur
- [hey-api/openapi-ts](https://awesome-repositories.com/repository/hey-api-openapi-ts.md) (4,128 ⭐) — openapi-ts is a tool and orchestrator used to convert OpenAPI specifications into type-safe TypeScript SDKs and HTTP client implementations. It automatically generates typed interfaces and request functions from API definitions to ensure consistency between the server and the client.

The project employs a transport-agnostic client interface, decoupling high-level API calls from the underlying network library. It uses a plugin-based generation pipeline and a custom plugin architecture to allow for the customization of output types and validation schemas.

The system provides capabilities for n
- [astahmer/openapi-zod-client](https://awesome-repositories.com/repository/astahmer-openapi-zod-client.md) (1,172 ⭐) — This project is a command-line tool that automates the creation of type-safe TypeScript HTTP clients directly from OpenAPI specifications. By transforming service definitions into structured source code, it ensures end-to-end type synchronization and enforces runtime data integrity across network boundaries.

The generator distinguishes itself by mapping OpenAPI data structures into Zod validation schemas, allowing for consistent schema-driven type mapping and response validation. It supports deduplicated source synthesis to minimize redundancy in the generated output and provides template cus
- [apple/swift-openapi-generator](https://awesome-repositories.com/repository/apple-swift-openapi-generator.md) (1,935 ⭐) — The Swift OpenAPI Generator is a build-time tool that produces type-safe Swift client and server code directly from OpenAPI specification documents. By integrating with build systems through native plugins, it automates the creation of strongly-typed interfaces and protocol stubs that map network operations to native methods, ensuring that application code remains strictly consistent with defined data schemas.

The project distinguishes itself through a protocol-oriented architecture that decouples business logic from specific transport implementations. It utilizes a pluggable transport layer
- [sqlc-dev/sqlc](https://awesome-repositories.com/repository/sqlc-dev-sqlc.md) (17,882 ⭐) — sqlc is a code generation tool that compiles raw SQL queries into type-safe application code. By analyzing SQL statements against database schema definitions during the build process, it eliminates the need for manual data mapping and prevents runtime type errors.

The project functions as a schema-aware generator that translates database column types into native language primitives. It distinguishes itself through a modular, plugin-based architecture that allows for the extension of the generation pipeline to support diverse programming languages and custom frameworks beyond its default capab
- [nim-lang/nim](https://awesome-repositories.com/repository/nim-lang-nim.md) (18,071 ⭐) — Nim is a statically typed, compiled systems programming language designed for high performance and cross-platform development. It translates high-level source code into C, C++, or JavaScript, allowing developers to produce efficient native binaries or web-compatible scripts from a single codebase. The language emphasizes a clean, indentation-based syntax that simplifies code hierarchy while maintaining the power of a full-featured systems language.

What distinguishes Nim is its robust metaprogramming framework, which allows developers to inspect, modify, and generate code structures during th
- [twitchtv/twirp](https://awesome-repositories.com/repository/twitchtv-twirp.md) (7,517 ⭐) — Twirp is a Protocol Buffers RPC framework designed for implementing type-safe, distributed microservices communication over HTTP. It functions as a microservices communication framework and API code generator that produces strongly typed client stubs and server interfaces from schema definitions to eliminate manual network boilerplate.

The framework ensures compatibility with existing web infrastructure by executing remote procedure calls over standard HTTP transport. It uses schema-driven contracts as a single source of truth to enable cross-language interoperability and decouple business lo
- [dotansimha/graphql-code-generator](https://awesome-repositories.com/repository/dotansimha-graphql-code-generator.md) (11,257 ⭐) — This project is a type-safe GraphQL client generator and TypeScript schema compiler. It transforms GraphQL schema definitions and operation documents into static TypeScript types to ensure compile-time validation and data consistency between an API and a frontend application.

The system functions as a customizable GraphQL plugin framework. It uses a plugin-based architecture and a custom pipeline to generate tailored API clients and request functions, eliminating the need for manual type declarations.

The project covers GraphQL client automation, type generation, and workflow optimization. I
- [fzyzcjy/flutter_rust_bridge](https://awesome-repositories.com/repository/fzyzcjy-flutter-rust-bridge.md) (5,106 ⭐) — flutter_rust_bridge is a code generation tool that automatically creates type‑safe Dart bindings for Rust functions, enabling direct cross‑language calls between Flutter and a Rust backend. It provides an async FFI adapter that transforms synchronous Rust functions into Dart async methods with background thread management, a cross‑language object manager that wraps persistent Rust structs as Dart objects preserving state across calls, and trait object interop that converts Rust traits into Dart abstract classes for seamless bidirectional use.

The project handles the full lifecycle of integrat
- [dtolnay/thiserror](https://awesome-repositories.com/repository/dtolnay-thiserror.md) (5,459 ⭐) — thiserror is a Rust error handling library and procedural macro designed to define custom error types. It functions as a trait implementation automator that generates the necessary code for standard library error traits at compile time.

The library focuses on eliminating boilerplate by using derive macros to automatically implement display and source methods. It allows for the creation of custom error structs and enums that can map low-level errors to high-level variants while preserving the original cause and backtrace information.

Its capabilities cover custom error formatting through temp
- [ajv-validator/ajv](https://awesome-repositories.com/repository/ajv-validator-ajv.md) (14,733 ⭐) — Ajv is a high-performance data validation framework that compiles JSON schemas into optimized, standalone JavaScript functions. By transforming declarative schema definitions into executable code, it eliminates runtime interpretation overhead and provides a secure, efficient way to enforce data integrity across both browser and server environments.

The library distinguishes itself through its focus on performance and type safety. It employs advanced compilation techniques, including abstract syntax tree optimization and function caching, to ensure rapid validation. Beyond standard checks, it
- [elixir-lang/elixir](https://awesome-repositories.com/repository/elixir-lang-elixir.md) (26,543 ⭐) — Elixir is a functional, concurrent programming language designed for building scalable and maintainable applications. It operates on the Erlang virtual machine, leveraging a distributed, fault-tolerant runtime environment that manages lightweight processes to ensure system reliability. By utilizing an actor-model supervision strategy, the language enables the creation of high-concurrency backend systems that automatically recover from failures and maintain stability under heavy loads.

The language distinguishes itself through a powerful metaprogramming environment that allows developers to ex
- [ziglang/zig](https://awesome-repositories.com/repository/ziglang-zig.md) (43,123 ⭐) — Zig is a general-purpose systems programming language designed for high-performance applications that require manual memory management and direct control over hardware resources. It prioritizes predictable execution by enforcing explicit control flow and requiring functions to accept explicit memory allocators, ensuring that all heap operations and logic paths remain visible to the developer.

The language distinguishes itself through a powerful compile-time metaprogramming engine that allows for arbitrary code execution during the build process, enabling advanced reflection and the generation
- [dtolnay/cxx](https://awesome-repositories.com/repository/dtolnay-cxx.md) (6,664 ⭐) — CXX is a code generator that produces a safe, zero-overhead FFI bridge between Rust and C++. It lets functions and data types from either language be used directly in the other, with static type safety enforced at compile time and no copying, serialization, or runtime checks across the boundary.

The bridge supports the full range of cross-language interactions: Rust can call C++ functions and use C++ types, and C++ can call Rust functions and use Rust types. Standard library types like strings, vectors, and smart pointers are mapped automatically between the two languages, while opaque types
- [hanickadot/compile-time-regular-expressions](https://awesome-repositories.com/repository/hanickadot-compile-time-regular-expressions.md) (3,814 ⭐) — This library is a header-only C++ framework that performs regular expression evaluation and static string analysis during the compilation phase. By leveraging template metaprogramming and constant expression evaluation, it transforms pattern matching logic into static state machines, effectively shifting the cost of parsing and validation from runtime to build time.

The project distinguishes itself by encoding text data directly into the type system, allowing for the validation and extraction of string content before a program ever executes. This approach ensures that regular expression patte
- [square/moshi](https://awesome-repositories.com/repository/square-moshi.md) (10,138 ⭐) — Moshi is a JSON serialization library and parser for Kotlin and Java. It functions as a reflectionless JSON encoder that converts typed objects to JSON strings and parses JSON data back into language objects.

The library distinguishes itself through compile-time adapter generation, which removes the performance overhead associated with runtime reflection. It also provides a polymorphic JSON mapper that uses type identifiers to resolve and instantiate specific subclasses of a common base type.

The framework supports custom adapter definitions for specialized type conversion, including nullabi
- [orval-labs/orval](https://awesome-repositories.com/repository/orval-labs-orval.md) (6,145 ⭐) — Orval is an OpenAPI-to-TypeScript code generator that produces fully typed API clients, data-fetching hooks, mock data, validation schemas, and server handlers from OpenAPI or Swagger specifications. It reads any YAML or JSON API specification and generates TypeScript interfaces, HTTP request functions, and framework-specific integration code that ensures compile-time correctness for all API calls.

The project distinguishes itself by generating production-ready data-fetching hooks for React Query, Vue Query, Svelte Query, Solid Query, Angular, and SWR, complete with automatic cache invalidati
- [ent/ent](https://awesome-repositories.com/repository/ent-ent.md) (17,110 ⭐) — Ent is a statically typed entity framework for Go that models database structures as a graph of nodes and edges. It functions as a code generation engine that transforms schema definitions into type-safe database clients, query builders, and migration scripts. By representing data as interconnected entities, the framework enables intuitive traversal of complex relationships and ensures that database interactions remain consistent with the application model at compile time.

The framework distinguishes itself through its graph-based approach to data modeling and its reliance on compile-time cod
- [a-h/templ](https://awesome-repositories.com/repository/a-h-templ.md) (10,358 ⭐) — Templ is a type-safe HTML templating engine and UI framework for Go. It provides a system for building reusable HTML components that compile into Go code for server-side rendering, ensuring type safety and compile-time validation of data and logic.

The project features a dedicated language server that provides autocomplete and syntax validation for template files within supported code editors. It employs compile-time code generation to transform a custom template language into Go source code, enabling the creation of modular HTML fragments and logic blocks.

The framework includes automated s
- [koxudaxi/datamodel-code-generator](https://awesome-repositories.com/repository/koxudaxi-datamodel-code-generator.md) (3,943 ⭐) — This project is a command-line schema-to-code converter designed to transform diverse data specifications into type-safe Python data structures. It functions as a generator for Pydantic models, dataclasses, and typed dictionaries, enabling developers to maintain synchronization between evolving data contracts and application code. By parsing formats such as JSON Schema, OpenAPI, AsyncAPI, Protobuf, and Avro, the tool automates the creation of native classes that reflect the constraints and metadata defined in the source specifications.

The generator distinguishes itself through a highly confi
- [openapitools/openapi-generator](https://awesome-repositories.com/repository/openapitools-openapi-generator.md) (26,412 ⭐) — This project is a command-line tool and template-based scaffolding engine that transforms API interface specifications into functional client libraries and server stubs. By automating the creation of type-safe SDKs and boilerplate code, it bridges the gap between service definitions and implementation, allowing developers to maintain synchronized codebases across many programming languages.

The tool distinguishes itself through a portable execution model that utilizes containerized build isolation to ensure identical output regardless of the host environment. It features a modular, plugin-bas
- [serde-rs/serde](https://awesome-repositories.com/repository/serde-rs-serde.md) (10,457 ⭐) — This project is a framework for the efficient serialization and deserialization of data structures. It provides a unified, macro-based interface that automates the conversion of complex internal objects into standardized formats and reconstructs them from raw input streams or buffers. By leveraging compile-time code generation, the library minimizes manual implementation overhead while ensuring consistent logic across diverse data types.

The framework distinguishes itself through a format-agnostic data model and a visitor-based parsing architecture that decouples data structures from specific
- [messagepack-csharp/messagepack-csharp](https://awesome-repositories.com/repository/messagepack-csharp-messagepack-csharp.md) (6,607 ⭐) — MessagePack-CSharp is a high-performance binary serializer for .NET that converts C# objects to and from the compact MessagePack format. It uses compile-time source generation to produce AOT-safe formatters and resolvers, eliminating runtime reflection and enabling ahead-of-time compilation scenarios. The serializer encodes object fields as integer indices instead of string keys, producing compact binary output with deterministic field ordering, and provides stack-allocated reader and writer structs for direct encoding and decoding of MessagePack primitives without heap allocations.

The libra
- [apollographql/apollo-kotlin](https://awesome-repositories.com/repository/apollographql-apollo-kotlin.md) (3,955 ⭐) — Apollo Kotlin is a strongly-typed GraphQL client and code generation library designed for Kotlin and JVM applications. It functions as a comprehensive development tool that transforms GraphQL schema definitions and query documents into type-safe models during the build process, ensuring that data access errors are identified at compile time rather than at runtime.

The project distinguishes itself through its multiplatform runtime abstraction, which allows developers to share data fetching and caching logic across Android, iOS, and desktop environments. It provides a normalized local caching s
- [protobufjs/protobuf.js](https://awesome-repositories.com/repository/protobufjs-protobuf-js.md) (10,558 ⭐) — protobuf.js is a JavaScript and TypeScript library for encoding and decoding structured data using the Protocol Buffers binary format. It functions as a dynamic parser that can load and process schemas at runtime, a JSON transcoder for converting messages to human-readable formats, and a framework for building transport-agnostic remote procedure call clients.

The project distinguishes itself by offering both dynamic message handling and a static code generator that produces TypeScript declarations and JavaScript modules to reduce runtime overhead. It also provides a reflection API for definin
- [rrousselgit/riverpod](https://awesome-repositories.com/repository/rrousselgit-riverpod.md) (7,315 ⭐) — Riverpod is a reactive state management framework for Dart that manages application state through providers which automatically track dependencies and rebuild dependents when values change. It functions as an asynchronous data caching library, caching results of async operations and exposing loading, error, and data states to widgets without manual future handling. The framework includes a provider composition system that combines multiple providers into derived values that recompute automatically when any dependency changes, along with code generation for state providers that reduces boilerpl
- [samchon/typia](https://awesome-repositories.com/repository/samchon-typia.md) (5,837 ⭐) — Typia is a compile-time code generator that transforms TypeScript type annotations into runtime validation, serialization, and schema functions without requiring decorators or separate schema files. It generates optimized validation and serialization code during TypeScript compilation, producing dedicated functions for each type that eliminate runtime schema objects for faster execution.

The project extends this core capability into several integrated areas. It generates fully typed client SDKs from NestJS controller source code, keeping server and client types synchronized automatically. It
- [quarkusio/quarkus](https://awesome-repositories.com/repository/quarkusio-quarkus.md) (15,479 ⭐) — Quarkus is a Kubernetes-native Java framework designed for building high-performance, memory-efficient applications. It utilizes ahead-of-time native compilation to transform Java code into standalone, optimized binaries that eliminate the need for a virtual machine, enabling rapid startup and reduced memory consumption. By performing code augmentation during the build phase, it shifts heavy processing tasks away from runtime, ensuring that applications are optimized for cloud-native environments.

The framework distinguishes itself through a unified approach to reactive and imperative program
- [idanarye/rust-typed-builder](https://awesome-repositories.com/repository/idanarye-rust-typed-builder.md) (1,173 ⭐) — This library provides a procedural macro utility for Rust that automates the implementation of type-safe builder patterns. By leveraging the compiler to enforce structural integrity, it ensures that all mandatory fields are initialized and that objects are constructed in a valid state before the program executes.

The project distinguishes itself by using typestate-based tracking and marker types to encode the initialization progress of an object directly into the type system. This approach allows for a zero-cost abstraction layer where all validation logic and state checks are resolved during
- [apache/groovy](https://awesome-repositories.com/repository/apache-groovy.md) (5,446 ⭐) — Groovy is a JVM programming language and metaprogramming framework that provides a Java compatible environment for building applications. It functions as a dynamic scripting language and a tool for authoring domain-specific languages, allowing for the execution of custom scripts and the creation of specialized mini-languages with concise syntax.

The project is distinguished by its ability to modify program behavior and class definitions through both compile-time and runtime metaprogramming. It utilizes a hybrid typing model that combines dynamic method resolution with optional static type che
