Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Julia: how stable are serialize() / deserialize()

I am considering the use of serialize() and deserialize() for all of my data i/o due to their convenience. I do not, however, want to be stuck with unreadable files on a Julia update.

How stable are serialize() and deserialize()? Should they work between updates of 0.3? Can I expect safe behavior if I stick to basic types like arrays of Float64?

Thank you.

like image 206
Mageek Avatar asked Jul 25 '14 14:07

Mageek


People also ask

What is the difference between serialize and deserialize?

Serialization is a mechanism of converting the state of an object into a byte stream. Deserialization is the reverse process where the byte stream is used to recreate the actual Java object in memory. This mechanism is used to persist the object. The byte stream created is platform independent.

Why do we need to serialize and deserialize data?

Serialization is the process of converting an object into a stream of bytes to store the object or transmit it to memory, a database, or a file. Its main purpose is to save the state of an object in order to be able to recreate it when needed. The reverse process is called deserialization.

Why do we need to serialize JSON?

The purpose of serializing it into JSON is so that the message will be a format that can be understood and from there, deserialize it into an object type that makes sense for the consumer.

What does deserialize object do?

Deserialization is the process of reconstructing a data structure or object from a series of bytes or a string in order to instantiate the object for consumption. This is the reverse process of serialization, i.e., converting a data structure or object into a series of bytes for storage or transmission across devices.


2 Answers

If you want to store data you might depend on being able to read in the future, you should not use a format that will incorporate breaking changes if/when someone finds it useful. As far as I understand the default serialization format is for network communications, so it is designed for maximum performance.

There is also the HDF5.jl package that uses a documented format and a common library that has wrappers for different languages.

like image 177
ivarne Avatar answered Sep 19 '22 15:09

ivarne


I believe the official answer here is, "people will try not to break the serialization format, but you shouldn't depend upon on it."

like image 33
John Myles White Avatar answered Sep 22 '22 15:09

John Myles White