1. 32
  1.  

  2. 6

    This is pretty cool. Reminds me of Erlang’s pattern matching and how easy it is to parse binary data with it.

    The fact that there are compilers for several different programming languages makes it feel like protobuf, except on any arbitrary binary data!

    1. 3

      If folks are interested in binary parsing, the canonical repo is https://github.com/dloss/binary-parsing

      Don’t underestimate https://docs.python.org/3/library/struct.html

      1. 4

        The perl/python struct modules were my original inspiration 20 years ago for what is lately https://github.com/c-blake/nio

      2. 2

        No C support?

        1. 2

          I like Kaitai, it’s similar to poke and other tools. One thing however that is missing from kaitai is the ability to generate a formatted binary, at the moment it’s only a parser.

          1. 2

            I wrote a similar library in Rust, but includes the reverse of parsing, writing: Deku: Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization -> https://github.com/sharksforarms/deku

            Stories with similar links:

            1. Kaitai Struct: declarative binary format parsing language via pushcx 4 years ago | 8 points | no comments