No, you simplified the problem to be one that is SymEngine on arrays, not SymEngine on graphs reinterpreted as vectors. That’s a substantially simpler problem, but it also highlights the Pythran point. Does this simplified version of the problem work on the Pythran version? Does the original problem I proposed work with the Pythran or C++ broadcast implementations? Obviously the answer is no (the C++ one is tied to an xtensor array type, and the Pythran one cannot handle the number types), yet this is an example that I pulled out of my standard morning Julia routine. Usually a counter example like that would have people concede the falsity of a statement like:
And the other point to that of course is that of course Julia has row-major, column-major, and strided arrays that are compatible with broadcast. They aren’t even in packages, they are built into Base. Transpose{T,Matrix{T}}
is a row-major matrix and it’s a very commonly used type (of course, if you have column-major matrices implementing the row major matrix via Transpose in the type system and having that handle the reformatting of the loops is quite nice). Julia’s Base comes with many different strided arrays depending on what you need:
julia> StridedArray
Union{DenseArray{T,N}, ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, ReshapedArray{T,N,A,MI} where MI<:Tuple{Vararg{SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where
A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, SubArray{T,N,A,I,L} where L where I<:Tuple{Vararg{Union{Int64, AbstractRange{Int64},
AbstractCartesianIndex},N} where N} where A<:Union{ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, ReshapedArray{T,N,A,MI} where MI<:Tuple{Vararg{SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T,
SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, DenseArray}} where N where T
each of those generic within themselves as well.
Yeah, I don’t think anyone would disagree with that. Julia and Pythran are doing very different things.