Full-blown preprocessor metaprogramming (by Hirrolot)

Metalang99 Alternatives

Similar projects and alternatives to metalang99

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better metalang99 alternative or higher similarity.

metalang99 reviews and mentions

Posts with mentions or reviews of metalang99. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-09-30.
  • How to convert an enum to string in C++
    4 projects | | 30 Sep 2023
    There are also other approaches. Macro variants making use of `__VA_ARGS__` would be probably the best trade-off. If you want a slightly more ergonomic syntax, something like Metalang99 [1] will help (and the author even wrote a post about this exact subject [2]). Codegen is another option which may work better than other options depending on the situation and exact implementation strategy. And there is always the Reflection TS [3], which may or may not be incorporated to C++26...




  • Few lesser known tricks, quirks and features of C
    2 projects | /r/programming | 20 Feb 2023
    I went down the rabbit hole with C99 metaprogramming after reading through the list. For reference:,
  • Boost:Unordered_flat_map
    2 projects | | 19 Nov 2022
    Honestly I have to disagree. There is nothing particularly special about what Super Template Tetris(STT) is doing.

    At its core, template metaprogramming is just functional programming at compile time. STT is just a template and a runtime function which do the following:

    1, take an input via compile time flag (the `-D DIRECTION`)

    2. take a type input from an included header file containing the current state (`#include "current_game.h"`)

    3. via functional programming, compute the results of a single step of the game.

    4. specialise a single function using the results of step 3. this function prints the computed result to the screen and the computed game state to a file (`./current_game.h`).

    5. gcc/clang exits. compilation is complete.

    6. call the compiled binary.

    7. the binary runs the specialised function and prints the outputs.

    Sure it's fucky and you shouldn't do that in production but what sane individual is writing a piece of code that at runtime (after compiling) seeks out one of its own source files and modifies that file?

    To prevent this from being possible you'd have to remove runtime file IO from the language. The other potential solutions wouldn't work:

    1. Remove templates entirely: Still would be possible using which solely uses the preprocessor. Given that the pre-processor is literally just term substitution(a glorified copy/paste engine), if you removed that as well, you'd have to accept no form of metaprogramming at all.

    2. Remove the ability to #include other files: Could still be done by doing everything inline. `#include` is just copy-paste anyways so it's more an abstraction than anything else to the compiler and preprocessor, it's basically the same as if all the code was pasted into the same file.

    That leaves you with removing file IO. Without IO a programming language is basically useless, particularly as a systems programming language.

  • What does the ??!??! operator do in C?
    2 projects | | 5 Oct 2022
  • How did you choose the name for your programming language?
    7 projects | /r/ProgrammingLanguages | 6 Jun 2022
    Metalang99, a metalanguage for C99. Simple :)
  • Rust is hard, or: The misery of mainstream programming
    9 projects | /r/rust | 2 Jun 2022
    Just wait until you see some other things by the same author, like
  • Conditional preprocessor macro, anyone?
    3 projects | /r/C_Programming | 27 Apr 2022
    I did get a few great responses there as well, though. One was a link to this impressive piece of work:
  • Best C Marco Preprocessor Tutorial? (Book or Website)
    4 projects | /r/C_Programming | 15 Jan 2022
    There was a time that I wanted to write such a book but then realised that it's better to just create a third-party library and not to confuse users with abstruse macro techniques, but to encapsulate them and provide a nice interface. For example, you can workaround the preprocessor in such a way to implement recursion, but practically it's just too complicated to use directly. So I created Metalang99 -- a preprocessor metaprogramming library that allows writing fairly complicated macros. You can find a tutorial and references to prior art in the README.
  • No cheating
    22 projects | /r/HolUp | 19 Oct 2021
  • I created a λ-calculus interpreter written entirely in C preprocessor macros
    3 projects | /r/programming | 5 Jun 2021
    This is an implementation with some real depth to it :)
  • A note from our sponsor - InfluxDB | 9 Dec 2023
    Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge. Learn more →


Basic metalang99 repo stats
6 months ago
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives