chapel icon indicating copy to clipboard operation
chapel copied to clipboard

Review the Sort module name for stabilization

Open lydia-duncan opened this issue 1 year ago • 2 comments

We suspect this will probably be the name we use for it, but it's worth actually discussing and deciding that, especially since we've talked about the module recently in blogs.

If we stabilize it independent of the contents of the module, we will want to make sure to mark the symbols within it unstable until we've had a chance to review

lydia-duncan avatar Apr 05 '24 21:04 lydia-duncan

I like the current name, myself. Short, sweet, straightforward. Sorting is the other main option that comes to mind, but I don't know if the incremental benefit is worth the pain of switching.

bradcray avatar Apr 05 '24 21:04 bradcray

In an offline discussion today, we discussed keeping the module name of Sort, pending a review of other languages

I took a quick look at what the "Sort" module looks like in other languages

  • Python: sorted is an always available function, some types like list have a sort mutating method
  • C++: The header algorithm provides std::sort, which mutates the original array
  • Rust: sort is a mutating method on a vector
  • Julia: sort is an always available function that returns a new sorted array
  • Swift: .sort() is a mutating method on an array/list

It seems these languages all provide sort by default, without needing to import a module.

jabraham17 avatar May 20 '24 21:05 jabraham17

@jabraham17 - do these other languages have an equivalent to a module name associated with sort even though it is included by default?

mppf avatar May 21 '24 13:05 mppf

do these other languages have an equivalent to a module name associated with sort even though it is included by default?

Some of them have modules, but the majority have sort methods of some kind.

  • Python: no, sorted is a builtin function and sort is a method on builtin types
  • C++: yes, std::sort comes from algorithm
  • Rust: kinda, sort is a builtin method, but there are sort crates. Two I found where sort (insertion sort, quick sort, etc) and sorting (which is a joke-sort module).
  • Julia: Although sort is available by default, I think its in a module called Sort. (I could be wrong, I am not very familiar with Julia)
  • Swift: sort is a method on arrays

jabraham17 avatar May 21 '24 17:05 jabraham17

This has been resolved, we are keeping the name Sort

jabraham17 avatar Jul 12 '24 21:07 jabraham17