Code review for new library

Joe Nelson joe at
Sun Apr 25 23:08:18 UTC 2021

Hey all, can I get a code review on my new project?

Backstory: I was working on some parser examples, and for one of the
programs I needed an associative map. I got mad that there wasn't a
library for this that worked to my liking. So I took a detour to make
(yet another) C collection library, but one that's easy to build and
avoids tricky macro magic or "invasive" data structure changes.

I haven't added any documentation yet, but thought I'd check how people
like the interface first. I tried to get inspiration from these
libraries, and find commonality:

* C++ STL
* Ada 2012 containers
* Smalltalk collection protocols
* .NET
* java.util

Also consulted the Standard ML basis library, the Haskell 2010 language
report, and Common Lisp HyperSpec. However those functional libraries
didn't really apply.

So far I've implemented vector (dynamic array), list (doubly linked),
and hashmap.

Ways you can help:
* Is the current interface missing functions that you'd find useful?
  Going to add a iterator for the hashmap, for one thing...
* Are the names meaningful to you? Feel free to bikeshed.
* See any bugs? Or even have a hunch of things I should test?
* Can we simplify the Makefile in a totally portable way? It's very
* The algorithms aren't fancy, but do you see obvious improvements?
  For instance, my mergesort is recursive and could theoretically
  hit stack limitations. Things along those lines.
* Does the project build on your system?
* Should the function names have a common prefix?

My plan is to rewrite the tests more methodically, using code coverage
to guide me in coming up with scenarios. Then write a man page for each
function. Then have it compile a .a and .so library. Finally add
versioning and pkg-config information, and package it up for a bunch of

Thanks for your help!

More information about the Friends mailing list