Procedural Macros are really hard to understand

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

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.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • cargo-expand

    Subcommand to show result of macro expansion

  • You can use cargo expand to see what your code expands to: https://github.com/dtolnay/cargo-expand

  • proc-macro-workshop

    Learn to write Rust procedural macros  [Rust Latam conference, Montevideo Uruguay, March 2019]

  • It took me a while to get anything done. My mistake : I came accross the procedural macros workshop several times, and every time I dismissed it, thinking - meh I'll just hack together exactly what I need and move on. Then finally I figured there is no way around it. The builder exercise sounds boring but it covers the topic pretty well. And then I went on to the debug one and from there was able to build the proc macro I wanted.

  • 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
  • astexplorer

    A web tool to explore the ASTs generated by various parsers.

  • I actually don't remember if I finished the debug one. But it was enough for me to build a derive macro with custom attributes and some argument parsing. Building is not easy and the syntax tree is complicated so it's better to use the syn crate and the token stream from proc_macro2, so at least you can debug when running unit tests. https://astexplorer.net/ can help a lot to understand what to expect from syn.

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

  • Understanding Code Structure: A Beginner's Guide to Tree-sitter

    2 projects | dev.to | 6 Apr 2024
  • How to create your own Eslint rule with tests, boosting the DX, and code-review

    2 projects | dev.to | 27 Mar 2024
  • Programming from Top to Bottom - Parsing

    2 projects | dev.to | 18 Mar 2024
  • 😱 ESlint over Conventions - You have Not unlocked the power of ESlint 😱

    2 projects | dev.to | 29 Sep 2023
  • AST Exploret

    1 project | news.ycombinator.com | 5 Sep 2023