modularml / mojo

The Mojo Programming Language
https://docs.modular.com/mojo/manual/
Other
22.96k stars 2.59k forks source link

[Feature Request] Rename `DynamicVector` and friends #1761

Open soraros opened 7 months ago

soraros commented 7 months ago

Review Mojo's priorities

What is your request?

Rename DynamicVector and friends to something more sensible. Like DynamicArray, and InlinedFixedVector could simply be Array, etc.

What is your motivation for this change?

I find "dynamic vector" a bit tautological, given the "vector" terminology (likely) comes from C++, which literally means "dynamic sized array". InlinedFixedVector is even worse, not really dynamic dynamic array, but I guess double negation elimination is a thing.

Any other details?

No response

JoeLoser commented 7 months ago

Thanks for filing the GH issue after the Discord discussion. I kick-started a discussion last week with the Standard Library team and broader Mojo users internally. We've decided on a new name for DynamicVector and we'll communicate the upcoming renames in the changelog. Still need to decide on a new name for InlineFixedVector.

gryznar commented 7 months ago

@JoeLoser could you please take a look at this issue: https://github.com/modularml/mojo/issues/1528? This is also related to renaming and will be the best to take steps with this sooner than later :)

JoeLoser commented 7 months ago

@JoeLoser could you please take a look at this issue: #1528? This is also related to renaming and will be the best to take steps with this sooner than later :)

👍 just replied over there, thanks for pointing me at it. It's definitely something we need to do, but all of the name changes won't happen in the next month or so given other things going on internally that are more urgent related to supporting other teams and getting things in order for open-sourcing the stdlib.

nmsmith commented 6 months ago

@JoeLoser As part of the rename, may I suggest also renaming CollectionElement to CollectionItem? This would improve consistency with the getitem, setitem, and delitem dunder methods which currently manipulate "Elements" despite their name implying that they manipulate "Items".

As a separate issue, the type parameter of DynamicVector (and related types) should probably be named Item instead of T, since that is more descriptive/self-documenting.

soraros commented 5 months ago

Now the DynamicVector is gone, what about