English

libcdict: fast dictionaries in C

Data Structures and Algorithms 2024-01-26 v1 Astrophysics of Galaxies High Energy Astrophysical Phenomena Instrumentation and Methods for Astrophysics Solar and Stellar Astrophysics

Abstract

A common requirement in science is to store and share large sets of simulation data in an efficient, nested, flexible and human-readable way. Such datasets contain number counts and distributions, i.e. histograms and maps, of arbitrary dimension and variable type, e.g. floating-point number, integer or character string. Modern high-level programming languages like Perl and Python have associated arrays, knowns as dictionaries or hashes, respectively, to fulfil this storage need. Low-level languages used more commonly for fast computational simulations, such as C and Fortran, lack this functionality. We present libcdict, a C dictionary library, to solve this problem. Libcdict provides C and Fortran application programming interfaces (APIs) to native dictionaries, called cdicts, and functions for cdicts to load and save these as JSON and hence for easy interpretation in other software and languages like Perl, Python and R.

Keywords

Cite

@article{arxiv.2401.14272,
  title  = {libcdict: fast dictionaries in C},
  author = {Robert G. Izzard and David D. Hendriks and Daniel P. Nemergut},
  journal= {arXiv preprint arXiv:2401.14272},
  year   = {2024}
}

Comments

Accepted for publication in JOSS (The Journal of Open-Source Software)

R2 v1 2026-06-28T14:27:14.199Z