8 ms·
Best Package Manager for C
- eqvinox 6y ago[http://blog.ashworth.in/2014/10/19/the-advent-of-clib-the-c-package-manager.html http://blog.ashworth.in/2014/10/19/the-advent-of-clib-the-c-...]: > "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 6y agoneither 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 6y agoAm I just too dumb to understand this; because I thought this was what linkers and header files were for
- closeparen 6y agoLanguage 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.
- dusted 6y agoNext 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.
- smcameron 6y agoSee also ccan: https://github.com/rustyrussell/ccan https://github.com/rustyrussell/ccan
- mk_chan 6y agoI 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 6y agoAgree. 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 6y agoI don't know how anyone can develop serious projects in C due to this exact reason.
- bzb4 6y agoPeople have been developing serious projects in C for decades, so it clearly works.
- ironmagma 6y agoFor limited and questionable definitions of “works,” yeah. There is a reason C++ is much more popular, and it’s not the exception handling.
- fsociety 6y agoMinimal dependencies is always the answer.
- typon 6y agoExcept it isn't because why would gtk need to prefix their functions and structs with these ugly names? Namespaces is the answer to solving problems arising from a lack of namespaces.
- whateveracct 6y agoI 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 6y agoFor me the best "package manager" are single header libraries like https://github.com/nothings/stb https://github.com/nothings/stb
- neurocline 6y agoThere 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.