Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] use github.com/DeDiS/protobuf for ser/de operations #8

Open
chrislusf opened this issue Oct 29, 2015 · 5 comments
Open

[feature] use github.com/DeDiS/protobuf for ser/de operations #8

chrislusf opened this issue Oct 29, 2015 · 5 comments

Comments

@chrislusf
Copy link
Owner

The affected code is only within this file:

https://github.com/chrislusf/glow/blob/master/io/channels.go#L77

and

https://github.com/chrislusf/glow/blob/master/io/channels.go#L54

I tried to use github.com/DeDiS/protobuf, but it can not handle reflect.Value.

@joeblew99
Copy link

i was using protocol buffers (PB) and recently started to use FlatBuffers (FB) for perf reasons.
FB is the successor to PB that has been in the alpha oven for a while now, but is now ready (IMHO)

http://google.github.io/flatbuffers/

if seems a good match this Glow, and i am curious on your thoughts.
There is no reflection, but instead the go files are code generated at compile time. There is no heap if used correctly at runtime.

I also liked the ability to serialise between FB and JSON. This allows the data types to be reused in the any web layer for a application.

@chrislusf
Copy link
Owner Author

Protocol Buffer or Flat Buffer need definition and code generation. They could be used to customize ser/de.

The default ser/de should not need any additional steps.

@joeblew99
Copy link

ok. I need to look into the code to see how your doing it. I guess its reflection based ?

@alpe
Copy link
Contributor

alpe commented Jan 7, 2016

@zenixls2
Copy link

zenixls2 commented Nov 9, 2016

if you really want to use DeDiS/protobuf,
maybe write a func EncodeValue(value reflect.Value) to wrap from L51~L57
https://github.com/dedis/protobuf/blob/master/encode.go#L51
and write another func (dec *Decoder) DecodeValue(v reflect.Value) to wrap L64
https://github.com/dedis/protobuf/blob/master/decode.go#L64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants