For compile time execution, the strongest matches are sweet-js/sweet-core (This is a macro system that enables compile-time code), nim-lang/nim (Nim is a systems programming language with a powerful) and ziglang/zig (Zig features a robust compile-time execution engine that allows). gvergnaud/hotscript and ericniebler/range-v3 round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
Explore the best compile-time execution libraries. Compare top-rated tools by activity and features to find the best fit for your project.
Sweet-core is a JavaScript source-to-source compiler and Lisp-style macro system. It functions as a syntax transformer that extends JavaScript by allowing the definition of custom syntax and operators during the compilation process. The system provides a framework for building domain-specific languages through hygienic, recursive macro expansion and the creation of new language constructs. It distinguishes itself by supporting custom operator definitions with configurable associativity and precedence to control expression evaluation. The compiler includes a specialized module system for mana
This is a macro system that enables compile-time code transformation and the creation of custom language constructs in JavaScript, fitting the requirements for compile-time metaprogramming.
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
Nim is a systems programming language with a powerful, built-in macro system and compile-time evaluation capabilities that allow for extensive code generation and type-level manipulation during the compilation phase.
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
Zig features a robust compile-time execution engine that allows you to run arbitrary code during compilation, supporting complex tasks like type-level programming, build-time code generation, and generic template instantiation.
Hotscript is a comprehensive suite of composable utilities designed for performing structural transformations and mathematical operations within the TypeScript type system. It serves as a type-level manipulation library that provides a set of higher-order functions to map, filter, and reduce the structure of type definitions. The project focuses on type-level programming by implementing reusable logic and calculations directly within types. This includes the ability to create custom type functions, implement type-level pattern matching, and compose sequences of transformations where each oper
Hotscript is a library for type-level programming in TypeScript that enables complex structural transformations and logic evaluation during the type-checking phase, fitting the core requirements of compile-time metaprogramming.
This is a C++ ranges library and extension to the Standard Template Library that provides a collection of composable algorithms and lazy views for processing data sequences. It functions as a lazy sequence processing framework and a template meta-programming library for manipulating type lists and performing compile-time type computations. The project enables functional programming patterns in C++ through the use of pipe syntax and partial application to create readable, left-to-right data transformation chains. It allows for the construction of lazy data pipelines that filter and transform e
This library provides a robust suite of template metaprogramming tools and type-level computation utilities that enable complex compile-time logic and type manipulation in C++.
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
This library provides a procedural macro system that performs compile-time code generation to automate the implementation of error-related traits, fitting the category of compile-time metaprogramming tools.
Wire is a compile-time dependency injection framework for Go that generates code to wire application components together. It analyzes function signatures at compile time to build an explicit initialization graph, removing the need for runtime reflection or manual wiring code. The framework operates as a Go code generator and static analysis tool, transforming annotated source code into generated wire files that compile alongside the original project. It connects dependencies by matching function parameters and return types, producing a directed acyclic graph of component dependencies that is
Wire is a compile-time code generation tool that performs static analysis to resolve dependencies, fitting the category by automating component wiring during the build process rather than at runtime.
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
Elixir provides a robust macro system and compile-time code generation capabilities that allow developers to extend the language and perform complex transformations during the compilation phase.
cppfront is a C++ language extension frontend and source-to-source translator. It functions as a syntax transformer that converts experimental language extensions into standard compliant C++ code, allowing for the prototyping of new language features within existing build systems. The project provides a translation layer that adds support for pattern matching, contracts, and string interpolation. It includes a metaprogramming tool for compile-time reflection and automated code generation using specialized metafunctions. The system automates several development tasks, including the resolution
This project provides a source-to-source translation layer that specifically includes compile-time reflection and metafunctions for automated code generation, fitting the requirements for compile-time metaprogramming.
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
This library provides a specialized framework for compile-time regular expression evaluation and static string analysis using template metaprogramming and constant expressions, directly addressing the need for code execution during the compilation phase.
TypeScript is a language that extends standard syntax by adding a static type system. It identifies potential runtime errors by analyzing the behaviors and capabilities of values during the compilation process. The language supports object-oriented structures, including classes with inheritance and member visibility control, as well as flexible function definitions that utilize generics, overloads, and parameter destructuring. The project provides a compiler that manages the build lifecycle through a command-line interface, offering configurable options for module resolution, code generation,
TypeScript provides a powerful type system that supports advanced compile-time features like conditional types and recursive type-level programming, which function as a form of metaprogramming during the type-checking phase.
type-fest is a library of reusable utility types for performing complex transformations and validations on objects, arrays, strings, and numeric ranges in TypeScript. It provides a collection of type definitions designed to handle advanced structural changes and constraints. The project distinguishes itself by offering specialized logic for string literal processing, such as casing transformations and pattern-based modifications, and type-level arithmetic for calculating numeric ranges and absolute values. It also includes utilities for enforcing deep immutability, ensuring union mutual exclu
This library provides a comprehensive suite of type-level programming utilities for TypeScript, enabling complex transformations and logic evaluation during the type-checking phase of compilation.
Julia is a high-performance, dynamic programming language designed for scientific computing, data analysis, and complex mathematical modeling. It provides a specialized runtime environment that manages memory allocation and parallel processing, utilizing a just-in-time compiler to translate high-level source code into optimized machine instructions. This architecture allows the language to achieve execution speeds comparable to statically compiled languages while maintaining the flexibility of a dynamic scripting environment. The language is distinguished by its multiple dispatch system, whic
Julia provides a powerful macro system and extensive support for type-level programming and code generation, making it a robust environment for compile-time metaprogramming despite being a general-purpose language.
Carp is a statically typed Lisp compiler that compiles Lisp-like syntax directly to C source code, enabling seamless integration with existing C libraries and low-level system programming. It manages memory deterministically at compile time using ownership tracking and linear types, eliminating garbage collection pauses and runtime overhead while ensuring type safety through an inferred static type system. The language distinguishes itself through compile-time macro expansion and metaprogramming capabilities, allowing code generation and transformation before final binary output. It enforces
Carp is a statically typed Lisp that provides a robust macro system and compile-time code transformation capabilities, fitting the category of a language designed with built-in metaprogramming features.
Scala 3 is an open-source, statically typed programming language that compiles to JVM bytecode, combining object-oriented and functional programming paradigms. Its core identity is defined by a sophisticated type system that includes traits, generics, union types, and a dependent object type system where types can depend on runtime values through path-dependent and singleton types. The language distinguishes itself through several advanced type-level and metaprogramming capabilities. It features a contextual abstraction mechanism using given instances and using clauses for compile-time implic
Scala 3 provides a powerful metaprogramming framework through its inline, macro, and type-level programming capabilities, allowing for extensive code evaluation and generation during the compilation phase.
Crystal is a statically typed, compiled programming language designed for high performance and memory safety. It leverages an LLVM-based compiler to translate source code into optimized machine-executable binaries, while its type-inference-based static analysis enforces strict safety rules during the build process. The language distinguishes itself through a fiber-based concurrent runtime that manages lightweight execution units for asynchronous input and output without blocking the main process. It also features a powerful compile-time macro system that allows for the inspection and transfor
Crystal is a statically typed programming language that features a robust compile-time macro system, enabling developers to inspect and transform code during the compilation phase to achieve metaprogramming goals.
Boost is a collection of portable, high-performance source libraries that extend the C++ standard library. It provides a wide range of reusable components, data structures, and algorithms designed to add capabilities to the base language across different platforms. The project is distinguished by its extensive focus on compile-time template metaprogramming and generic programming. It implements advanced architectural patterns such as policy-based design, concept-based type validation, and the use of SFINAE for conditional template resolution to minimize runtime overhead. The library covers a
Boost is a comprehensive collection of C++ libraries that serves as a foundational framework for compile-time metaprogramming, offering extensive support for template metaprogramming, type-level programming, and advanced compile-time logic.
c3c is the compiler for the C3 programming language, transforming source code into executable binaries, static libraries, or dynamic libraries using an LLVM backend. It implements a system based on result-based error handling, scoped memory pooling, and a semantic macro system. The compiler provides first-class support for hardware-backed SIMD vectors that map directly to processor instructions and enables runtime polymorphism through interface-based dynamic dispatch. The project covers a broad set of low-level capabilities, including manual and pooled memory management, inline assembly inte
C3 is a programming language that includes a built-in semantic macro system and build-time variable injection, providing the necessary infrastructure for compile-time code evaluation and generation.
Your standard library for metaprogramming
Boost.Hana is a C++ library specifically designed for heterogeneous computing and type-level programming, providing the core capabilities for compile-time metaprogramming and constexpr evaluation required for this category.
C++11 metaprogramming library
This library provides a comprehensive suite of tools for C++ template metaprogramming and type-level computation, directly enabling complex logic to be evaluated during the compilation phase.
Babel Plugin Macros is a framework for building compile-time code transformations that modify JavaScript and TypeScript source files during the build process. It enables developers to automate repetitive code generation tasks and execute custom logic without the overhead of writing and maintaining full-scale, complex compiler plugins. The project distinguishes itself by using import-based discovery to trigger transformation modules, allowing developers to invoke specific logic directly through standard module imports. It provides a structured environment for managing macro execution sequences
This tool provides a macro system for JavaScript that enables code transformation and generation during the build process, fitting the requirements for compile-time metaprogramming in the JS ecosystem.
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
Groovy provides robust compile-time metaprogramming through its Abstract Syntax Tree (AST) transformation system, allowing you to modify code and inject logic during the compilation phase.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| sweet-js/sweet-core | 4.6K | JavaScript | BSD-2-Clause | |
| nim-lang/nim | 18.1K | Nim | NOASSERTION | |
| ziglang/zig | 43.1K | Zig | MIT | |
| gvergnaud/hotscript | 3.7K | TypeScript | MIT | |
| ericniebler/range-v3 | 4.4K | C++ | NOASSERTION | |
| dtolnay/thiserror | 5.5K | Rust | Apache-2.0 | |
| google/wire | 14.4K | Go | Apache-2.0 | |
| elixir-lang/elixir | 26.5K | Elixir | Apache-2.0 | |
| hsutter/cppfront | 6K | C++ | NOASSERTION | |
| hanickadot/compile-time-regular-expressions | 3.8K | C++ | Apache-2.0 |