TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What's the best resource to understand Macros in Rust?

3 pointsby recvonlineabout 3 years ago
I read the &quot;Little Book of Macros&quot;[1] but still have a hard time applying the knowledge to create my own easily, or to read other Macros and know what they are doing.<p>Does anyone have a secret blog post or tip to understand and learn Macros in Rust?<p>[1]: https:&#x2F;&#x2F;veykril.github.io&#x2F;tlborm&#x2F;introduction.html

1 comment

lazypenguinabout 3 years ago
I also struggled with this, the best thing I found is to look at other people’s macros. I would look at a macro that I know what it does, look at the source then try to understand the concepts used by referring to other material.<p>I wrote a blog post about it a while ago but not sure if it’s a useful resource or not: <a href="https:&#x2F;&#x2F;www.ralphminderhoud.com&#x2F;blog&#x2F;simple-struct-macro&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.ralphminderhoud.com&#x2F;blog&#x2F;simple-struct-macro&#x2F;</a>