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

Note: Use the alias ucsi::macros::cast::cast_si_value.

the macros module does not seem to be exported. iirc (some editions of?) rust only allows exporting macros at the root of a crate.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.