Live data from Hacker News

Maud: A Rust macro for writing HTML

maud.lambda.xyz

1–10 of 86 posts

Re: Maud: A Rust macro for writing HTML

#4
post #3
post #2

The 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 ?

This also supports conditional expressions and loops:

https://maud.lambda.xyz/control-structures.html

Re: Maud: A Rust macro for writing HTML

#7
post #4
post #3

Earlier quoted context omitted.

Isnt it just easier to have a html file then replace tags inside of that rather than having a new macro language ?

This also supports conditional expressions and loops: https://maud.lambda.xyz/control-structures.html

So does most templating languages.

Re: Maud: A Rust macro for writing HTML

#8
post #2

The 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...

Re: Maud: A Rust macro for writing HTML

#9
Maud 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

#10
post #2

The 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?

Is there any? I don't think there is a real meaning to "understanding rust macros", as they define something completely new.
Post reply on HN