Discussion:
[go-nuts] GoMobile binding: why not using ProtocolBuffers or FlatBuffers?
d***@gmail.com
2015-07-30 21:47:43 UTC
Permalink
I have started playing with the GoMobile packages, and I must say it's very
promising.

I realized that binding types are still very limited at the moment, and if
I want to pass some complex structure I would better use a string
serialized JSON.


I was wondering, instead of writing a custom GoMobile binding mechanism,
why not using some cross-platform serialization protocols which are already
very well optimized?

I am considering things like Protocol Buffers or even Google's FlatBuffers.


Daniele
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Daniele Baroncelli
2015-07-31 00:07:33 UTC
Permalink
if I want to pass some complex structure I would better use a string serialized JSON.
Sorry, I didn't explain it properly.
I meant, in case I want my Go functions to return a complex data structure to the native language, at the moment being limited in terms of types, I would make my function return a string containing a serialized JSON, which allows to return any type of data structure.

This made think that Go/native binding could actually br based on serialization protocols like protobuf and flatbuffers, which have the advantage of being very well optimized and supporting already all types.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Daniele Baroncelli
2015-07-31 01:56:01 UTC
Permalink
I have never used flatbuffers, but it seems incredibly fast to
encode/decode:
https://google.github.io/flatbuffers/md__benchmarks.html
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Darren Hoo
2015-07-31 02:17:13 UTC
Permalink
I find it is much easier to use MsgPack, and it supports many languages
that includes Go, and it supports `go generate` just as native as JSON does.
Post by d***@gmail.com
I have started playing with the GoMobile packages, and I must say it's
very promising.
I realized that binding types are still very limited at the moment, and if
I want to pass some complex structure I would better use a string
serialized JSON.
I was wondering, instead of writing a custom GoMobile binding mechanism,
why not using some cross-platform serialization protocols which are already
very well optimized?
I am considering things like Protocol Buffers or even Google's FlatBuffers.
Daniele
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Daniele Baroncelli
2015-07-31 02:28:59 UTC
Permalink
Flatbuffers is a Google technology and it uses pointer arithmetics with no
memory allocations.
It's up to 100 times faster than Protobuf.

I was just watching this video about Flatbuffers in Go:

Post by Darren Hoo
I find it is much easier to use MsgPack, and it supports many languages
that includes Go, and it supports `go generate` just as native as JSON does.
Post by d***@gmail.com
I have started playing with the GoMobile packages, and I must say it's
very promising.
I realized that binding types are still very limited at the moment, and
if I want to pass some complex structure I would better use a string
serialized JSON.
I was wondering, instead of writing a custom GoMobile binding mechanism,
why not using some cross-platform serialization protocols which are already
very well optimized?
I am considering things like Protocol Buffers or even Google's FlatBuffers.
Daniele
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...