Programming thread

  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
made me think, is there any good package manager for C/C++? something maybe like pythons pip? 🤔
There's at least 2, vcpkg and conan. Often you can use your system package manager. Or maybe Nix. Also you can use CMake's FetchContent, which is a way I recommend.

If you expect one way of doing things when it comes to C or C++ you are for disappointment.
 
There's at least 2, vcpkg and conan. Often you can use your system package manager. Or maybe Nix. Also you can use CMake's FetchContent, which is a way I recommend.

If you expect one way of doing things when it comes to C or C++ you are for disappointment.
with C++ i really like using cpm.cmake
with C i just use header only libraries to avoid package management altogether
 
Be your own package manager and vendor dependencies by hand after extensively auditing the source. Alternatively, wear the socks and use Rust/Cargo.
Neither of the above, please. Take your inputs from the environment (include and library search paths, pkg-config, etc) and optionally configure arguments, and accept as wide a range of versions as possible. If your users are too dumb to figure out how to install or package dependencies even when you provide explicit instructions in the README, get better users. If you can't, then use vendored versions only as a fallback, and make sure they can be stripped out of the source distribution and the package will still build.

The only time I would consider it acceptable to have a hard dependency on vendored code is if the vendored code is customized for the package that contains it, and it cannot be found anywhere else or reimplemented in terms of the non-customized version.

And because someone is surely thinking of it: proper packages do not require network connectivity to build, ever. At most it should be optionally used in the test suite. If an input is missing, it is much better to say that it is missing than to give a long backtrace ending in "getaddrinfo: failed to resolve address 'pypi.org'" or similar. If you want to accommodate the lazy and stupid, add a separate script for installing all the dependencies, or a flag passed to the build command.
 
lol the website fucked up
1775139447868.png
EDIT:
i dont even know what would cause this
1775139504952.png
 
Chat I forget to close every resources possible in the project. It's so over. (:_(

Also everyone peer pressure me to use node.js
 
Last edited:
lol the website fucked up
View attachment 8795044
EDIT:
i dont even know what would cause this
View attachment 8795048
perhaps dear feeder is vibe re-writing the forum software?

The "post number" on the right is duplicated starting with yats #9664. I have no idea how the forum software/database work, but I would guess that there is a "next post number" variable somewhere that got decremented somehow, and the posts are actually sorted by post number and not time? It's also not clearing the "new" tag for the duplicate numbered posts...

2026-04-02-164656_796x719_scrot.png
 
perhaps dear feeder is vibe re-writing the forum software?

The "post number" on the right is duplicated starting with yats #9664. I have no idea how the forum software/database work, but I would guess that there is a "next post number" variable somewhere that got decremented somehow, and the posts are actually sorted by post number and not time? It's also not clearing the "new" tag for the duplicate numbered posts...

View attachment 8795277
What I find most interesting is that the internal post IDs (e.g. the 24126572 in https://kiwifarms.st/threads/programming-thread.41367/post-24126572) are clearly out of order in the DOM. You'd think whatever xenforo php crap renders each page would pay attention to that sort of thing. The issue doesn't appear to lie in the timestamps either.
1775146324806.webp
 
If you're writing in C, please refrain from depending on any type of dependency manager, or even worse, vendoring dependencies. I will shoot you if you do that.

The compiler's job is to check if all the required headers are there, if one is missing it'll throw an error.

It's the package maintainer's job to put the correct dependencies into the package that provides your program.

It's your job to list all the dependencies in a text file in your project, in the readme, or a file named INSTALLING or something like that. The package maintainer will read the file and put the right dependencies into the package specification.

If someone is building your program manually without using a package, it's their own job to install all the dependencies on their system.

GNU automake has a feature to track dependencies after your program has been built once, you can include the generated automake files in releases of your project, so that even if the user forgets to install a dependency, the configure script will throw an error even before any compiling takes place:

There are probably other more based tools than automake, can't think of any, I've always used it.

The user's OS already has a dependency manager, the OS's package manager. Don't reinvent the wheel with your own, inevitably shittier and less secure implementation.
 
GNU automake has a feature to track dependencies after your program has been built once, you can include the generated automake files in releases of your project,

Is this not what the Makefile / CMakefile is for?
 
Is this not what the Makefile / CMakefile is for?
In automake, the Makefile is generated by the configure script from Makefile.in. The configure script and Makefile.in is usually tracked in the VCS and included in tarball releases, the Makefile isn't. GNU make doesn't track dependencies by itself. You could write your own Makefile without automake but it wouldn't track dependencies. The only way you would know if a dependency is missing or incompatible is when the compiler threw an error during compilation. Which would still give you an indication that your dependencies aren't in order, but it might take time before it gets to that point.
Automake's user-defined input files are configure.ac and Makefile.am (and possibly others) which automake will use to generate Makefile.in. This generated Makefile.in will then be used by the configure script to generate the Makefile. Yeah, it's a mess...
CMake's equivalent to the Makefile.am file is CMakeLists.txt, which is processed by cmake to create a generated Makefile that is then used with GNU Make to compile the project. It can also generate a ninja file and use ninja instead of GNU Make.
 
Is this not what the Makefile / CMakefile is for?
autotools is a superset of make in a sense, it generates makefiles for you based on configurations, and it also handles common patterns with preprocessor flags and detecting compatibility with the host system.
It's kind of a polarizing program, on one hand it's a mess of scripts, but on the other, it's really good for the end user. If you've ever run a configure script to build a project from source, that's likely autotools.
 
If you're writing in C, please refrain from depending on any type of dependency manager, or even worse, vendoring dependencies. I will shoot you if you do that.
Some C dependencies like the stb headers are designed to be vendored and are rarely packaged by distributions.
it's really good for the end user.
It's extremely portable too. My gripe is the header checking being so damn slow.
 
Back
Top Bottom