@codewiz the main point is that it's a nuanced issue out of scope for chrono. Any halfway solution would achieve very little and lower the quality of the library. The arithmetic bound checking is universally applicable, so it would be kind of silly to have something for durations that you couldn't use for other types. Also imposing any sort of compile-time, run-time or maintenance overhead any such checks would bring is nonsensical in a world where everyone in every other application of arithmetic is perfectly happy to just use a type that is assumed to be "large enough" to represent any value. Most just want to use a 64 bit int, and forget it can overflow, even at nanosecond precision, and some would vehemently argue that even on systems that don't have wide enough words, it should just be emulated in software.
Notices by namark (namark@qoto.org)
-
namark (namark@qoto.org)'s status on Wednesday, 02-Feb-2022 09:38:44 UTC namark -
namark (namark@qoto.org)'s status on Wednesday, 02-Feb-2022 09:38:43 UTC namark @codewiz another thing you could do is define and use your own bound checked literals of different sizes. Here is an example for just plain integers
https://git.sr.ht/~namark/libsimple_support/tree/master/item/source/simple/support/int_literals.hppIf you stick with just one duration type throughout the codebase that would be all you need, otherwise if you want to mix and match duration of different granularity and size, your custom literals can return a wrapper type that would only be implicitly convertible to durations that they can fit in.
-
namark (namark@qoto.org)'s status on Wednesday, 02-Feb-2022 09:38:41 UTC namark @codewiz keeping in mind that it's still a half measure, which won't save your from many potential pitfalls. For anything non trivial you'd still need to do a lot of mental (or pen and paper) calculations to make sure there is no overflow, so literals would be the least of your concerns on that front.
-
namark (namark@qoto.org)'s status on Sunday, 09-Jan-2022 18:10:37 UTC namark @codewiz you seemed to have a problem with the concept so that was an explanation and a proof of concept implementation. Pleasantly surprised it worked at all! If you care about it you should participate, cause as far as I know that is the most developed of any such concepts:
https://github.com/boostorg/safe_numericscommon_type trait sounds like a misnomer, but I imagine chrono didn't have anything better to use. safe_numeric may provide alternatives on that front, though it will likely never be standardized in it's current form. It's much more likely for a more generic numeric library to get in, that would also handle arbitrary precision and provide the safe_numerics functionality as its subset, and probably not called "safe" cause that's not a very good name either.
-
namark (namark@qoto.org)'s status on Sunday, 09-Jan-2022 11:26:50 UTC namark @codewiz exception, abort or compiler error?
yes
https://yewtu.be/watch?v=93Cjg42bGEw
https://www.boost.org/doc/libs/develop/libs/safe_numerics/doc/html/index.html
-
namark (namark@qoto.org)'s status on Wednesday, 15-Jan-2020 14:51:04 UTC namark @retiredguru @freemo I would suggest not basing the wording on who they are but rather how they behave in qoto. Just like accounts that are primarily aimed at advertising goods and services, account that are primarily aimed at spreading nonsensical claims on nature of things with no basis in any scientific theory could be disallowed.
If someone is a "flat earther" or an "icosahedron mooner" or whatever, but refrains from spamming their beliefs in qoto, and otherwise engages in meaningful conversations/interactions I see no reason to force them to leave.
On the other hand if someone is a professor in some respected university, but decides to troll qoto with bogus theories just to demonstrate their superior knowledge and debate skills, there is no reason to let them stay.
-
namark (namark@qoto.org)'s status on Sunday, 12-Jan-2020 21:40:39 UTC namark @freemo next poll:
[ ] emacs
[ ] emacs!
[ ] emacs!!
[ ] emacs!!! -
namark (namark@qoto.org)'s status on Thursday, 09-Jan-2020 18:05:32 UTC namark @freemo but say I want to make a post about mercury language, and absolutely nobody around knows what it even is, I get no tag? Maybe other way around - give me the first vote on the tags to make the post visible, then let others reinstate/add/remove tags through voting.
Another thing is that this kind of a system will be easy to exploit, without a reputation system like in stackoverflow. Statistics don't work in small numbers, so a small group could actively silence a new/unpopular user, by exploiting filtering behavior. You could have some kind of a limit on votes cast before statistics applied, but then it kind of defeats the purpose of filtering, since it could be that "a big enough number of people who need to see the post(and vote on it) for statistics to kick in" is also "all people who will ever see the post", given that mastodon is mostly about quick continuous interactions, rather than long living publications.
Of course you can have moderators, now to moderate misbehaving taggers, but I'm not sure if that would make things easier or harder.
And finally if you're making a tag/category system pleaseee make it a tree, don't make it a list pleaseeee
-
namark (namark@qoto.org)'s status on Wednesday, 08-Jan-2020 23:18:39 UTC namark I spend several minutes to convince myself that all common divisors of two natural numbers are divisors of their greatest common divisor... no wonder my projects move at a snail's pace.