tarcieri/micromath

2.0 release

Closed this issue · 2 comments

Since the vector feature uses generic-array, I thought I'd take a look at porting it over to const generics now that Rust 1.51 stabilized min_const_generics.

It seems given the current way the vector types are structured, that isn't possible as the axes are defined using an associated type and support for generic parameters requires const_generics, not min_const_generics.

However, I'm also noticing the way the vector types are implemented is... not great.

I do still like the use of discrete x, y (and for 3D vectors, z) coordinates which more or less follows existing Rust embedded conventions. However these are defined using macros with separate structs for each type, as opposed to making the coordinates generic.

I think perhaps by refactoring to make the coordinates generic, and reducing the trait portion to just the functionality shared by 2D and 3D vectors, it's possible const generics won't be needed at all.

It'd also be good to address #57.

Perhaps it would make sense to implement the functionality in terms of an F32 newtype, keeping the current F32Ext trait, but making the trait a wrapper for the newtype.

2.0 was released in #87