The DSL (domain specific language) for defining data formats in ImHex seems really cool. I have never seen a language that mixes logic into definitions of data structures quite like that before.
It wouldn't at all suit a general purpose compiled programming language (the best you can do there is templates or similar), but here it seems really neat. I haven't looked into it (maybe this exists), but I would love to see this DSL as a library or a code generator, to help with parsing custom binary formats in my own programs. This is much easier for this specific purpose than even parser combinators (which is what I would typically use, e.g. winnow in Rust).
Interesting. Though after looking at the examples on their home page and skimming the examples it looks more limited than the imhex format. But that could just be because I don't know this library well enough.
Comments
The DSL (domain specific language) for defining data formats in ImHex seems really cool. I have never seen a language that mixes logic into definitions of data structures quite like that before.
It wouldn't at all suit a general purpose compiled programming language (the best you can do there is templates or similar), but here it seems really neat. I haven't looked into it (maybe this exists), but I would love to see this DSL as a library or a code generator, to help with parsing custom binary formats in my own programs. This is much easier for this specific purpose than even parser combinators (which is what I would typically use, e.g. winnow in Rust).
Kaitai Struct is also pretty good and will generate code in several languages.
Interesting. Though after looking at the examples on their home page and skimming the examples it looks more limited than the imhex format. But that could just be because I don't know this library well enough.