jefffhaynes / BinarySerializer

A declarative serialization framework for controlling formatting of data at the byte and bit level using field bindings, converters, and code.
MIT License
292 stars 62 forks source link

Add Kaitai Struct Compiler #167

Closed mganss closed 3 years ago

mganss commented 3 years ago

First off, I love BinarySerializer. I found this while looking for an alternative to Kaitai Struct that can not only deserialize but also serialize. And although translating manually from the format description I have in Kaitai has worked nicely, it would be awesome to have a compiler that can generate BinarySerializer C# from .ksy. Kaitai has a C# backend but it can only deserialize (like all its backends AFAIK).

Kaitai has a collection of format specifications that would immediately become available to BinarySerializer if a compiler existed.

pgodwin commented 3 years ago

To be clear, I don't speak for this project... but I'd imagine something like that either makes more sense as part of the Kaitai Compiler itself (eg a new Compiler based on the existing C# implementation?), or as an external tool separate from BinarySerializer?

jefffhaynes commented 3 years ago

Yeah I have to agree with @pgodwin. I think I prefer the loose coupling approach. But it looks like a cool project!

mganss commented 3 years ago

Yes, absolutely. I'd imagine it as a separate tool (not a feature within the library) but it could still be a part of this project/repo and shipped as a .NET global tool.