3 ms·
My only wish was that C had a package manager, and maybe a dynamic analyzer to could catch bugs that a static analyzer would miss. Also, being able to cross-co
by Alifatisk 3y ago
My only wish was that C had a package manager, and maybe a dynamic analyzer to could catch bugs that a static analyzer would miss.
Also, being able to cross-compile would be cool. But I guess cosmopolitan solves this.
- GuestHNUser 3y agozig cc is a top notch cross compiler that you should check out[0]. [0] https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace...
- Alifatisk 3y agoThat’s so cool, It can compile to many different targets!
- teunispeters 3y agoAh satire. ;) Package manager: dynamic libraries! Or if you want to get really advanced, pkg-config and related. (or static libraries even. Common enough in embedded space!) Dynamic analyzer : valgrind, gdb, Visual Studio, xCode, ... Cross compiling : more platforms supported by C compilers than by any other build tool. Oh sure, you need to eventually watch byte sizes (as 8 bit bytes are a fairly narrow set of platforms), and know something about the platform's kernel API (if any, lots of embedded platforms are just hardware interactions!). So I'll assume this is satire.
- skydhash 3y agoThat makes a while since I wrote C, but I was surprised by GP's comment. I think C has the most tooling available nowadays (they may not be easy to use). And with its interoperability, can be used together with a lot of languages.
- jll29 3y agoNobody is held back from adding further components to the GNU GCC or Clang/LLVM compiler suites. Conan, gdb/DDD, Rational Purify etc. exist and can be replaced/improved by better tools.
- JonChesterfield 3y agoThe C++ world is keenly interested in having a package manager. I believe there are a few competing ones now. All I've seen in practice is "vendoring", which amounts to copy the source into your tree with some degree of review or patching, and then go on as before. After being initially indignant that we didn't use libboost from the OS that approach has really grown on me. Dependency management is a horrendous mess. Moving the logic into package managers hides that mess from the day to day development which is very nice. However, following a debugger into the binaries that came from apt install is not a great time. Patching the source to behave differently while trying to work out what is going wrong is rather harder too. If you do the vendored thing, you also get the interesting feature where you can checkout the source tree as it was eight months ago to correspond with whatever a customer is asking about and it builds and runs, instead of telling you that the dependencies no longer exist. I'm now heading further in that direction. All the libraries should be built from source in the same repo, but preferably by tools that are also in that repo. I'm going to end up with a C compiler checked in as well, much like the embedded toolchain people are prone to doing.
- mhh__ 3y agoSome open source types really hate vendoring on some level (it's hard to say if it's genuinely technical or just an immune system turning on) — not everything supports it that well (e.g. python really doesn't, it's terrible), but when you have it working it's so nice for the things you mention. We had a build fail for a few days because a git commit with a given hash didn't exist upstream. Solution? Pin to a branch of course! Vendoring as that solution takes a surprisingly deep realignment.