C++ Template Macroprogramming versus Lisp Macros

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. metabrainfuck

    Just an abomination I tossed together today.

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. reflect-cpp

    A C++20 library for fast serialization, deserialization and validation using reflection. Supports JSON, Avro, BSON, Cap'n Proto, CBOR, flexbuffers, msgpack, TOML, UBJSON, XML, YAML / msgpack.org[C++20]

    In general, a macro produces code at compile time, doesn't matter in which form it ends up in the binary, as long as the observable side effects are the same.

    Example of a library that generates serialization code, https://github.com/getml/reflect-cpp

    As mentioned the ongoing C++26 proposal with produce the desired source code at compile time, thus reducing the amount of code of libraries such that one.

  4. ultisnips

    UltiSnips - The ultimate snippet solution for Vim. Send pull requests to SirVer/ultisnips!

    Let’s say, you’re writing a web application. In most programming language you’d be using libraries or rely on a framework. With Lisp macros, you can program the archetype of a web application. And then use a simpler language to describe you application. Think of it as programmable snippets. Something like Ultisnips [0], but inherent to the language.

    [0]: https://github.com/SirVer/ultisnips

  5. use-package

    A use-package declaration for simplifying your .emacs

    One example is the ~use-package~ macro (Emacs plugin) [0]. Using packages in emacs is mostly the same code over and over. They've already been abstracted in functions, but you still find yourself juggling with so many utilities. You could write a bigger functions, but it will then have a lot of conditional branches. This macro selectively select the code it needs and transforming it if needs be and then the result will be evaluated.

    It's a bit hard to explain for me (English is not my native language). But it's the difference between coding a solution will all the edge cases baked in and coding an archetype that let you add your own cases. With functions, you abstract common algorithms, with macros you abstract common architecture.

    [0] https://github.com/jwiegley/use-package/blob/a6e856418d2ebd0...

  6. chaos-pp

    chaos preprocessor library. this is what boost preprocessor derived from.

    It actually would! There are a handful of base-10 arbitrary precision arithmetic implementations in the preprocessor[1], and modern continuation-passing style macro metaprogramming[2] makes it straightforward to write a function like factorial once you get the syntax and semantics down.

    Libraries like Boost.Preprocessor can’t be taken as an example of “cutting edge” preprocessor metaprogramming. It set a very low bar, and IMO has stifled a lot of developer creativity.

    [1] https://github.com/rofl0r/chaos-pp/tree/master/chaos/preproc...

  7. order-pp

    order-pp preprocessor library (standalone part of chaos-pp)

    [2] https://github.com/rofl0r/order-pp/blob/master/example/fibon...

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Visual code folding?

    8 projects | /r/emacs | 27 Nov 2022
  • Having problems setting up rust support

    2 projects | /r/emacs | 16 Nov 2022
  • two weeks with emacs as a vimmer

    11 projects | /r/emacs | 31 Oct 2022
  • Help Evil mode: Automatically jump to text object during "ci(", "ci{", etc

    3 projects | /r/emacs | 3 Mar 2021
  • Avoiding Emacs Bankruptcy

    2 projects | news.ycombinator.com | 24 Jun 2024

Did you know that C is
the 6th most popular programming language
based on number of references?