miette icon indicating copy to clipboard operation
miette copied to clipboard

Comparison to Ariadne

Open ShalokShalom opened this issue 8 months ago • 2 comments

Hi there 👋🏻

I currently struggle to see the benefits or differences between this library and its inspiration, Ariadne.

Do you have there maybe a better overview? Thanks a lot 🥳

ShalokShalom avatar May 09 '25 14:05 ShalokShalom

Miette is actually a deeper protocol and more of a diagnostic definition and management library. It includes a generic protocol for defining parts of errors (error code, locations, documentation/URLs/etc), a derive macro to make protocol implementations easier, an abstraction for generic error handling (like with anyhow), and finally various “reporters” that know how to render these generic implementations into formats more useful for her end user, such as the GraphicalHandler.

Ariadne is only that last piece. It does reporting but you have to set up all the calls yourself through a builder.

Ariadne is one implementation of one graphical reporter, and can only render in that format. When you define a diagnostic in miette you can actually switch how you render the reports at runtime. For example, miette will automatically switch to a screen reader friendly renderer when a certain environment variable is present.

Finally: I don’t know if anyone has done this already, but it would be very easy to create an Ariadne renderer for miette diagnostics, and turn off the feature flag in miette for using (and compiling) the built in renderer.

zkat avatar May 11 '25 01:05 zkat

Sounds like this is worth putting somewhere else, where its more accessible for everybody, love it.

(I also think the Ariadne screenshot examples look a bit simpler and approachable, which let me think Miette is a "more complicated" implementations. 👍🏻 )

ShalokShalom avatar May 11 '25 01:05 ShalokShalom