3 ms·
Ok, the first example I found was when I was trying to find a way to write a rust proc macro that recursively processes functions or modules and re-writes arith
by emtel 2y ago
Ok, the first example I found was when I was trying to find a way to write a rust proc macro that recursively processes functions or modules and re-writes arithmetic expressions. The best way to do this, it turns out, is with `VisitMut` or `fold`. I cannot find any results discussing these approaches with google, but ChatGPT (4) suggested it within the first couple refinements of a query.
Another recent example from my history: "can you implement Future twice for a rust struct, with different Output types"
- layer8 2y agoI found the following as the first Google result for “rust proc macro AST rewrite” (and I don’t know much about Rust”): https://users.rust-lang.org/t/using-macros-to-modify-ast-to-modify-and-add-line-of-codes-in-function/56805/10 https://users.rust-lang.org/t/using-macros-to-modify-ast-to-... And I found the following for “different future same rust struct” (first search attempt): https://stackoverflow.com/questions/65587187/how-to-instantiate-the-same-struct-with-different-implementations-of-a-trait https://stackoverflow.com/questions/65587187/how-to-instanti... I’m not saying that LLMs can’t be useful for stuff like that, but they haven’t been that much of an improvement over Google search so far. And I always google about what an LLM suggests in any case, to verify and to get a better feeling about the real-world state of the topic in question.
- emtel 2y agookay? I didn't find any of those when I was looking originally. I certainly wouldn't claim that you can't find this information with google, just that I wasn't able to.