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

nom is amazing, especially because it's so incredibly versatile. If I had one complaint, it's that I find it challenging due to how versatile it is. You can choose between different error types and input types and etc. It seems to work best if you use &[u8] as the input, otherwise things can get very tricky.

That said, for purely binary formats, I strongly recommend folks check out Kaitai Struct if they haven't already, just because I think the concept is really solid. I found out about Kaitai Struct because I accidentally did something fairly similar that was Go-specific (go-restruct) and someone else pointed out Kaitai to me.

Parsing file formats was never super awful, but I'm glad that the ergonomics of writing fast, robust parsers has improved to the point where it's a superior experience in some regards to the tried and true but fairly unportable "dump structures from memory" approach that seemed to be popular when I was younger.

Tangentially in this category, I think Wuffs is quite compelling too.



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

Search: