Rob Pike
unread,Feb 26, 2013, 2:43:59 PM2/26/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to tracey....@gmail.com, golan...@googlegroups.com, Kyle Lemons
The problem is one of intended use. I intended the interface support
to be a rarely-used thing, developed with a specific application in
mind, allowing one to transport a behavior across the network. But
people see it, think 'interface{}', and use the mechanism to avoid
thinking about types on the wire, treating it as a sort of generic
Object. It's just lazy, and it's very expensive to do this, since
every interface value needs a type string along with it, and it
interrupts the stream flow.
Used well, gobs can be efficient. You send a stream, not a value, and
you send repeated items of a defined static type, not a one-off. The
interface support violates both of those conditions.
Instead of sending interfaces all over, send concrete data types when
possible. They're much more efficient and lead to better design. If
you're sending interface{} using gobs, you're doing it wrong.
And functions on the wire: they'll never work, not this way anyway.
Try Erlang instead.
-rob