Post Ai3PCWnmhpAHTX005Q by diego@ap.diegoveralli.net
(DIR) More posts by diego@ap.diegoveralli.net
(DIR) Post #Ai3PCWnmhpAHTX005Q by diego@ap.diegoveralli.net
2022-12-15T11:18:29.844278Z
0 likes, 0 repeats
Programming tip: if a language has macros, never forget the most important rule:- When something is confusing, assume macro shenanigansYesterday I spent 30 minutes looking for a #rust impl to understand what was going on at a call site. At some point I even thought there were conversion rules I didn't know about, so I went digging through Rust RFCs. I got cargo-show-asm to spit out MIR to see if it would reveal the supposed implicit magic, but it didn't.It turned out the impl was very close to where I was looking, slightly obfuscated inside a large macro.More useful rules when a language has macros, that I keep forgetting:- Don't trust syntactic and semantic tools completely. Use some grep- When applying Ockham's razor, carefully consider what is the simplest explanation; it's not always obvious