3 ms·
I agree, it would be nice to have a refactoring workflow that every program modification only creates new functions, never changes existing ones. Then we could
by js8 4y ago
I agree, it would be nice to have a refactoring workflow that every program modification only creates new functions, never changes existing ones. Then we could get automated testing of new functions against old functions, or even, automated proof that the change doesn't affect the result.
- nine_k 4y agoPurely-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_structure https://en.wikipedia.org/wiki/Purely_functional_data_structu...
- sparkie 4y agoUnison 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.