Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

libgeneralist

Name: Anonymous 2011-09-12 22:56

So, /prog/, I'm writing a general library in C, with the aim of being somewhat inspired by libraries such as glib, but far lighter and cleaner. So far, I have a linked list implementation and a Unicode string implementation (this is incomplete), totalling 670 SLOC. The build system is cmake, the code is fully documented with doxygen. Of course, the library is in its infancy and far from finished; what other things should I implement? Any data structures? OS abstractions?

Name: Anonymous 2011-09-12 23:49

First I read:
with the aim of being somewhat inspired by libraries such as glib, but far lighter and cleaner.

But then, immediately after:
>So far, I have a linked list implementation

How about you get rid of the linked-list implementation altogether, linked lists are poor data structures on modern computers. Dynamic arrays with overcommitting of memory to ammortize allocation cost is far superior. If you want to be lean and mean, focus only on the core data-structures that can be widely used with good performance, and less on the data-structures that are only taught about in elementary first year programming classes at university for historical reasons.

It's why ArrayList in Java and List in C#/.NET are in fact dynamic arrays and not linked-lists.

>Unicode string implementation (this is incomplete), totalling 670 SLOC.

A unicode string implementation in C in under 670 LOC? Something tells me you're doing it wrong. There's no way you can have proper conformance for UTF-8/UTF-16/UTF-32 character decoding, which is very important for security reasons. Do you know how big of a security problem shoddy Unicode text decoding code has caused the world?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List