Julia type displaying change between versions

Anything actionable here? Seems like not. Printing of some types changed as part of a general overhaul to make printing of complex parametric types simpler and cleaner. Actual type information didn’t change, just printing of aliased parametric types. This can break some doctests, which is annoying, but doesn’t affect the behavior of code that isn’t reflecting on and relying on specific printing of types.

There also seems to be a long discussion about whether matrices are vectors of vectors. They aren’t, of course, but there’s some discussion about whether it’s a good idea to try to treat them as if they are to some extent. Numpy is forced to do this somewhat because they need to go back and forth between plain Python lists and real multidimensional arrays in numpy. This correspondence is required since they use Python lists as the literal syntax for numpy arrays and Python doesn’t have multidimensional lists, so the only option for using lists to represent multidimensional arrays is to use a lists of lists. Of course, Numpy doesn’t go all the way, which we can see from this example since x and y have very different APIs. If Numpy was truly committed to treating matrices and vectors of vectors the same way then y[0,0] would be a valid way to index into a vector of vectors and x[0][0] would be a valid way to index into a matrix. I’ll note that I also have my usual strong distaste for the fact that what the code means depends on a dynamic runtime property—whether all the vectors in your vector of vectors happen to have the same length or not. This is a classic footgun where code goes :boom: in some special case you probably didn’t expect. How do you force Numpy to actually give you a vector of vectors when that’s what you want, even if they all happen to have the same length?

Julia is in a quite different situation since the standard array type is multidimensional and the language has direct syntax for n-dimensional array literals. So there’s no reason to use nested arrays as a bad proxy for real multidimensional arrays. It’s interesting that a limitation of Python has somehow become interpreted from one point of view as a virtue. It’s all about what you’re used to, I suppose.

25 Likes