8

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.

1

2 Answers 2

7

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.

Sign up to request clarification or add additional context in comments.

the problem with HDF5 is that there are types that you can't serialize. For example, I just got the following error when trying to serialize a GLM model: "MethodError: no method matching write(::HDF5File, ::String, ::StatsModels.DataFrameRegressionModel)"
5

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

You can treat the combination of the official docs with Jeff's comment on this diff as a citation. julia.readthedocs.org/en/latest/stdlib/base + github.com/JuliaLang/julia/commit/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.