Earlier quoted context omitted.
Are we talking about different things? ASN.1 does more or less what I was hoping Kaitai can do. Where's the breakthrough? I just want to be able to describe network protocols in some "language" and generate code that can serialize/deserialize it.
Kaitai is designed to describe arbitrary, preexisting binary formats. You can’t do that with ASN.1.
Kaitai: Describe the structure of data, not how you read or write it
51–60 of 66 posts
Re: Kaitai: Describe the structure of data, not how you read or write it
#52Earlier quoted context omitted.
Kaitai is designed to describe arbitrary, preexisting binary formats. You can’t do that with ASN.1.
Err. I'm not sure what asn.1 is missing for this? I've seen lots of people use asn.1 exactly for this (i.e. writing a grammar for an arbitrary pre-existing binary format not readily described in asn.1).
Any chances you have some reference to what you saw?
Re: Kaitai: Describe the structure of data, not how you read or write it
#53Re: Kaitai: Describe the structure of data, not how you read or write it
#54I do love kaitai and recently contributed a grammar, but both the title and the copy talk about writing. > Reading and writing binary formats is hard... Kaitai Struct tries to make this job easier... Kaitai cannot write data back out. [1] This is a major limitation for me. It would be nice to use it as a mutation engine for fuzzing, but without being able to write it back out, it is mostly just beneficial for analysi…
Any other lib that also generates Encoder/Writer code?
100% fix formats with no self reference or for example checksums that sits in front of the checksumd data (no streaming possible)...
Re: Kaitai: Describe the structure of data, not how you read or write it
#55The logic itself is simple, as you read data byte-by-byte you need to check check if the previous byte was 0xFF and the frame or tag is marked as unsychronized. Yet it's not that simple to describe this declaratively. I wonder if Kaitai can actually do this. From what I see Kaitai does have at least part of ID3 described, but it doesn't seem to actually do unsynchronization, as far as I can tell from the code.
Re: Kaitai: Describe the structure of data, not how you read or write it
#56This is a use-case for which a DSL is well-suited. They would be wise to abandon YAML.
I think that I agree of you, and I'm obviously fond of clever DSL's cough mgmt config cough , but it's not clear what specifics you had in mind here. Share away if you're interested!
Re: Kaitai: Describe the structure of data, not how you read or write it
#57Earlier quoted context omitted.
Err. I'm not sure what asn.1 is missing for this? I've seen lots of people use asn.1 exactly for this (i.e. writing a grammar for an arbitrary pre-existing binary format not readily described in asn.1).
asn.1 distinguishes between schema and encoding; there are many binary encodings and you can technically devise a custom one that would let you describe the high level structure with an asn.1 grammar and then lay out the actual bits with a custom encoding format so that it matches the pre-existing format you're writing the new serde for). This may work as many formats have this leveled approach. E.g. the lowest level…
I understand what you're saying though. Memories of using this were... unpleasant. I think the 'best' alternative for me would be RecordFlux. Ada-like syntax, generation of AoRTE-provable SPARK code, and recently the expressivity of the tool has increased. And the whole thing is in python, easily extensible to build things from the type description: generators, fuzzers, advanced specific parsers (need only one field and want the control fields' positions and sizes), wireshark plugins, Postgres extensions...
I really like what they're doing there. Might be the one of the low-effort (for the user!) lead-bullets for safer software.
Re: Kaitai: Describe the structure of data, not how you read or write it
#58This is a use-case for which a DSL is well-suited. They would be wise to abandon YAML.
I think that I agree of you, and I'm obviously fond of clever DSL's cough mgmt config cough , but it's not clear what specifics you had in mind here. Share away if you're interested!
I don't really know what to tell you other than that YAML is not well-suited to this domain, and designing a domain-specific language which meets the particular needs of the system, and only just, would be better. You could base it off of C structs or Rust types or s-expressions or whatever else, the exact syntax isn't important so long as it allows you to concisely and precisely specify the semantics of the tool.
Re: Kaitai: Describe the structure of data, not how you read or write it
#59Earlier quoted context omitted.
I might be missing something - why would this be a breakthrough? It sounds complicated to generate the interfaces, sure, but is there a theoretical problem blocking this, or just practical?
Yeah I was also confused. I wrote a bidirectional parser/writer layer for yaml in a haskell program I had at work. The yaml structure mappings were all declarative in the code and even allowed documentation for the structures to be printed out. It's not that hard once you define the primitive bidirectional (higher-order) mapping function to go from a `Configurable a` to a `Configurable b`, the rest kind of unfolds fr…
Re: Kaitai: Describe the structure of data, not how you read or write it
#60No support for sum types? I didn't see even simple unions covered.