3 ms·
I’m curious if anyone knows what approach Owl takes to making sure float arrays, complex arrays, etc. are unboxed. (Or if it leaves them boxed.)
by StefanKarpinski 4y ago
I’m curious if anyone knows what approach Owl takes to making sure float arrays, complex arrays, etc. are unboxed. (Or if it leaves them boxed.)
- nerdponx 4y agoScientific computing libraries in languages like Python generally represent the array itself as a "boxed" native language object, but internally the numbers are represented by a true contiguous array. I would be surprised if Owl did it differently.
- StefanKarpinski 4y agoI guess that’s pragmatic but having native arrays and “scientific arrays” be totally different incompatible things is just so unsatisfying.
- lapinot 4y agoI don't know if OWL rolls its own thing, but there is a "numeric nd-array" type in the standard library in ocaml [1]. In any case "native arrays" in ocaml or other are dynamic vectors, so it wouldn't make any sense to build numeric arrays on top of that. And in ocaml you're probably using inductive lists or trees more than dynamic vectors.. So it's not really "unsatisfying": different datastructures for different needs. [1] https://v2.ocaml.org/api/Bigarray.html https://v2.ocaml.org/api/Bigarray.html
- lapinot 4y agoSo just for reference, OWL is using Bigarray under the hood for dense array. OWL seems to be doing all the things right, great deal of modularity and abstractions but compiling everything down to the most efficient representations.