notes.xml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
  4. <section id="safe_numerics.notes">
  5. <title>Background</title>
  6. <para>This library started out as a re-implementation of the facilities
  7. provided by <ulink url="http://safeint.codeplex.com">David LeBlanc's SafeInt
  8. Library</ulink>. I found this library to be well done in every way. My main
  9. usage was to run unit tests for my embedded systems projects on my PC.
  10. Still, from my perspective it had a few issues.</para>
  11. <itemizedlist>
  12. <listitem>
  13. <para>It was a lot of code in one header - 6400 lines. Very unwieldy to
  14. understand, modify and maintain.</para>
  15. </listitem>
  16. <listitem>
  17. <para>I couldn't find separate documentation other than that in the
  18. header file.</para>
  19. </listitem>
  20. <listitem>
  21. <para>It didn't use <ulink url="http://www.boost.org">Boost</ulink>
  22. conventions for naming.</para>
  23. </listitem>
  24. <listitem>
  25. <para>It required porting to different compilers.</para>
  26. </listitem>
  27. <listitem>
  28. <para>It had a very long license associated with it.</para>
  29. </listitem>
  30. <listitem>
  31. <para>I could find no test suite for the library.</para>
  32. </listitem>
  33. </itemizedlist>
  34. <para>Using later versions of C++ and the its standard library, template
  35. metaprogramming and <ulink url="http://www.boost.org">Boost
  36. libraries</ulink> I managed to (re)implement similar functionality in under
  37. 2000 ? lines of code. I promoted this version as a possible submission to
  38. the Boost. The feedback I received convinced me that no such library would
  39. be considered acceptable to the large majority of C++ programmers. It seems
  40. that the desire for maximum performance overrides any requirement that a
  41. program be known to be free of bugs. By this time I had a better idea of the
  42. opportunities available with the latest version of C++ (C++14) and resolved
  43. to address this issue by creating a library which would provide all the
  44. facilities of safe numerics at minimal runtime cost. The result is what you
  45. see here. The library now consists of 7000 lines of code, approximately 50
  46. separate tests and more than 60 pages of documentation and examples.</para>
  47. <para>Since I wrote the above, I've been contacted by David LeBlanc. He's
  48. been updating his package and informs me that the latest
  49. version:<itemizedlist>
  50. <listitem>
  51. <para>SafeInt does not require porting for different compilers, is
  52. fully supported on gcc, clang, and Visual Studio.</para>
  53. </listitem>
  54. <listitem>
  55. <para>The license has been changed from MS-PL to MIT license.</para>
  56. </listitem>
  57. <listitem>
  58. <para>The library has had a test suite since before it was public, and
  59. is now located here:</para>
  60. </listitem>
  61. <listitem>
  62. <para>SafeInt also has no external dependencies other than standard
  63. library files, and doesn't need anything else installed to
  64. work.</para>
  65. </listitem>
  66. </itemizedlist></para>
  67. <para>His current package can now be found at in <ulink
  68. url="https://github.com/dcleblanc/SafeInt">github</ulink>.</para>
  69. </section>