Logo image
Open Research University homepage
Surrey researchers Sign in
libcdict: fast dictionaries in C
Journal article

libcdict: fast dictionaries in C

Robert George Izzard, David Douwe Hendriks and Daniel P. Nemergut
Journal of open source software, Vol.8(92), 4756
12/12/2023

Abstract

Astronomy & Astrophysics Open source Computational Mathematics Data Analysis Software

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 a 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 cdict to load and save these as JSON and hence for easy interpretation in other software and languages like Perl, Python and R.

url
https://doi.org/10.21105/joss.04756View
Published (Version of record)CC BY V4.0 Open

Metrics

Details

Logo image

Usage Policy