14

There are websites as collections of python/perl/R libraries. Why there is not an equivalent one for c?

I searched the internet and only found a small website calling itself CCAN. There are only a few libraries in that website.

If I need extra libraries for c programming, where can I find them? Is there an well organized website of the c libraries?

Thanks.

linuxbuild
  • 15,843
  • 6
  • 60
  • 87
Feng Jiang
  • 1,776
  • 19
  • 25

7 Answers7

7

If I need extra libraries for c programming, where can I find them? Is there an well organized website of the c libraries?

No known to me outside of CCAN.

The problem here is that C doesn't have any even loose specification for libraries. Compare that to e.g. packages in Java or Python or Perl.

And even then, C is quite bare bone itself leaving many things for libraries to implement themselves. I/O abstraction, memory management, multi-threading, OS integration - minor differences in how libraries work with any of the resources might make them incompatible, preventing them being used in the same project.

I have seen in past some 3rd party commercial libraries for C, covering quite a lot of functionality, but frankly I can't recommend them and honestly do not even remember their names - for they often were causing more problems than really helping. (OK, I'm lying: they were rarely causing unsolvable problems: it's the numerous workarounds which were causing often the problems later.)

Otherwise, for C you might want to check the Glib and (do not get me wrong) to also check the C standard as in my experience few actually know many of the utilities already in the standard library itself. And well, Google is your friend: lots of public domain code is there for you to simply throw as-is into your project.

Dummy00001
  • 16,630
  • 5
  • 41
  • 63
6

I don't know of anybody who's studied this in detail, though I would be curious to see the studies. I'm sure it has to do with the nature of the C programming community itself.

I think a large (maybe the primary?) part of the answer is: before the WWW, there was no such thing as a single resource for obtaining libraries for a particular language. People obtained their libraries, and knowledge of libraries, via many different means: through BBSes, mailing lists, newsgroups, and periodicals. The C community dates from this time, of course, and I've noticed a similar difference in culture regarding other languages from this period and before.

I think another part of the answer has to do with the general decentralization of C culture itself. There's no one C compiler, no one C development community, that serves as a hub and a potential point for projects to attach themselves to. And the C development community is huge, which further drives this decentralization and splintering.

In the case of C libraries, OS distributions actually do a pretty good job of collecting useful C/C++ libraries out there. (With the unfortunate exception of Windows, I believe.) They do a better job in these languages than most others, probably since C and C++ are such important systems languages on these platforms.

As far as CCAN goes, I think what would make a more worthwhile project, given the number of different distributors of C code out there, is to have a single site that links to the various libraries on their own native sites, rather than trying to get them to upload straight to CCAN. I think there's a use for this in and apart from Google, which will give you a lot of noise if you try just browsing for libraries. The question is, would you and the bulk of the C communities out there embrace such a site if it existed?

You might be amused to see how CPAN got its start: http://www.brainbell.com/tutors/Perl/CPAN_History.htm

CPAN evolved just as its community did. So the same thing could happen in the C/C++ world if the leadership and interest is there. But it hasn't happened yet.

Owen S.
  • 7,665
  • 1
  • 28
  • 44
2

use http://www.google.com/codesearch?q=lang:%22C%22 variant of http://www.google.com/codesearch

=> i.e. add lang:"C" in the search query

Afriza N. Arief
  • 7,696
  • 5
  • 47
  • 74
  • 2
    I would stay away from that. A while back I searched Google code search for UTF-8 implementations, just as a survey/comparison, and among the 20 or so I looked through, not a single one was correct. They all violated the spec in various ways, and half or more had major bugs that could result in vulnerabilities or usability issues. – R.. GitHub STOP HELPING ICE Nov 10 '10 at 08:21
0

There is a Maven-like repository and dependency management system called Biicode.
There isn't a huge collection of libraries on there yet, but you can add forks of open source projects yourself or inform original authors about it.

EDIT: the company behind biicode is dead

EDIT2: the spiritual successor seems to be conan.io

mucaho
  • 2,119
  • 20
  • 35
0

There is a C package manager which looks promising called CLib:

github: https://github.com/clibs/clib

tutorial: https://dev.to/noah11012/clibs-a-package-manager-for-c-4jmi

Gary Weiss
  • 668
  • 5
  • 12
-3

Why do you need a website for a collection of C libraries? Just use Google.

Luca Matteis
  • 29,161
  • 19
  • 114
  • 169
  • 9
    Sometimes Google is not so effective for this task, because 'c' is only a single letter? – Feng Jiang Jun 20 '10 at 19:59
  • 1
    @progmr: code.google.com is currently good for browsing stuff hosted on code.google.com, but useless for the gazillion other C libraries out there. Try searching for "xerces api" in code.google.com, and you'll see what I mean. @Luca: Google's good for finding a specific library, but not as useful for browsing libraries. – Owen S. Jun 28 '10 at 04:58