by tiehuis · 9y ago · 0 comments
Error values under the hood are just unsigned integers and are returned on the stack. In fact, the granularity at which allocators are exposed in the stdlib makes any possible dynamic allocation very explicit in the language.
This link [1] provides an overview of errors and some of the surrounding control flow.
If you had an error you wished to pass a reason string for, would you need to use a global static or something?
If you wanted to send data you would need some other means like you suggest. I'd be interested in finding an ergonomic solution to this but it probably wouldn't be at the language level.