Hacker GitHub

← All repos

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

Mentions per year 25 mentions · busiest year 2018 (5)
20082026
  1. …, 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
  2. …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
  3. …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
  4. 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
  5. klib? https://github.com/attractivechaos/klib
  6. …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
  7. 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++
  8. …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]
  9. …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
  10. 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
  11. …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
  12. …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.…
  13. …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
  14. 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
  15. …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
  16. …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
  17. 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
  18. …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)
  19. 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
  20. …curated list of free software libraries right here: https://notabug.org/koz.ross/awesome-c [1] https://github.com/attractivechaos/klib
  21. 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…
  22. ▲ 70
    Klib: A standalone and lightweight glib
    story by luu · 2015-03-13 · 16 comments
  23. ▲ 2
    C library with macros
    story by satyajitranjeev · 2014-09-11 · 0 comments
  24. …[2]: http://en.wikipedia.org/wiki/Red%E2%80%93black_tree [3]: https://github.com/attractivechaos/klib
  25. 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