Having fun with Go slices

The fun
Go offers precious few data structures that can be generically typed: queue, map, and slice (including array). This often leaves developers using slices, particularly ordered slices, for all sorts of use cases. I thought it might be fun to create some utilities for slice manipulation, starting with a faster stable sort. I hope in Go 2 we can get generics so data structures like binary trees will be safer.
For those that aren't aware, a stable sort is a sort where two elements with the same key retain their same relative positions as they had in the input. There are several sorting algorithms that support stable sorting, including merge sorts, insertion sorts, and bubble sorts. Efficient implementations of the ever-popular quicksort are not stable.
I've had several use cases for a stable sort in the past so I thought it might be fun to take the stable sort from the standard library and attempt to make it concurrent to improve performance. The standard library's so…
Go offers precious few data structures that can be generically typed: queue, map, and slice (including array). This often leaves developers using slices, particularly ordered slices, for all sorts of use cases. I thought it might be fun to create some utilities for slice manipulation, starting with a faster stable sort. I hope in Go 2 we can get generics so data structures like binary trees will be safer.
For those that aren't aware, a stable sort is a sort where two elements with the same key retain their same relative positions as they had in the input. There are several sorting algorithms that support stable sorting, including merge sorts, insertion sorts, and bubble sorts. Efficient implementations of the ever-popular quicksort are not stable.
I've had several use cases for a stable sort in the past so I thought it might be fun to take the stable sort from the standard library and attempt to make it concurrent to improve performance. The standard library's so…