Hacker News new | ask | show | jobs
by jeremyloy_wt 898 days ago
thiserror and anyhow are hardly magic.

The former is just macros for error definition

The latter is just a wrapper around box dyn error

1 comments

“Magic” isn’t a rigorously defined term, so let’s ignore it. Support for macros is a huge philosophical difference between Rust and Go.
I disagree in the context of error handling.

The go ecosystem frequently utilizes `go generate` to handle boilerplate code generation. That’s the exact same way `thiserror` utilizes macros to generate plain error structs. While macros can do more, in this case it’s the same.