I don't take the point of this book to be "how to implement an STL-like data structures and algorithms library in C"---although you were his coworker, so maybe you know better. I've always viewed it more as "how to build data structures with useful interfaces in C". In the book, the set of libraries presented are an example which illustrates how to approach this using the features that C provides. If you are new to C and don't know how to manage complexity by building up useful interfaces for your data structures, reading Hanson's book is a reasonable way to get some ideas. Another way to go would be to just read through the source of any of the libraries you mentioned, all of which do in fact use ideas which feature in this book. This is obviously not to say that Hanson's book originated these ideas. I also think focusing on the exact style of the code in this book is maybe a bit of a red herring.
FROM THE HN SHELF
C Interfaces and Implementations
David R. Hanson
Computing · A BOOKTypographic jacket · original cover not fetched
FROM THE SHARED SHELF · 2006–2026 SAMPLE
C Interfaces and Implementations
6 readers recommend it across 3 discussions
Topics are model-inferred labels.
Keep it on your reading list
THE WORD OF MOUTH
What made it worth passing on?
Original Hacker News comments, in the readers’ own words.
Yes, Absolutely. However, i am not clear what you mean by "language agnostic"? Obviously Code cannot be language independent but if you can read C then you should be able to translate the data structures/algorithms given in this book to a language of your choice; the difficulty might vary (eg. how would you represent pointers in your language to implement say recursive tree structures?) but it can be done. The data structures/algorithms given in Hanson's book are "industrial strength" with no missing parts (i.e. no exercise left to the reader). So you get complete code all written in the "Literate Programming" style which takes a little getting used to but is eminently worth it.
(Some of the +below are O'Reilly DRM-free ebooks. Big fan.) Python: +Effective Computation in Physics. Probably the most practical full-environment treatment of Python I've seen. Write, test, package, distribute. Third party libs. Effective Python, Brett Slatkin. Sort of an "N ways to improve your Python." Part of a series edited by Scott Meyers. Getting my C mojo back: I left C/C++ 15 years ago. C++ will likely stay left, but I miss C. +Reading 21st Century C, Ben Klemens. The first half is the development environment, which is great, since there's some new stuff since I left, and lots of stuff I've forgotten or never knew. Rereading Expert C Programming: Deep C Secrets by Van der Linden. The guy's a riot. It's dated but still relevant. The inside baseball stuff on problems seen while working in Sun's compiler group is fascinating. Rereading C Interfaces and Implementations, Hanson. Hoping this will serve as my C version of Large Scale C++ Design by Lakos. Honestly though, the literate programming style of presentation is off-putting. Are we still talking about that?
Also recommended in this reply
A number of people have recommended David R. Hanson's C Interfaces and Impementations, so I'll mention his A Retargetable C Compiler: Design and Implementation. I own this book though I haven't read it, but it's about writing a C compiler in C. You should pretty much just go out and buy these two books because they'll eventually go out of print, and then you'll be screwed. CII used to be out of print and impossible to obtain until Addison-Wesley started printing it again a year ago.
Also recommended in this reply
C Interfaces and Implementations by Hanson. It'll give you back most of the things you depend on in Python, like variable length strings and dictionaries. I'm teaching a 4-month weekend C class for Ruby programmers starting in April, and my syllabus is pretty much built around CII.
First, K&R. Second , C interfaces and Implementations by David Hanson.
Also recommended in this reply