Re:Maud: A Rust macro for writing HTML
by coffeeblack on Tuesday June 07, 2022 @03:26AM
(#31650913)
Shouldn’t it work in any IDE that understands Rust macros?
[ Parent
| on HN ]
Re:Maud: A Rust macro for writing HTML
by tialaramex on Tuesday June 07, 2022 @03:55AM
(#31651108)
You can't build an IDE that definitely just "understands Rust macros" since procedural macros in particular are in effect modifying your compiler. Maud is a proc macro.
Mara's whichever_compiles! macro for example: https://github.com/m-ou-se/whichever-compiles -- that macro is forking your compiler to try out all the branches and throwing away branches which caused a compile error.
Clearly your IDE should throw its hands up and say, I don't understand what this does, I give up.
In general doing something useful with Rust macros is a more tractable problem for an IDE than say the C pre-processor, because Rust's macros have a stronger syntax, but the proc macro is potentially much too powerful / dangerous to try to evaluate.
Re:Maud: A Rust macro for writing HTML
by msk-lywenn on Tuesday June 07, 2022 @03:51AM
(#31651084)
Is there any? I don't think there is a real meaning to "understanding rust macros", as they define something completely new.