FlatBuffers Language interoperability?

37 skatījumi
Pāriet uz pirmo nelasīto ziņojumu

Ethan Zhou

nelasīta,
2017. gada 2. aug. 17:01:4902.08.17
uz FlatBuffers
Do all the different language implementations of Flatbuffers generate binaries that can be read by other FlatBuffers implementations? For example, if I encode some data using the C++ implementation, and send the schema + binary data over to a C implementation, might there be any potential issues?

I'm asking because I noticed that the FlatBuffers Internals guide says:

Note that this not the only possible encoding, since the writer has some flexibility in which of the children of root object to write first (though in this case there's only one string), and what order to write the fields in. Different orders may also cause different alignments to happen.

which suggests that different implementations could create different binaries for equivalent data.

Wouter van Oortmerssen

nelasīta,
2017. gada 3. aug. 11:18:3103.08.17
uz Ethan Zhou,FlatBuffers
Yes, they are all compatible with eachother. The order in which fields are written does not affect the reader, beyond possible cache optimisation etc. The data will still look exactly the same.

Think of the different orders a tree can be stored in C++ in memory, depending on the memory manager implementation. The reader never notices the difference. FlatBuffers is similar.

--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Atbildēt visiem
Atbildēt autoram
Pārsūtīt
0 jauni ziņojumi