Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Cut of Unit-Aware Value System ( Length ) #5

Open
joeyame opened this issue Jul 25, 2022 · 1 comment
Open

Initial Cut of Unit-Aware Value System ( Length ) #5

joeyame opened this issue Jul 25, 2022 · 1 comment
Labels
Disaster Aversion Tasks that help mitigate future disasters

Comments

@joeyame
Copy link
Owner

joeyame commented Jul 25, 2022

Part of making a good, easy to use sim framework mandates a physical value-tracking system that ensures unit-safe operations.

Such a system should have 3 properties (for now just assume length):

  1. Lengths can be added, subtracted from each other.
  2. Lengths can be scaled by a given unitless factor.
  3. Trying to multiply lengths together causes an error ( no Area types exist yet )
  4. We can pull any length unit out of a Length object and it will automatically convert as needed (1m.get(feet) == 3.28084)
@joeyame joeyame added the planned Tasks that are a part of the current plan label Jul 25, 2022
@joeyame joeyame added this to the Idiomatic Values milestone Jul 25, 2022
@joeyame
Copy link
Owner Author

joeyame commented Jul 26, 2022

Investigate:

  1. https://crates.io/crates/quantities
  2. https://crates.io/crates/fts_units
  3. https://crates.io/crates/dimensioned

These libraries either provide their own units, or give devs the ability to define their own.

@joeyame joeyame added Disaster Aversion Tasks that help mitigate future disasters and removed planned Tasks that are a part of the current plan labels Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Disaster Aversion Tasks that help mitigate future disasters
Projects
None yet
Development

No branches or pull requests

1 participant