As I understand it Unison tries to do something like that but that might be wrong.
https://www.unison-lang.org/