offbrand_lib

Languages and libraries

c data structure library

SHOW HN2013

91points
40comments
#259of 1,739 in 2013
Top 15%of 2013 by points

How HN took it

MixedNo clear lean

3 positive, 4 neutral or asking, 2 mixed, 4 critical, out of 13 comments about the project. Thread score -0.03.

Idea: 2 for, 2 againstDesign: 0 for, 2 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Nice to see a portable, modern CF-like C library

    From 1 comment
    • A small observation: CoreFoundation typedefs CFTypeRef (the generic object type) to void * , rather than having obj * be a separate type as in this library. This lets you pass…
      comex on HN
  • Good to see data structures in C; tests are a plus

    From 2 comments
    • I've been meaning to refresh and expand both my algorithms knowledge and my C programming with a project like this, myself (as an application developer I find I've barely used…
      canadev on HN
    • Glad to see this.
      talloaktrees on HN

Objections

  • Naming convention and global namespace pollution (unprefixed function names)

    From 3 comments
    • Was there a rationale to choosing performActionOnStruct() names instead of the perhaps-more-idiomatic struct_perform_action() style? I strongly advise against putting identifiers…
      mappu on HN
    • I find that the decision to adopt a C library for a project frequently boils down to whether it is using a compatible naming notation. Especially for simpler libraries. Linked…
      huhtenberg on HN
    • > Putting ob at the beginning of every function seems like overkill That's "C-style namespaces" - really the only sane way to avoid an identifier collision, sorry.
      mappu on HN
  • Avoid reference counting overhead; prefer intrusive structures

    From 2 comments
    • It's nice that you made these available. You might also want to look at queue.h from BSD (see http://fxr.watson.org/fxr/source/sys/queue.h) and tree.h…
      cmccabe on HN
    • Well, this is a good effort. I think you are quite right to leave out reference counting. Reference counting is something that you should pay for only if you need it. I don't…
      cmccabe on HN
  • Too slow for cases needing specialization

    From 1 comment
    • A small observation: CoreFoundation typedefs CFTypeRef (the generic object type) to void * , rather than having obj * be a separate type as in this library. This lets you pass…
      comex on HN

Requests

  • Allow custom allocators

    From 1 comment
    • I would suggest offering the ability to plug custom allocators.
      enqk on HN
  • Provide a safer cast macro or avoid void pointer typing

    From 1 comment
    • A small observation: CoreFoundation typedefs CFTypeRef (the generic object type) to void * , rather than having obj * be a separate type as in this library. This lets you pass…
      comex on HN

Questions

  • Why avoid C99 _Bool

    From 1 comment
    • Definitely forking this to provide a saner API. And some of the implementation is a little iffy (like objIsOfClass). But in general, very cool. Thanks for contributing to the C…
      icodestuff on HN
  • What are classes built from functions and incomplete types

    From 1 comment
    • What are "class[es] built from functions and incomplete types"? I once built classes using structs and function pointers, but this sounds different?
      pepijndevos on HN

Alternatives named

  • BSD queue.h and tree.h

    From 1 comment
    • It's nice that you made these available. You might also want to look at queue.h from BSD (see http://fxr.watson.org/fxr/source/sys/queue.h) and tree.h…
      cmccabe on HN
  • uthash

    From 1 comment
    • I personally like and use uthash (no reference counting) but: * only a header file * has hash, array, string, list, implementations https://github.com/ned14/uthash
      rdtsc on HN
  • CCAN

    From 1 comment
    • Along the same lines, there is also CCAN. http://ccodearchive.net/list.html https://github.com/rustyrussell/ccan And GMP for arbitrary precision math (integers and floating point…
      obiterdictum on HN
  • GLib and GMP

    From 1 comment
    • I was interested to know how this compares with existing C libraries, so I "ported" the prime number example program to use GMP and GLib instead. It's not quite working yet (see…
      jzwinck on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/5883504)