Rename Vec to Arr

There's a good article on the origin of = for assignment.

11 Likes

Thanks, that's a sweet little trip though language history.

Arr<s>

No, I'm not being insulting. Just making a joke, honest :slight_smile:

For whatever reason my mind associates "array" with something two dimensional, while "vector" is only one dimensional. So I'm happy with "vector".

Besides "vector" is a much cooler word than "array" and certainly a lot less ugly that "DArray" or "ArrayList", what on Earth do they convey?

Anyway, "Vec" is not "Vector". It's different. So who says it need to have the same mathematical meaning?

As the Rust documentation says:

Struct std::vec::[Vec]

A contiguous growable array type, written Vec<T> but pronounced 'vector'.

Sure. And pub does not mean public. By the way, an fn is definitely not a "function". (Well, also mathematically speaking it really is not actually a function.) And how dare you calling an i32 an integer...

2 Likes

A list backed by an array, instead of some other data structure. I agree it's also confusing (could be a list of arrays), but it is more explicit.

1 Like

Hmm... thankyou for supporting my argument.

"pub" does indeed mean "public" in the UK. As in "Public House".

"fn" may well be shorthand in Rust for "function". But as you note that is not at all the same thing as rigorous definition of a function in mathematics.

And "i32" may well be shorthand for "An integer that can be represented in 32 bits". Again not at all the same as an Integer in mathematics.

Let's face it, the syntax and semantics we have in our programming languages are only vaguely connected to the notation and definitions in mathematics.

On the other hand, we could say that with the symbols and definitions we have in our programming languages we have defined a mathematics of our own. With it's own axioms and theorems.

Especially in Rust which imposes a lot more rules and rigor on what you can, and cannot express in the language.

I suspect the Haskell guys would claim the high ground in presenting mathematics in a programming language. I have no idea, I have never met anyone who understands Haskell.

Hmm, I got it. Let's be more explicit:

let my_array_vector_list_whatever: GrowablePluralityOfElementsStoredInContiguousRegionsOfMemory<f64> = growablePluralityOfElementsStoredInContiguousRegionsOfMemory![0.0;10];

Nah, let's just call it "Vec".

1 Like

Depends how you define mathematics. I'm getting a bit off topic here, but the programming languages mathematicians actually use are languages like FORTRAN, APL, R and Python. Haskell is mathematics, but is a very very specialized form of it.

1 Like

You asked what it meant, I answered. No need to get sarcastic. While I do think that List strikes the right balance here, I can understand why someone might think it could be confused with a linked list.

1 Like

Hmm...

I don't get to define the symbology or meaning in mathematics. Mathematicians do!

I can well imagine that when mathematicians stoop so low as to use computers they use whatever they can get.

Sorry, I did not mean to be sarcastic. Just trying to make a point.

Had I come to Rust and found that "Vec" was actually called "List", and "vec!" was "list!" I would have been just as happy.

This is a "bikeshedding" discussion. But worse, the bike shed has already been built and painted. :slight_smile:

1 Like

Vec is fine.

Could be worse, like C# with Array, ArrayList and List<T>. :laughing:

1 Like

Is the best answer so far.

4 Likes

I think the more common term would be List as it implies changing sizes over time but it is not specific enough.

The correct term would be ArrayList just as it is the case in Java implying it is resizeable and shrinkage/extension would always preserve the laws of an Array/Vector at any time point t.

Perhaps. But "ArrayList" is longer and much uglier.

We already discussed Arr, List, ArrayList and a few others.

Let's bike-shed Buffer – what about that one?

1 Like

What's the purpose? The existing names are set in ferro-concrete as far as Rust is concerned. For me this whole thread is reminiscent of Don Quixote titling at windmills. :rofl:

7 Likes

Yeah, as long as this thread is pretty much 100% practically useless at this point, I think it's time to agree to make a pirate version of strategic-communication programming language that can feature lots of Arr, Argh, Matey and the like:

https://github.com/rotoclone/strategic-communication
We can refactor this program that prints "Hello world" to pirate speak:

align Sales and Legal with customer experience
deliver customer experience
align Marketing and HR with revenue streams
amplify revenue streams
align core competencies with revenue streams
innovate core competencies
deliver core competencies
align Sales with best practices
synergize core competencies and best practices
produce core competencies
deliver core competencies
align PR and Legal with stakeholder engagement
synergize customer experience and best practices
synergize customer experience and stakeholder engagement
deliver customer experience
align Finance and Finance with key performance indicators
deliver key performance indicators
deliver stakeholder engagement
amplify key performance indicators
streamline key performance indicators
deliver key performance indicators
deliver customer experience
align return on investment with core competencies
synergize return on investment and best practices
streamline return on investment
deliver return on investment
deliver core competencies
deliver revenue streams
innovate stakeholder engagement
deliver stakeholder engagement