hirrolot/metalang99
FreeFull-blown preprocessor metaprogramming
FreeFree tier
About hirrolot/metalang99
Metalang99 is a C99 library that enables full-blown preprocessor metaprogramming through an interpreted functional programming language built atop of preprocessor macros. It supports algebraic data types, pattern matching, recursion, currying, and collections, along with compile-time error reporting and debugging. The library includes a built-in syntax checker to produce comprehensible macro errors. Metalang99 is used in production at OpenIPC as an indirect dependency of Datatype99 and Interface99, and enables compile-time list manipulation, macro recursion, and argument overloading.
Key Features
Algebraic data types
Pattern matching
Collections (lists, etc.)
Compile-time error reporting and debugging
Built-in syntax checker for comprehensible macro errors
Macro recursion capabilities
Overloading on number of arguments
List manipulation (replicate, reverse, filter, etc.)
Pros & Cons
Pros
- Enables advanced metaprogramming in C99 without external tools
- Provides functional programming concepts (pattern matching, recursion, currying) in the preprocessor
- Built-in syntax checker improves error messages for macro development
- Used in production at OpenIPC, proving reliability
- Clean and concise code for compile-time computations
Best For
Writing reliable and maintainable metaprograms in pure C99Compile-time list manipulation and computationsImplementing compile-time data structures and algorithmsOverloading C functions based on argument countBuilding domain-specific languages within C macrosCreating libraries like Datatype99 and Interface99 that require advanced metaprogramming
FAQ
What is Metalang99?
Metalang99 is a C99 library that provides full-blown preprocessor metaprogramming, implemented as an interpreted functional programming language atop of preprocessor macros. It supports features like algebraic data types, pattern matching, recursion, and collections.
What can you do with Metalang99?
You can write compile-time metaprograms such as list manipulation (replicate, reverse, filter), macro recursion, overloading functions on argument count, and building domain-specific languages like Datatype99.