External Term Format backwards compatibility

Is there a guarantee that future versions of Erlang will be backwards compatible with ETF generated using :erlang.term_to_binary/2 in any old version? I.e. that it can read it back, not necessarily write.

AFAIK the format is stable (there are small and fixed set of data types) - but you can get into trouble with application-defined things like structs with required fields that change.

1 Like

That’s my thought too but would be nice to know from an authoritative source. I have already taken care of struct issues with a migration system. :slight_smile:

From the docs:

Erlang nodes can communicate across at least two preceding and two subsequent releases.

Since distributed Erlang uses external term format, this guarantee should also hold for term_to_binary & binary_to_term.

2 Likes