Hacker News new | past | comments | ask | show | jobs | submit login

In Rust you can use the anyhow library if you want a similar level of overhead to Go and similarly aren’t worried about differentiating error cases.

What do you think of adopting Zig’s error handling approaches to Go?




> [...] and similarly aren’t worried about differentiating error cases.

I differentiate error cases in Go, so I'm not sure what you're talking about. Sometimes it's done with ==, other times it's done with type assertions, type switches, and some helper functions in the errors package.

I've barely touched Zig.

I think it's contributing some important ideas, and maybe those ideas will get further developed in newer languages.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: