google / flatbuffers

FlatBuffers: Memory Efficient Serialization Library

Home Page:https://flatbuffers.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request: Split Serialization/Deserialization codegen

Raildex opened this issue · comments

In our project, flatbuffers are serialized in language A and deserialized in language B.
It would be great if there were flags to control flatc to either produce code for serialization or deserialization or both (default).

As an example:

flatc.exe --cpp --deserialization schema.fbs
will generate Get* functionality, accessors etc.
flatc.exe --cpp --serialization schema.fbs
will generate Create* functionality, Builders etc.

flatc.exe --cpp schema.fbs
flatc.exe --deserialization --serialization --cpp schema.fbs
will generate both serialization and deserialization (default)

What would the benefit of this feature be?
Are you running into code size limitations?
What languages would you use this for?
Those with optimizing compilers will strip out the unused code.

Yeah, i don't see the benefit for the cost it would incur refactoring things.