from Hacker News

Ask HN: Looking for tool/language to describe data/packet structures

by tinktank on 2/11/23, 4:21 PM with 4 comments

I'm looking or a tool that will allow me to textually describe data/packet structures for the purposes of creating visual representations of the structures. If it's capable of expressing constraints or assertations that would be even better. Examples of constraints/assertions:

- This field should always be n bits into the start of the structure - The size of this structure shouldn't exceed B bits - This field should never be less than s bits

The capability to output image formats directly is preferred, but I'm not opposed to having to script it and tie it up to an image generation library.

I'd prefer a CLI tool so the flow is all on my local machine.