3 ms·
These are two different types in Julia. The first is an array of numbers. The second is an infinite set of types, namely "all arrays which have Number or a subt
by jakobnissen 6y ago
These are two different types in Julia. The first is an array of numbers. The second is an infinite set of types, namely "all arrays which have Number or a subtype of Number as its element type".
There is a distinction, because e.g. `Array{Int32}` is a subtype of the latter, but not the former (because the former is a concrete types that does not have subtypes).
- newswasboring 6y agoBut that seems very fine and specific to me. I don't understand why it shouldn't be allowed to be like this.
- xiphias2 6y agoArray{Number} is an array of objects with unknown type and size, basically an array of pointers with possibly totally different method implementations. Array{:<Number} is when LLVM gets the exact type at compile time and can optimize the code using SSE instructions. You have a factor of 10 between execution, and if you are not experienced, you don't understand why your code is slow and why the garbage collector kicks in so hard.