3 ms·
I guess I formulated not precisely enough. I have not tried to accuse anybody of misusing. From books that I read I got a strong impression that the term "funct
by fpoling 11y ago
I guess I formulated not precisely enough. I have not tried to accuse anybody of misusing. From books that I read I got a strong impression that the term "functional programming" as a term is about treating functions as the first-class entities (or even the only entities). The persistent data structures is orthogonal to this. But I guess I just have to accept that in the field it is a common speak to use "functional algorithms" to mean "algorithms for persistent data structures".
Personally I see this as unfortunate as the persistence as a term IMO is much more precise. It also remains that one also needs GC and properly accounts its cost which this paper discuss a lot.
- RcouF1uZ4gsC 11y agoThe confusion is that you are thinking of function in the programming language sense (i.e. A subroutine ) rather than in the mathematical sense (i.e. A function called with the same arguments always returns the same value). The mathematic definition of function necessitates persistent data structures (i.e. You do not modify the dataset but return a new dataset with the modifications).
- fpoling 11y agoYet persistent data do not imply functional programming. For example, one can work with persistent data structures in Java using global variables to pass references to data structures. One can also implement algorithms from the article using explicit stack to avoid recursion. Yet such atrocities will not change the conclusion of the article that the code will be cache-efficient as long as the runtime is sufficiently smart. So my assumption (which could be wrong) is that by using the word "functional" that article unnecessary restricts its auditory. For example, a Java programmer would not even bother to open it assuming this is something relevant at best to Haskell or F#. I definitely had such expectation.
- RcouF1uZ4gsC 11y agoThe confusion is that you are thinking of function in the programming language sense (i.e. A subroutine ) rather than in the mathematical sense (i.e. A function called with the same arguments always returns the same value). The mathematic definition of function necessitates persistent data structures (i.e. You do not modify the dataset but return a new dataset with the modifications).