Help test Google flatbuffers

Joseph Rushton Wakeling via Digitalmars-d digitalmars-d at puremagic.com
Sun May 15 07:08:57 PDT 2016


On Saturday, 14 May 2016 at 15:25:58 UTC, Brian wrote:
> Project:
> https://github.com/putao-dev/google-flatbuffers
>
> Pull address:
> https://github.com/google/flatbuffers/pull/3856
>
> dub project:
> http://code.dlang.org/packages/flatbuffers

Nice to see someone working on this!  A few general bits of 
feedback:

(1) I am not sure I see the rationale for using classes for the 
data structures -- is there anything that actually requires it?  
It would probably be better to use structs, possibly using 
`@disable this();` if it's required that the buffers never be 
created without being initialized.

(2) It's probably more idiomatic to use `void[]` for buffers of 
binary data, although I imagine you may have some reasons for 
using `ubyte[]` ... ?

(3) Style point: variable/function names beginning with an 
underscore `_` are I believe reserved for the runtime (lots of 
people don't obey this convention, but it's a good idea to do so).

(4) I'm not sure I see the point of connection between flatbuffer 
schemas and what is implemented here -- it looks like the 
underpinnings of how flatbuffer data would be stored and 
manipulated ... ?  It would be very good if things could be 
worked out so that one could define at compile time a D data 
structure based on a flatbuffer schema, such that one can 
interact with it "as if" it were a collection of idiomatic D data 
structures; see e.g. how it works with dproto and protobuf 
schemas:
https://github.com/msoucy/dproto/#simple-example

(5) To my eyes the modules and functionality are rather sparsely 
documented; it would be good if documentation could be extended 
(particularly with usage examples).


More information about the Digitalmars-d mailing list