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

Rename "tuple" to "vector" in SSZ spec #794

Merged
merged 1 commit into from
Mar 17, 2019
Merged

Conversation

JustinDrake
Copy link
Contributor

To be done in combination with #777.

Also:

  • Define "fixed-size" and "variable-size" more rigorously
  • Use " vs ' consistently
  • Add missing "

To be done in combination with #777.

Also:

* Define "fixed-size" and "variable-size" more rigorously
* Use `"` vs `'` consistently
* Add missing `"`
Copy link
Contributor

@vbuterin vbuterin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@JustinDrake JustinDrake changed the title Rename "vector" to "tuple" in SSZ spec Rename "tuple" to "vector" in SSZ spec Mar 17, 2019
@JustinDrake JustinDrake merged commit 390ece7 into dev Mar 17, 2019
@pipermerriam
Copy link
Member

I know this was already merged, but what is the motivation on using vector instead of tuple? The tuple language lines up nicely with the concept that already exists in the ABI encoding spec and python's concept of Tuple types.

@pipermerriam
Copy link
Member

Was struct considered? Seems like "Struct" would likely carry the most semantic meaning across many languages.

@JustinDrake
Copy link
Contributor Author

See #777. Basically we want to convey an "ordered fixed-length homogeneous collection of values" in one word. "tuple", "array", "vector", etc. were considered. Python tuples are not homogeneous, and using Tuple may cause a clash with type hinting since we want to be explicit about the length.

struct would be fine for containers. (That's the terminology used in Go.)

@pipermerriam
Copy link
Member

👍 I think struct is significantly better than vector, I'll create a PR today unless someone is opposed.

@JustinDrake
Copy link
Contributor Author

JustinDrake commented Mar 18, 2019

Wait, struct is good for ordered heterogenous collection of values, right? Vector is for homogeneous stuff.

It's unfortunate there's a bikeshedding surface here. At the end of the day, the spec mostly needs to be consistent and implementers will use whatever terminology is most appropriate for their language. (E.g. in Go it would be struct, array, slice instead of container, vector, list.)

@pipermerriam
Copy link
Member

pipermerriam commented Mar 18, 2019

blarg, ignore me, shouldn't comment on pull requests first thing in the morning before shower and coffee.

Long live vectors!

wemeetagain added a commit to ChainSafe/ssz-js that referenced this pull request Mar 19, 2019
Align with spec naming, see:
ethereum/consensus-specs#794
pipermerriam pushed a commit to pipermerriam/eth2.0-specs that referenced this pull request Mar 28, 2019
To be done in combination with ethereum#777.

Also:

* Define "fixed-size" and "variable-size" more rigorously
* Use `"` vs `'` consistently
* Add missing `"`
@hwwhww hwwhww deleted the JustinDrake-patch-15 branch March 29, 2019 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants