Introduction The goal of this project is to compare several C libraries that provide some STL like capabilities of the C++ (container template) but are targeting classic C language. A STL like library for C is a C library providing several classic generic containers for the C language, like vector, list, sorted set, unordered_map, and so on. A small benchmark to compare their performance is includes in the bench directory. To do this, the same simple programs will be implemented by the libraries in the more straight-forward way possible, for different kind of containers and for different types. Then the API ergonomics of each programs can be compared each other according to the user taste. Objective characteristics of the libraries are directly compared in this file. Disclaimer I am the main author of M*LIB, one of theses libraries. This work is still a WIP. Test Program Rules The test program shall respect the following conditions: it shall use a basic type (int), a non POD type (the type mpz_t of the GMP library) and a string as the primary type of the container. it shall not comment the code (the code is assumed to be clear on what it does by itself) except if there is some workaround, it shall not produce any compilation warnings, it shall execute properly, it shall not leak any memory, it shall abort on error, it shall link dynamically with the GMP library (https://gmplib.org/) if needed, it shall link statically with the container library if needed, if a dynamic string container exists in the container library, it shall be used instead of a C string, the optional assertions shall be turned off. A workaround is defined as a way to implement this program which is not natural for the library. This typically includes: create wrapper structure, create wrapper functions or macros, accessing internal fields of the containers (typically for using the qsort function). For example, if a container library manual requests to define some macro for its use, then it won't be...
First seen: 2025-08-17 12:34
Last seen: 2025-08-17 17:35