In addition to languages, there's a Python library called "construct" that's been around for a long time. It uses a declarative style to make it surprisingly easy to make binary parsers and emitters.

https://construct.readthedocs.io/en/latest/intro.html#exampl...