Ucsi: a compile-time unit-checking system

I've been learning about rust's generic system and constant evaluation lately, so I wrote this library to work on it. (While implementing a brainfuck with a type system might be more academic, I would have preferred to write something more practical.)

Unlike uom, ucsi expresses a type using what I call a unit table, so the user can easily create any type to participate in integration and checking.

Would like guidance on:

  1. Regarding unit expressions: currently derived units do not participate in data operations because const fn cannot yet (in stable rust) be defined in traits;
  2. About pure data: using PureValue to include pure data makes the result of the type of operation difficult to express;
  3. On type-checking results: currently ucsi relies on panic when evaluating trait's associated constants to indicate a type-checking failure, but this could not take advantage of the IDE's derivation.
1 Like