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.

1
  • 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)"
    – tencnivel
    May 29, 2019 at 12:07
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."

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.