* Patrick Walton:

> On the other hand, Cindy Rubio-González's work shows that in the Linux
> kernel, forgetting to handle error codes is *extremely* common.
>
> http://www.eecs.berkeley.edu/~rubio/
>
> I don't see anything fundamentally different with Go's approach that
> will lead to a different outcome.

The kernel usually passes results by storing them in an existing
object because allocation by the callee is less efficient and
impossible in many contexts.  Go has garbage collection, and returning
a new object and an error return value is the more common style.  The
result-plus-error case has a much better chance of being handled
correctly.

Go also has exceptions (for signaling certain errors).  I'm not sure
if it deals with memory allocation failures gracefully.  If it
doesn't, that would eliminate a fair chunk of kernel error handling,
too.

So in short, Go is quite different. :-)
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to