News for hackers. Stuff that matters.
Re:Tour of Rust by twic on Sunday July 12, 2020 @10:46AM (#23811726)
> 'Vec' is a bit awkward from that POV, but then again 'Vector' would be a lot worse

They should just have called it a List, and stopped the propagation of the erroneous belief that a variable-length sequence of things is a vector.

Re:Tour of Rust by remram on Sunday July 12, 2020 @10:56AM (#23811826)
`List` usually refers to a linked list or similar. Vec has the important feature that it encapsulate a contiguous array, which matters in a languages like Rust.
Re:Tour of Rust by xscott on Sunday July 12, 2020 @01:24PM (#23812995)
Python is a very popular language where the list type is implemented as an array, and named a list. Calling these things vectors (C++, Rust) is unfortunate because you eventually want real vectors for working with matrices, and the behavior is different in that context.

As for linked lists, given modern processors and cache behavior, there are very few places where you ever want to chase pointers for a 1D data structure. It seems like a shame to lose a good name to a data structure that should now be avoided most of the time.

Re:Tour of Rust by remram on Friday July 17, 2020 @01:01PM (#23872708)
An array of references. Plus, Python has no way to consume a contiguous array directly.

If you do interoperate through FFI with code in C or similar, you will have to reach for numpy arrays, which are the typed, contiguous arrays of Python.

Re:Tour of Rust by twic on Sunday July 12, 2020 @01:31PM (#23813057)
> `List` usually refers to a linked list or similar.

No, it doesn't. There are a handful of languages where this is true, and no reason other than language-specific practice to think that a list is implicitly a linked list. People always make this objection and it's honestly just bizarre.

Re:Tour of Rust by ImprobableTruth on Sunday July 12, 2020 @10:55AM (#23811824)
Or - since lists call to mind a very specific data structure (linked lists) - they could have just called it Sequence.
Re:Tour of Rust by FnuGk on Sunday July 12, 2020 @12:19PM (#23812421)
A sequence does not contain duplicates. A vector can
Re:Tour of Rust by detaro on Sunday July 12, 2020 @12:21PM (#23812440)
Mathematical sequences totally can have duplicates. E.g. to take a popular example, the Fibonacci sequence starts: 0, 1, 1, ...