Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Good points raised. In Go, I've struggled to attach stack traces to errors. I have a plan (a custom error type, and type checking for that type) but it's not "bulletproof". Seems similar. Seems like there's opportunity for some language evolution here.


IIRC, part of the language proposal to make errors wrappable in Go’s stdlib included a stack trace. And indeed github.com/pkg/errors includes that. But it never made it into the stdlib implementation


> Seems similar.

It's not: because error sets are a built-in and completely bespoke feature, and they get handled via built-in constructs exclusively (try / catch), zig can actually attach / generate error traces: https://ziglang.org/documentation/0.3.0/#Error-Return-Traces




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

Search: