What are some creative/advanced uses of macro_rules?

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • case-studies

    Analysis of various tricky Rust code

  • /u/dtolnay has a great case studies repository.

  • fisica

    a physics library

  • I just published a physics crate which employs a lot of dense & nested macro_rules for auto-implementing methods on types if you want to take a look at it.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • bitvec

    A crate for managing memory bit by bit

  • My friend Nika wrote a macro that packs a sequence of 1, 0, … tokens into a correctly structured bit-buffer, adaptable over any register type or bit-ordering, at compile time. It's now basically this whole file

  • watt

    Runtime for executing procedural macros as WebAssembly

  • This, unironically. I'm hoping Watt can gain more traction and be used for procedural macros in the future.

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