News for hackers. Stuff that matters.
Re:Maud: A Rust macro for writing HTML by pizza234 on Tuesday June 07, 2022 @04:06AM (#31651183)
It ultimately depends on how they're written. println! is a macro, and doesn't "break the tooling". on the other end of the spectrum, using a crate like demonstrate (unit testing) produces hard to understand errors and slows down the IDE.

I don't remember experiencing Rust Analyzer crashes for a long time, though (I do remember some in the past).

Re:Maud: A Rust macro for writing HTML by shepmaster on Tuesday June 07, 2022 @09:09AM (#31653705)
> println! is a macro, and doesn't "break the tooling"

I like, use, and write macros, but this isn't fully true. For example, recent Rust versions allow writing identifiers directly in the format string:

    println!("{some_identifier}")
However, this breaks rust-analyzer's ability to rename variables [1].

[1]: https://github.com/rust-lang/rust-analyzer/issues/11260#

Re:Maud: A Rust macro for writing HTML by tialaramex on Tuesday June 07, 2022 @06:22AM (#31652116)
println! is only a declarative macro, whereas Maud is a proc macro.

The declarative macros aren't too head-twisting for tools, they just expand as declared, this can sometimes have a few surprising effects but generally it is very manageable. Procedural macros have essentially unlimited power and thus are sometimes entirely impossible to analyse.

Re:Maud: A Rust macro for writing HTML by pornel on Tuesday June 07, 2022 @07:45AM (#31652736)
Re:Maud: A Rust macro for writing HTML by tialaramex on Wednesday June 08, 2022 @03:41AM (#31664455)
I see a built-in there. Are you really seeing a proc macro?