3 ms·
I'm still waiting for languages to support 2,3, and 4D vectors as first class data types. These are so common it's silly to have people define them. We end up w
by phkahler 6y ago
I'm still waiting for languages to support 2,3, and 4D vectors as first class data types. These are so common it's silly to have people define them. We end up with different implementations sometimes too.
Please Rust, please!
- legulere 6y agoC# does since recently and also has support for SIMD: https://docs.microsoft.com/en-us/dotnet/api/system.numerics.vector2?view=netcore-3.1 https://docs.microsoft.com/en-us/dotnet/api/system.numerics....
- zelly 6y agohttps://openjdk.java.net/jeps/338 https://openjdk.java.net/jeps/338 https://www.khronos.org/sycl/ https://www.khronos.org/sycl/
- ezluckyfree 6y agoJulia does, and supports SIMD.
- dhosek 6y agoAppleSoft BASIC had multi-dimensional arrays back in 1977. It always bugged me that modern languages didn't support this neatly.
- shele 6y agoFORTRAN had arrays 1956...
- sahil-kang 6y agoHere are some examples showing Common Lisp’s built-in support for multidimensional arrays: https://lispcookbook.github.io/cl-cookbook/arrays.html https://lispcookbook.github.io/cl-cookbook/arrays.html
- MayeulC 6y agoWell... MATLAB (matrix laboratory), and its GNU counterpart Octave kind of do this. The primary data type is an n-dimensional matrix. Of course, there's a lot to say about the rest of the language (and it's untyped/interpreted, though BLAS handles matrix operations so it's extremely fast for vectored code), but it is very nice to work with vast amounts of data in it, and numpy tries to mimic parts of its syntax. That's something I would really like to see in other languages, but depending on the use-case, you can also mix languages... u=rand(5) % 5-by-5 matrix v=rand(5,5,5,5,5,5) % 6-dimensional matrix, each dimension 5 long v2=v(1,2,3,:,:) % 1-by-1-by-1-by-5-by-5 matrix w=u(:,3) % take every line in the third column, so that's a vertical 5-by-1 vector x=5*w*w' % matrix multiplication of w and its transpose, times a scalar y=rand(5).*x % element-wise multiplication