Maud: A Rust macro for writing HTML
11–20 of 86 posts
Re: Maud: A Rust macro for writing HTML
#12The main problem with macros like this (aside from being yet another language to learn) is that they don't work nicely with IDEs.
Shouldn’t it work in any IDE that understands Rust macros?
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
#13The main problem with macros like this (aside from being yet another language to learn) is that they don't work nicely with IDEs.
Totally agree, macros are the worst Rust feature for me, they are way too powerful and break the tooling, e.g. fmt or language server. https://rust-analyzer.github.io/blog/2021/11/21/ides-and-mac...
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
#14The main problem with macros like this (aside from being yet another language to learn) is that they don't work nicely with IDEs.
Isnt it just easier to have a html file then replace tags inside of that rather than having a new macro language ?
Re: Maud: A Rust macro for writing HTML
#15Maud is wonderful for small things like a stats page or dashboard. But once you start getting to a few pages it's so much less cognitive overhead to separate concerns out into proper html files/templating. It seems quite daunting to have a large project where all your html is inside rust files and a lot harder to find people who can work on it proficiently.
Re: Maud: A Rust macro for writing HTML
#16Maud is wonderful for small things like a stats page or dashboard. But once you start getting to a few pages it's so much less cognitive overhead to separate concerns out into proper html files/templating. It seems quite daunting to have a large project where all your html is inside rust files and a lot harder to find people who can work on it proficiently.
Plus, Maud has a definitive speed advantage from what I've noticed.
Sadly, there isn't any great alternative for making performant HTML templates in Rust from what I've seen, a lot of the other HTML templating libs aren't that great comparatively.
Re: Maud: A Rust macro for writing HTML
#17Quoted post unavailable.
Re: Maud: A Rust macro for writing HTML
#18Quoted post unavailable.
Re: Maud: A Rust macro for writing HTML
#19Maud is wonderful for small things like a stats page or dashboard. But once you start getting to a few pages it's so much less cognitive overhead to separate concerns out into proper html files/templating. It seems quite daunting to have a large project where all your html is inside rust files and a lot harder to find people who can work on it proficiently.
I wish it was still the consensus among JS devs. People are putting css into JS files, on top of html
Re: Maud: A Rust macro for writing HTML
#20Scala is the only other language I know of which has some kind of XML/HTML syntax support (scala.xml). (But it looks like it got removed. [2])