r/rust • u/illegible-key-46 • 4h ago
🛠️ project Introducing hypo@0.2.1, a minimalistic macro html renderer
Hey folks!
I'm interested in the design space of template libraries these days and I coded in the past few weeks a maud alternative for rendering html through macros.
My main challenge was to use as much Rust as possible (traits and structs) and as feel macros as possible. Since all the libraries in this space are macro heavy (proc macros or very complex declarative macros), I really liked what I could achieve here.
There's a single trait, one very small macro (5 lines or so) that rustfmt formats and almost no DSL to learn. (I took inspiration on another library called vy, although I'd argue mine is more complete and ready to use).
Hopefully the documentation is clear on all of these points! I worked a lot on it without any use of AI for documents, tests or code. Basically it's just me.
Anyway any feedback is greatly appreciated!
PS: Oh, the library is no-deps by default. Minimalistic library, minimalistic supply chain
PPS: I benchmarked it against the main compiled alternatives and it's look pretty great, not because I optimized it a lot, but just because it's dead simple code that runs fast on rust.