Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR. Learn more →
Klib Alternatives
Similar projects and alternatives to Klib
-
zig
General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
-
Nutrient
Nutrient – The #1 PDF SDK Library, trusted by 10K+ developers. Other PDF SDKs promise a lot - then break. Laggy scrolling, poor mobile UX, tons of bugs, and lack of support cost you endless frustrations. Nutrient’s SDK handles billion-page workloads - so you don’t have to debug PDFs. Used by ~1 billion end users in more than 150 different countries.
-
-
STC
A modern, user friendly, generic, type-safe and fast C99 container library: String, Vector, Sorted and Unordered Map and Set, Deque, Forward List, Smart Pointers, Bitset and Random numbers. (by stclib)
-
countwords
Discontinued Playing with counting word frequencies (and performance) in various languages.
-
parallel-hashmap
A family of header-only, very fast and memory-friendly hashmap and btree containers.
-
robin-hood-hashing
Discontinued Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20
-
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
-
-
-
unordered_dense
A fast & densely stored hashmap and hashset based on robin-hood backward shift deletion
-
-
-
-
-
-
-
-
-
mlib
Library of generic and type safe containers in pure C language (C99 or C11) for a wide collection of container (comparable to the C++ STL).
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Klib discussion
Klib reviews and mentions
- Factor is faster than Zig
- A simple hash table in C
-
So what's the best data structures and algorithms library for C?
It could be that the cost of the function calls, either directly or via a pointer, is drowned out by the cost of the one or more cache misses inevitably invoked with every hash table lookup. But I don't want to say too much before I've finished my benchmarking project and published the results. So let me just caution against laser-focusing on whether the comparator and hash function are/can be inlined. For example stb_ds uses a hardcoded hash function that presumably gets inlined, but in my benchmarking (again, I'll publish it here in coming weeks) shows it to be generally a poor performer (in comparison to not just CC, the current version of which doesn't necessarily inline those functions, but also STC, khash, and the C++ Robin Hood hash tables I tested).
-
Generic dynamic array in 60 lines of C
Not an entirely uncommon idea. I've written one.
There's also a well-known one here, in klib: https://github.com/attractivechaos/klib/blob/master/kvec.h
- C_dictionary: A simple dynamically typed and sized hashmap in C - feedback welcome
- Inside boost::unordered_flat_map
-
The New Ghostscript PDF Interpreter
Code reuse is achievable by (mis)using the preprocessor system. It is possible to build a somewhat usable API, even for intrusive data structures. (eg. the linux kernel and klib[1])
I do agree that generics are required for modern programming, but for some, the cost of complexity of modern languages (compared to C) and the importance of compatibility seem to outweigh the benefits.
[1]: http://attractivechaos.github.io/klib
- C LIBRARY
- boost::unordered map is a new king of data structures
- C++ containers but in C
-
A note from our sponsor - CodeRabbit
coderabbit.ai | 14 Mar 2025
Stats
attractivechaos/klib is an open source project licensed under MIT License which is an OSI approved license.
The primary programming language of Klib is C.