Skip to content

Immutable Merkledag #1022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
krl opened this issue Apr 6, 2015 · 4 comments
Closed

Immutable Merkledag #1022

krl opened this issue Apr 6, 2015 · 4 comments
Labels
exp/expert Having worked on the specific codebase is important topic/cleanup Topic cleanup topic/merkledag Topic merkledag

Comments

@krl
Copy link
Contributor

krl commented Apr 6, 2015

"we should start thinking about making Merkledag nodes immutable and having a separate type for changing them"

I'd be interested in having a discussion on this topic, since immutable datastructures is a love of mine. @whyrusleeping could you elaborate?

@whyrusleeping
Copy link
Member

My idea is that we control the creation of the merkledag.Node type. and prevent it from being created by a user, then we introduce a type called merkledag.MutableNode (or something less java-ey) that is used for constructing and modifying dags. Doing this will more closely follow the semantics of 'immutable dags' that ipfs really pushes.

@jbenet
Copy link
Member

jbenet commented Apr 6, 2015

I think:

merkledag.Node  // immutable
merkledag.MutableNode

👍 is a good idea.

(MutableNode is only two words-- not too unidiomatic. if we end up with anything that matches MutableNode(Factory|Abstract)+ though...)

@whyrusleeping
Copy link
Member

merkledag.MutableMerkledagNodeFactoryBuilderImpl.GetFactoryBuilderInstance()

@whyrusleeping
Copy link
Member

closing this for now... things will change with ipld.

@RichardLitt RichardLitt added the exp/expert Having worked on the specific codebase is important label Feb 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/expert Having worked on the specific codebase is important topic/cleanup Topic cleanup topic/merkledag Topic merkledag
Projects
None yet
Development

No branches or pull requests

4 participants