Hi,
I believe my stdlib_codata module is decent enough shape that I can release it for test use: Bob Apthorpe / stdlib-codata · GitLab
I’m coming at this from the position of someone modernizing legacy code, first standardizing and consolidating constants, then increasing precision, then updating the set of constants as new revisions are released. The CODATA 2018 dataset is the most complete and is the least likely to change. All CODATA releases from 1973 onward are supported including a 1969 dataset that was in common use before CODATA was formed.
I started by mechanically translating the allascii.txt
file from NIST but this proved difficult to review against source documents so the constants were reordered and grouped in their traditional arrangement. Constant names are mostly derived from NIST descriptions with a suffix to indicate precision; names in other datasets are in the process of being normalized with the CODATA 2018 names to simplify upgrading. Principal data is stored as REAL128 (quad precision) and is cast to REAL64 and REAL32 to support double and single precision. Everything is defined as a parameter so there should be no run-time overhead; it’s up to individual compilers how they optimize this but I tried to make it as easy on the system as possible.
I tried to document my design decisions so people can get a sense of what I was trying to accomplish and what I was concerned about. Also, I put together a small example program to illustrate how I think the modules could be used with attention paid to access control and presenting a consistent simple interface to the application programmer.
The project is set up to use CMake as the automated build system, but that’s mostly for documentation, testing, packaging, and cross-platform support. The nine CODATA module files could just be copied into a project; CMake is not required to use the modules (they are literally just giant lists of PARAMETER
s…)
Documentation is built via Doxygen and LaTeX; I’m trying to build formal industrial-style QA documentation in PDF format. Currently documentation is limited to the CODATA 2018 module (503 pages); LaTeX died on lack of resources around 2400 pages otherwise there’s no real reason PDFs for all nine datasets couldn’t be generated. Honestly, the documentation build process is more complex than the compilation and packaging processes combined.
A lot of tedious housekeeping effort is left to do, but I believe the 2018 dataset is stable enough for testing. I’d appreciate any feedback, bug reports, etc. This is all a bit overkill but simple use should be simple and complex use should be possible. If anything, take a look at the README and let me know if I’m missing something regarding design or explanation.
– Bob