Hacker Timesnew | past | comments | ask | show | jobs | submitlogin
Oxidizing Kraken (kraken.com)
50 points by clarkmoody on Feb 19, 2021 | hide | past | favorite | 4 comments


Author of the post here - feel free to shoot any questions.

Also see thread on r/rust: https://www.reddit.com/r/rust/comments/lnkx9h/oxidizing_krak...


> Ideally, each fallible function would have its own error enum to precisely capture its errors and handle them, but in practice it is too verbose and leads to using the less precise Error trait or one enum per module. The language could support this better: there are several initiatives and macros exploring this.

Definitely something I can agree with! Has your team explored any initatives / macros that seem promising? We're currently using the crate 'thiserror' but it's made our compilation times painful.


We're using thiserror, and haven't explored macros that generate an enum from the Result type. I remember there are crates exploring this, but this is something that would really benefit from compiler support. Ocaml's polymorphic variants appear to provide an interesting solution here.


This is a great write up, educational and frank.




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

Search: