
Best Package Manager for C - ausjke
https://github.com/clibs/clib
======
eqvinox
[[http://blog.ashworth.in/2014/10/19/the-advent-of-clib-
the-c-...](http://blog.ashworth.in/2014/10/19/the-advent-of-clib-the-c-
package-manager.html)]: > "Finally: a place where C programmers can get
together and collaborate on open source, then distribute their code - in a
centralized, easy way."

That place already exists. In fact, at least two such places exist: GLib and
APR.

Also, this is not how C development workflow works.

~~~
ausjke
neither of them are widely used, glib is pretty large(1MB at least, OK for
desktop but too large for embedded, for example) and apr's function is
limited.

clib can let you integrate small pkgs at will at source level, sometimes it is
very handy and useful.

~~~
SQueeeeeL
Am I just too dumb to understand this; because I thought this was what linkers
and header files were for

~~~
closeparen
Language package managers take care of versioning/downloading the library from
a central source into a project-specific place where the toolchain will find
it.

AFAIK for C, this is handled by your linux distribution, and for any libraries
that are not part of your distro you would be downloading the header and
object files / pointing your Makefile at them by hand.

------
mk_chan
I feel like one of the big reasons package managers aren't great with C is
because of the way namespaces work.

It's not easy to have a medium-large codebase and just freely add a dependency
because maybe this library causes variable or function name clashes. Even
worse would be a macro that screws with your code.

There isn't even a simple solution like preprocessing everything in the
downloaded library and adding a known prefix to every namespace encroaching
identifier I think.

~~~
slezyr
Agree. There is a reason why function names like exist.

> gtk_app_chooser_widget_set_show_recommended

> gtk_tree_model_filter_convert_child_iter_to_iter

~~~
typon
I don't know how anyone can develop serious projects in C due to this exact
reason.

~~~
bzb4
People have been developing serious projects in C for decades, so it clearly
works.

~~~
ironmagma
For limited and questionable definitions of “works,” yeah. There is a reason
C++ is much more popular, and it’s not the exception handling.

------
dusted
Next to it being a fun language, what I love most about C is the lack of
package managers, or rather, letting the operating system mange the library
packages.

It's refreshing to know that the code I write can be build by anyone, it runs
on Linux, Windows, Macs, heck, my stuff has been ported to Aros, FreeBSD,
Playstation Portable, Pandora, GP2X, GCW-Zero, Haiku, Amiga OS4, Canoo,
Dingux, Android and some Motorola phones, probably exactly because it uses
standard library and only one or two third-party libs which are widely
available on any platform.

~~~
slezyr
Nice! Try to make a GUI application.

~~~
dusted
I'd say they are all GUI applications as they're computer-games, with a GUI.

------
whateveracct
I like Nix for C. But I'm usually using C from some other language (e.g.
Haskell), so Nix makes more sense in those cases.

------
atesti
For me the best "package manager" are single header libraries like
[https://github.com/nothings/stb](https://github.com/nothings/stb)

------
neurocline
There is a certain irony in the source code for a package manager expecting
the key package needed to build that package manager to have been installed by
some other package manager.

------
smcameron
See also ccan:
[https://github.com/rustyrussell/ccan](https://github.com/rustyrussell/ccan)

