01/10/2022 : V1.31 Added checks for __VA_OPT__ in meson.build because Clang 11 behaves differently to Clang 12+ and GCC, and set the default C std to gnu18.
06/12/2023 : V1.4 Release for (hopefully!) final JOSS paper.
07/12/2023 : V1.41 fix citation typo and added a few recent papers that use libcdict (thanks to David Hendriks).
adsnote={Provided by the SAO/NASA Astrophysics Data System}
}
@ARTICLE{2023MNRAS.524.3978M,
author={{Mirouh}, Giovanni M. and {Hendriks}, David D. and {Dykes}, Sophie and {Moe}, Maxwell and {Izzard}, Robert G.},
title="{Detailed equilibrium and dynamical tides: impact on circularization and synchronization in open clusters}",
journal={\mnras},
keywords={stars: evolution, stars: rotation, open clusters and associations: general, Astrophysics - Solar and Stellar Astrophysics, Astrophysics - Astrophysics of Galaxies},
adsnote={Provided by the SAO/NASA Astrophysics Data System}
}
@ARTICLE{2023MNRAS.524.4315H,
author={{Hendriks}, D.~D. and {Izzard}, R.~G.},
title="{Mass-stream trajectories with non-synchronously rotating donors}",
journal={\mnras},
keywords={binaries: close, stars: mass-loss, accretion, accretion discs, Astrophysics - Solar and Stellar Astrophysics, Astrophysics - High Energy Astrophysical Phenomena},
@@ -31,7 +31,7 @@ A common requirement in science is to store and share large sets of simulation d
Users of high-level languages such as Perl or Python have access to associated-array data structures through dictionaries and hashes, respectively. These allow arbitrary data types to be stored in array-like structures. These are in turn accessed through key-value pairs which allow the value to be a further, nested associated array, allowing arbitrary nesting of data. Compiled low-level languages, like C and Fortran, are more suited to high-speed and repeated calculations typical in science. These languages lack native associated-array functionality. While there are pure hash-table solutions out there, such as `glib` [@glib_manual_hashtable] and `uthash` [@uthash_github], these do not combine a simple API for setting and adding to nested structures, a small library footprint, fast input and output, and standardised JSON output to easily interface with other languages and tools. `libcdict` provides an API for such functionality which allows `cdict`s to be nested in `cdict`s, hence arbitrarily-nested dictionaries of variables in C just as in Perl or Python.
`libcdict` is written in C and provides an API through a set of C macros. Nested `cdict` structures have values in them set with a single line of code. `libcdict` has been used for the last year in the `binary_c` single- and binary-star population nucleosynthesis framework [@izzard:2004; @izzard:2006; @izzard:2009; @izzard:2018; @izzard:2023] which computes the evolution of millions of single- and binary-stellar systems in only a few hours using its `binary_c-python` Python frontend [@Hendriks:2023]. We provide `libcdict` as open-source code on Gitlab subject to the GPL3. `libcdict` also has a comprehensive test suite run through its configuration program `cdict-config`.
`libcdict` is written in C and provides an API through a set of C macros. Nested `cdict` structures have values in them set with a single line of code. `libcdict` has been used for the last year in the `binary_c` single- and binary-star population nucleosynthesis framework [@izzard:2004; @izzard:2006; @izzard:2009; @izzard:2018]. Recent works [@izzard:2023; @2023MNRAS.524.3978M; @2023MNRAS.524.4315H; @2023MNRAS.tmp.3267Y] compute the evolution of millions of single- and binary-stellar systems in only a few hours using its `binary_c-python` Python frontend [@Hendriks:2023]. We provide `libcdict` as open-source code on Gitlab subject to the GPL3. `libcdict` also has a comprehensive test suite run through its configuration program `cdict-config`.
# Using libcdict
@@ -51,6 +51,6 @@ We provide an interactive example made with `binary_c` and `binary_c-python` usi
# Acknowledgements
RGI acknowledges funding by STFC grants ST/L003910/1 and ST/R000603/1. DDH acknowledges funding by UKRI/UoS grant H120341A. We thank the authors of software used by `libcdict`, especially Troy Hanson and Arthur O'Dwyer for `uthash`, Ulf Adams and the `Ryū` team, Serge Zaitsev and the `jsmu` team, and Daniel Lemire for `fast double parser`.
RGI acknowledges funding by STFC grants ST/L003910/1, ST/L003910/2 and ST/R000603/1. DDH acknowledges funding by UKRI/UoS grant H120341A. We thank the authors of software used by `libcdict`, especially Troy Hanson and Arthur O'Dwyer for `uthash`, Ulf Adams and the `Ryū` team, Serge Zaitsev and the `jsmu` team, and Daniel Lemire for `fast double parser`.