Hacker News new | ask | show | jobs
by nine_k 1202 days ago
Purely-functional data structures are known for quite some time [1]. I can imagine that the very same approaches can be used to organize functions (the whole interdependency graphs of them), so that an update produces a new version with relevant parts changed, while the previous version remains there, completely unchanged. An IDE, or some other language tool, can fully automate the necessary legwork.

(It will of course also take some garbage collection mechanism to eventually remove old, disused versions when nobody depends on them any more.)

[1]: https://en.wikipedia.org/wiki/Purely_functional_data_structu...

1 comments

Unison does this. Every function is identified by a hash of its content, so if the content changes, so does its hash. You can have multiple versions of the same function in the same project without any trouble, because there is never any ambiguity.