-
Notifications
You must be signed in to change notification settings - Fork 30
Update comparison table #175
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
Conversation
The main goal is to reflect some recent improvements in mp-units.
1. They upgraded their interfaces so that they now _only contain
unit-safe_ interfaces. This turns this row into a "tie".
2. They added new API functions to compare against 0. This is a
different local optimum in design space for handling this problem
than our solution, `Zero`. They considered `Zero` and declined to
add it because of how it interacts with generic interfaces, but I
still think `Zero` is a better solution on balance so I'll leave Au
as "best".
I also re-assessed several other rows, the upshot of which is to turn 3
ties into "best" for mp-units.
1. **Composability.** NTTPs let mp-units write things like
`quantity<meter / second>`, whereas we need to write something like
`Quantity<decltype(Meters{} / Seconds{})>`. This is amazing!
2. **Point types.** Au assumes there's one origin (sometimes implicit)
for each unit. This was really focused on the temperature use case,
and maybe atmospheric pressure. mp-units has APIs to let users set
the origin. This gives much richer possibilities for dealing with
things like altitude, with lots of different possibilities for the
origin. Au can _kind of_ do this by making a new unit for each one,
but I think mp-units' approach is more flexible.
3. **Angles.** The ability to support both dimensioned angles and
"current SI" angles gives mp-units the edge.
I also switched boost units to "not assessed" on Abbreviated
Construction, because Mateusz mentioned they have the same syntax as
mp-units. I had assumed they didn't have anything here because they
don't have literals. If I can see a godbolt link of boost units code
that uses abbreviated construction, then I'll assess the rating based on
that link.
|
|
Point 4. above was merged today. |
We do, but it's not well tested --- nothing on the level of the Representation concept from mp-units. This is reflected in the "Rep variety" row.
Added, thanks!
I did not realize this; thanks! Amusingly, I had obtained the old rating from the chart in P1935. 🙂
Really cool how you can customize explicit/implicit conversions per type! Does it support double-hop? e.g., can you implicitly initialize a I'll call this "good" for both now since each library has a significant feature the other doesn't (assuming there's no double-hop in mp-units).
Updated this row; thanks! |


The main goal is to reflect some recent improvements in mp-units.
They upgraded their interfaces so that they now only contain
unit-safe interfaces. This turns this row into a "tie".
They added new API functions to compare against 0. This is a
different local optimum in design space for handling this problem
than our solution,
Zero. They consideredZeroand declined toadd it because of how it interacts with generic interfaces, but I
still think
Zerois a better solution on balance so I'll leave Auas "best".
I also re-assessed several other rows, the upshot of which is to turn 3
ties into "best" for mp-units.
Composability. NTTPs let mp-units write things like
quantity<meter / second>, whereas we need to write something likeQuantity<decltype(Meters{} / Seconds{})>. This is amazing!Point types. Au assumes there's one origin (sometimes implicit)
for each unit. This was really focused on the temperature use case,
and maybe atmospheric pressure. mp-units has APIs to let users set
the origin. This gives much richer possibilities for dealing with
things like altitude, with lots of different possibilities for the
origin. Au can kind of do this by making a new unit for each one,
but I think mp-units' approach is more flexible.
Angles. The ability to support both dimensioned angles and
"current SI" angles gives mp-units the edge.
I also switched boost units to "not assessed" on Abbreviated
Construction, because Mateusz mentioned they have the same syntax as
mp-units. I had assumed they didn't have anything here because they
don't have literals. If I can see a godbolt link of boost units code
that uses abbreviated construction, then I'll assess the rating based on
that link.