8 comments

[ 4.0 ms ] story [ 28.2 ms ] thread
being immutable and being functional aren't even close to the same thing. It just so happens that git's object db is immutable, although even then it depends what you're talking about.

It's most interesting property is that it's content-addressable, but still has tons of mutable elements, refs, symbolic refs, config keys, the notes infrastructure (kinda).

When the post makes an argument that Git _is_ a functional data structure, this refers to a mental model of how to think about git.

Of course there are mutable elements, such as branch pointers etc. Also, a functional data structure also does non-functional tings underneath, such as modifying references. The important thing to note is that it provides a _view_ that can be thought of as immutable and functional.

My point is that "functional" is meaningless in this context. "Compatible with purely functional programming" maybe, but "functional" tells you nothing, especially when you can't embed computation (functions) in a git database without some extra abstraction.
Perhaps it would be more accurate to say that a subset of the Git repo is a purely functional data structure. Wouldn't that be true?

Probably a larger portion if the Git repo is --bare.

Isn't the word he's looking for 'persistent' ? http://en.wikipedia.org/wiki/Persistent_data_structure
He explains his word choice near the end of the article:

(Another name for functional data structures are persistent. I've avoided this term not to confuse it with the notion of storage on persistent media like a physical disc.)

Yeah. The naming choice is a reference to Chris Okasaki's book Purely functional data structures.