attractivechaos/klib
View on GitHub ↗ ★ 4,742 C
A standalone and lightweight C library
25 mentions on Hacker News by 24 people: 2 stories, 23 comments · first 2013-10-26 · latest 2023-11-12
20082026
-
…, respectively). Absl (from Google) and Boost are well-known C++ SIMD-based hash tables. Khash ( https://github.com/attractivechaos/klib/blob/master/khash.h ) is, I think, an ordinary open-addressing table using quadratic probing. Fastmap…
comment by JacksonAllan · 2023-11-12 · in Hashmaps in Factor are faster than in Zig -
…to support multiple key/value types in C. Just leaving some macro implementations for reference: - https://github.com/attractivechaos/klib/blob/master/khash.h - https://github.com/tezc/sc/tree/master/map -…
comment by jmacjmac · 2023-06-13 · in A simple hash table in C -
…who worked (professionally) with C about this. [0]: https://www.gnu.org/software/gnulib/ [1]: https://github.com/attractivechaos/klib [2]: https://apr.apache.org/
comment by doodlesdev · 2023-03-13 · in STC – Smart Template Containers for 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
comment by kzrdude · 2023-02-28 · in Generic dynamic array in 60 lines of C -
klib? https://github.com/attractivechaos/klib
comment by kleton · 2021-07-10 · in Metaprogramming custom control structures in C (2012) -
…data struct and operations. There are some attempts, for example, relatively wildly known klib: https://github.com/attractivechaos/klib
comment by funny_falcon · 2021-07-03 · in Goodbye C++, Hello C -
you can abuse the preprocessor to do efficient generic programming e.g: https://github.com/attractivechaos/klib/blob/master/khash.h https://github.com/attractivechaos/klib/blob/master/kvec.h FWIW writing a generic vector like that ^^^ is…
comment by latenightcoding · 2021-05-27 · in I still like C and strongly dislike C++ -
…are: - “C Template Library (CTL)”: https://github.com/glouw/ctl - “Klib: a Generic Library in C”: https://github.com/attractivechaos/klib/
comment by AlbertoGP · 2021-04-23 · in Beej’s Guide to C Programming [pdf] -
…pattern in production code. Here's an entire suite of type safe generic data structures in C: https://github.com/attractivechaos/klib
comment by efficax · 2021-04-09 · in Type-safe generic data structures in C -
I recommend looking at the khash implementation https://github.com/attractivechaos/klib/blob/master/khash.h It's very competitive to optimized implementations like abseil and much, much better than the C++ STL one.
comment by bufo · 2020-12-30 · in C Template Library -
…aren't they? To me, klib and its khash hash table is the most well-known implementation, see: https://github.com/attractivechaos/klib And I've written similar things myself (hash table and vectors).
comment by kzrdude · 2020-12-30 · in C Template Library -
…for the things they are good at (and all of them are as "generic" as you can get from C): khash: https://github.com/attractivechaos/klib/blob/master/khash.h The interface I really liked, and you can customize the hash equality functions.…
comment by liuliu · 2019-12-30 · in Show HN: libcodr7 – fundamental collections in the spirit of C -
…flexibility of accessing tokens by index without paying costs of copying or memory allocation. [0] https://github.com/attractivechaos/klib
comment by stochastic_monk · 2018-12-15 · in String tokenization in C -
klib's kbtree header/macro library seems to provide rather nice B-trees in C. https://github.com/attractivechaos/klib/blob/master/kbtree.h
comment by namibj · 2018-09-29 · in The relative performance of C and Rust -
…in C. For hash's, you can also look at klib's khash [5] [1] https://github.com/nothings/stb [2] https://github.com/attractivechaos/klib [3] https://github.com/nothings/stb/blob/master/stretchy_buffer.... [4]…
comment by dottrap · 2018-06-03 · in One year of C -
…used -- something written to be generally useful, not compromised to look good on a toy benchmark. https://github.com/attractivechaos/klib/
comment by igouy · 2018-05-21 · in Rust programs versus Go -
For some _real_ CPP abuse, check out klib’s hash table implementation: https://github.com/attractivechaos/klib/blob/master/khash.h
comment by Xophmeister · 2018-03-10 · in C++ macros to write a hashtable implementation -
…where C ends and C++ starts? - [1] https://github.com/gingerBill/gb/blob/master/gb_math.h - [2] https://github.com/attractivechaos/klib/blob/master/khash.h
comment by dmytroi · 2017-08-26 · in Fun vs. Computer Science (2016) -
https://github.com/attractivechaos/klib/blob/master/kvec.h
comment by wollstonecraft · 2017-01-07 · in C99/C11 dynamic array that mimics C++'s std::vector -
…curated list of free software libraries right here: https://notabug.org/koz.ross/awesome-c [1] https://github.com/attractivechaos/klib
comment by naasking · 2016-03-13 · in Collections-C, generic data structures for C -
I'm currently using https://github.com/attractivechaos/klib/blob/master/khash.h in professional projects. I know it's pretty much full of macro "magic" (well it's readable so not really..) so that makes some people scared. I really like…
comment by aninteger · 2015-05-17 · in Show HN: Simple Hash Table Implementation for C -
▲ 70
Klib: A standalone and lightweight glibstory by luu · 2015-03-13 · 16 comments
-
▲ 2
C library with macrosstory by satyajitranjeev · 2014-09-11 · 0 comments
-
…[2]: http://en.wikipedia.org/wiki/Red%E2%80%93black_tree [3]: https://github.com/attractivechaos/klib
comment by ninjin · 2013-11-30 · in Learn C the Hard Way: A Clear and Direct Intro To Modern C Programming -
This is awesome, should add https://github.com/attractivechaos/klib to it. Would be awesome to merge this with: https://github.com/clibs/clib
comment by makmanalp · 2013-10-26 · in CCAN - Comprehensive C Archive Network