Skip to content
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

String ⊂ Atom ⊂ UUID? #18

Open
cblp opened this issue Jun 25, 2018 · 7 comments
Open

String ⊂ Atom ⊂ UUID? #18

cblp opened this issue Jun 25, 2018 · 7 comments

Comments

@cblp
Copy link
Collaborator

cblp commented Jun 25, 2018

Can a UUID be an atom? Can an atom be a string? How does UTF-8 string fit in 16 bytes?

@gritzko
Copy link
Owner

gritzko commented Jun 26, 2018

An atom is either (1) UUID or (2) int or (3) string or (4) float.

The internal Cursor representation uses 16 bytes for either. For strings, that is a range in the buffer. Only UUIDs must be parsed fully. Cause UUDs are read and interpreted by reducers. Values typically aren't.

see the README

An op is a tuple of four "key" UUIDs and zero or more "value" atoms.

@gritzko
Copy link
Owner

gritzko commented Jun 26, 2018

You are mixing the formal model and implementation details here.

@cblp
Copy link
Collaborator Author

cblp commented Jun 26, 2018

I'm reading uuid.md only. The document says:

  1. uuid is 16 bytes long
  2. if 31—30 bits of uuid are "01", then it is internal: RON atom (int, float, string)

what does it mean then?

Do formal model and implementation details contradict?

@gritzko
Copy link
Owner

gritzko commented Jun 26, 2018

I should probably remove that.

That's how cursors keep atoms internally. Shouldn't be part of uuid.md.

@cblp
Copy link
Collaborator Author

cblp commented Jun 26, 2018

Looks like it is atom specification. A bigger thing is described inside a smaller thing. That's why it causes misunderstanding.

So, we need a separate document describing atoms and how strings are encoded inside them.

@gritzko
Copy link
Owner

gritzko commented Jun 26, 2018

I should make a single document explaining atoms, then ops, then frames, then po logs, then mappers, I guess. With pictures. Formal texts are heavy to read.

@gritzko gritzko added the todo label Jun 26, 2018
@lambdafu
Copy link

Started something a little bit here: https:/lambdafu/swarm-doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants