Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
I think the Golang serialization API is utter garbage.
By convention it usually looks like this,
MarshalFormat() ([]byte,error)
UnmarshalFormat([]byte) error
This means that all serialization and deserialization is done on, heap allocated, in memory buffers ( technically also mmaped files, but thats not cross platform).
As the Go GC is ruthlessly optimized for minimum latency, this can potentially cause memory leaks in long running applications.
I think we need a new serialization API that looks more like
SerializeFormat(io.Writer) error
DeserializeFormat(io.Reader) error
rant