-
Notifications
You must be signed in to change notification settings - Fork 5
Description
There exist multiple array crates for Rust, and we were wondering with @pwulles how interoperability could be improved.
-
@pwulles started a conversion crate (https://gitlab.com/starcluster/matamorph) that introduces its own matrix reference types, and then implements standard conversion traits to/from the various array crates. Do you have any comments on this approach?
-
In addition/separately one could consider a closer coupling between libraries by implementing
Deref<Target=mdarray::Slice>for any compatible slice types of foreign libraries. I believe that ndarray authors are working on something similar tomdarray::Slice, so if this approach was viable, we could try to synchronize the projects to make sure that the underlying in-memory representations of “array slices” are (at least in some cases?) compatible. I’m not at all sure whether this is a viable approach. It might mean that the respective slice types would have to fully mirror each other’s capabilities and memory representations. Any ideas?
Even with the intermediate type (the approach of “matamorph”), one can hope that the compiler will be smart enough to realize and emit optimal code. So the advantage of having Deref (if that’s even feasible) would be probably mainly about code brevity.