Quantcast

[safe_numerics] Review

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[safe_numerics] Review

Boost - Dev mailing list
Last minute review here. This will be short and sweet.

> What is your evaluation of the design?

I like it. The "drop-in replacement" approach is easy to understand.

> What is your evaluation of the implementation?

It's more complicated than I expected, but if it works, it works. I think the
runtime checks in this library might be good candidates for
BOOST_[UN]LIKELY.

Are there test cases for post decrement? The implementation
appears to return a reference to local:

https://github.com/robertramey/safe_numerics/blob/master/include/safe_base.hpp#L251

safe_base & operator--(int){ // post decrement
    safe_base old_t = *this;
    --(*this);
    return old_t;
}

If I'm reading correctly, this is UB (and likely a segfault).

> What is your evaluation of the documentation?

The documentation is quite thorough. A "cheatsheet" page would
be nice, because most of the documentation is rather in-depth. There
are many bells and whistles documented that end users might not want
to sift through. I'm not sure what this would look like, though.

The FAQ appears to be formatted strangely.

Notes about bitwise operators in the FAQ might be nice (signed right-shift
especially).

Very nice job overall. Much work and thought went into this.

> What is your evaluation of the potential usefulness of the library?

Useful. I'd consider using it in applications that are not latency-sensitive,
perhaps if only in debug mode. Detecting accidental unsigned underflow is
especially useful.

I do think this library might be much more useful with floating point
support, if
it is eventually added.

> Did you try to use the library? With what compiler? Did you have any
   problems?

No.

> How much effort did you put into your evaluation? A glance? A quick
   reading? In-depth study?

3 hours reading documentation, source code, and previous reviews.

> Are you knowledgeable about the problem domain?

No more than any CS grad should be.

> Do you think the library should be accepted as a Boost library?

Yes. This library would be a good addition to Boost. I trust
that Robert will address the issues raised in this review and
others (especially Steven's) before this library would be shipped
with a future Boost release, should it be accepted.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [safe_numerics] Review

Boost - Dev mailing list
On 3/11/17 4:32 PM, Barrett Adair via Boost wrote:
> safe_base & operator--(int){ // post decrement
>     safe_base old_t = *this;
>     --(*this);
>     return old_t;
> }
>
> If I'm reading correctly, this is UB (and likely a segfault).
correct - fixed
>
>
> I do think this library might be much more useful with floating point
> support, if it is eventually added.

indeed.

Want to voluteer?

I'm sure that floating point would end up a lot more complex than first
meets the eye though.

Robert Ramey


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [safe_numerics] Review

Boost - Dev mailing list


> -----Original Message-----
> From: Boost [mailto:[hidden email]] On Behalf Of Robert Ramey via Boost
> Sent: 12 March 2017 05:37
> To: [hidden email]
> Cc: Robert Ramey
> Subject: Re: [boost] [safe_numerics] Review
<snip>

> > I do think this library might be much more useful with floating point
> > support, if it is eventually added.
>
> indeed.
>
> Want to voluteer?
>
> I'm sure that floating point would end up a lot more complex than first
> meets the eye though.

"Die ganzen Zahlen hat der liebe Gott gemacht, alles andere ist Menschenwerk."

Integers are made by the Good Lord, all others are man's work.
 -- Leopold Kronecker

;-)

Paul



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [safe_numerics] Review

Boost - Dev mailing list
On 3/12/17 3:32 AM, Paul A. Bristow via Boost wrote:

>
>
>> -----Original Message-----
>> From: Boost [mailto:[hidden email]] On Behalf Of Robert Ramey via Boost
>> Sent: 12 March 2017 05:37
>> To: [hidden email]
>> Cc: Robert Ramey
>> Subject: Re: [boost] [safe_numerics] Review
> <snip>
>
>>> I do think this library might be much more useful with floating point
>>> support, if it is eventually added.
>>
>> indeed.
>>
>> Want to voluteer?
>>
>> I'm sure that floating point would end up a lot more complex than first
>> meets the eye though.
>
> "Die ganzen Zahlen hat der liebe Gott gemacht, alles andere ist Menschenwerk."
>
> Integers are made by the Good Lord, all others are man's work.
>  -- Leopold Kronecker
>
> ;-)
>

Very clever and appropriate.  Among the "others", we can count integers
represented by computers.

Since you've ventured off topic into "funny" incidents.  Here's mine

tl;dr;
A number of years ago 2010? BoostCon (C++Now) was casting about for a
keynote speaker.  I suggested William Kahan (a professor of mine in
1970)- well known mathematician responsible for design of the 8087
floating point processor, IEEE784 standard and winner of the Turing
award.  I contacted the program committee.  The first problem was that
no on on the committee had heard of him.  After a litte bit they
suggested I feel him out about being keynote.  I did so and he agreed.
I informed the committee that he would do it.  But they weren't
convinced and kept him for a backup - while they settled on someone
else.  Which would have been OK except that they took way too long to
decide and annoyed Dr. Kahan.  Since I had put myself "out there" on
this I was pretty pissed off.

But the really interesting part of the story is how little computer
programmers of today actually know or care about numbers.  It shows up
all over the place. It's up to a small group of insurgents (boost) to
bring the world to it's senses.

Robert Ramey

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Loading...