I have some edits I'd like to send, but one thing I've been meaning to discuss is the sort function.  What was the motivation for this sort order?

Is sorting a heterogeneous array something we want to support?

We also need to define ordering within a type.  Numbers are easy.  What about strings?  Should we take collation/locale into account?  What do you compare arrays/objects?  Are smaller arrays less than larger arrays?  What about with objects?