notes.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Background</title>
  5. <link rel="stylesheet" href="boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
  7. <link rel="home" href="index.html" title="Safe Numerics">
  8. <link rel="up" href="index.html" title="Safe Numerics">
  9. <link rel="prev" href="safety_critical_embedded_controller.html" title="Safety Critical Embedded Controller">
  10. <link rel="next" href="concepts.html" title="Type Requirements">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  13. <table cellpadding="2" width="100%"><tr>
  14. <td valign="top"><img href="index.html" height="164px" src="pre-boost.jpg" alt="Library Documentation Index"></td>
  15. <td><h2>Safe Numerics</h2></td>
  16. </tr></table>
  17. <div class="spirit-nav">
  18. <a accesskey="p" href="safety_critical_embedded_controller.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="concepts.html"><img src="images/next.png" alt="Next"></a>
  19. </div>
  20. <div class="section">
  21. <div class="titlepage"><div><div><h2 class="title" style="clear: both">
  22. <a name="safe_numerics.notes"></a>Background</h2></div></div></div>
  23. <p>This library started out as a re-implementation of the facilities
  24. provided by <a href="http://safeint.codeplex.com" target="_top">David LeBlanc's SafeInt
  25. Library</a>. I found this library to be well done in every way. My main
  26. usage was to run unit tests for my embedded systems projects on my PC.
  27. Still, from my perspective it had a few issues.</p>
  28. <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
  29. <li class="listitem"><p>It was a lot of code in one header - 6400 lines. Very unwieldy to
  30. understand, modify and maintain.</p></li>
  31. <li class="listitem"><p>I couldn't find separate documentation other than that in the
  32. header file.</p></li>
  33. <li class="listitem"><p>It didn't use <a href="http://www.boost.org" target="_top">Boost</a>
  34. conventions for naming.</p></li>
  35. <li class="listitem"><p>It required porting to different compilers.</p></li>
  36. <li class="listitem"><p>It had a very long license associated with it.</p></li>
  37. <li class="listitem"><p>I could find no test suite for the library.</p></li>
  38. </ul></div>
  39. <p>Using later versions of C++ and the its standard library, template
  40. metaprogramming and <a href="http://www.boost.org" target="_top">Boost
  41. libraries</a> I managed to (re)implement similar functionality in under
  42. 2000 ? lines of code. I promoted this version as a possible submission to
  43. the Boost. The feedback I received convinced me that no such library would
  44. be considered acceptable to the large majority of C++ programmers. It seems
  45. that the desire for maximum performance overrides any requirement that a
  46. program be known to be free of bugs. By this time I had a better idea of the
  47. opportunities available with the latest version of C++ (C++14) and resolved
  48. to address this issue by creating a library which would provide all the
  49. facilities of safe numerics at minimal runtime cost. The result is what you
  50. see here. The library now consists of 7000 lines of code, approximately 50
  51. separate tests and more than 60 pages of documentation and examples.</p>
  52. <p>Since I wrote the above, I've been contacted by David LeBlanc. He's
  53. been updating his package and informs me that the latest
  54. version:</p>
  55. <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
  56. <li class="listitem"><p>SafeInt does not require porting for different compilers, is
  57. fully supported on gcc, clang, and Visual Studio.</p></li>
  58. <li class="listitem"><p>The license has been changed from MS-PL to MIT license.</p></li>
  59. <li class="listitem"><p>The library has had a test suite since before it was public, and
  60. is now located here:</p></li>
  61. <li class="listitem"><p>SafeInt also has no external dependencies other than standard
  62. library files, and doesn't need anything else installed to
  63. work.</p></li>
  64. </ul></div>
  65. <p>His current package can now be found at in <a href="https://github.com/dcleblanc/SafeInt" target="_top">github</a>.</p>
  66. </div>
  67. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  68. <td align="left"></td>
  69. <td align="right"><div class="copyright-footer">Copyright &#169; 2012-2018 Robert Ramey<p><a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">Subject to Boost
  70. Software License</a></p>
  71. </div></td>
  72. </tr></table>
  73. <hr>
  74. <div class="spirit-nav">
  75. <a accesskey="p" href="safety_critical_embedded_controller.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="concepts.html"><img src="images/next.png" alt="Next"></a>
  76. </div>
  77. </body>
  78. </html>