It’s extremely annoying that so many APIs in Rust (both the language and the stdlib) panic instead of returning an error. At least there are linters for many of these, but we do need to enable those lints manually.
Conversation
Notices
-
Embed this notice
Hugo 雨果 (whynothugo@fosstodon.org)'s status on Saturday, 27-Dec-2025 07:05:33 JST
Hugo 雨果
- Haelwenn /элвэн/ :triskell: likes this.
-
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Saturday, 27-Dec-2025 07:10:23 JST
Haelwenn /элвэн/ :triskell:
@whynothugo Reminds me that few times I've wanted to check Hare's stdlib to make sure error handling is done well.
At least I think the few I accidentally landed on got better. -
Embed this notice
Hugo 雨果 (whynothugo@fosstodon.org)'s status on Saturday, 27-Dec-2025 07:49:49 JST
Hugo 雨果
@lanodan The nomem changes address a huge deal of errors. Slice indexing and alike is still panicky instead of fallible.
-
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Saturday, 27-Dec-2025 07:49:49 JST
Haelwenn /элвэн/ :triskell:
@whynothugo Yeah nomem and is a very welcome one but that's like a big noticeable change.
More thinking of small ones like one I hit once was path/filenames not being always valid utf8 (I blame shift-jis). -
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Saturday, 27-Dec-2025 08:20:26 JST
Haelwenn /элвэн/ :triskell:
@whynothugo Yeah, I also think so, like there's at the very least a missing level of abstraction between syscalls and stdlib for those.
Plus paths rarely need to be treated as true strings so always encoding/decoding as utf8 doesn't makes that much sense either. -
Embed this notice
Hugo 雨果 (whynothugo@fosstodon.org)'s status on Saturday, 27-Dec-2025 08:20:27 JST
Hugo 雨果
@lanodan The stlib only supporting utf-8 path names is a big mistake IMHO. I have old back-ups in DVDs which can't be accessed with anything written in hare. It seems like a very high-level decision for such low-level interface.
-
Embed this notice
Hugo 雨果 (whynothugo@fosstodon.org)'s status on Sunday, 28-Dec-2025 01:28:07 JST
Hugo 雨果
@lanodan Yeah, syscalls ought to take a byte slice, and leave the rest to the call site.
Haelwenn /элвэн/ :triskell: likes this.