5 ms·
My problem with C isn't even the language; it's the ecosystem around it. Glibc, auto{conf,tools,*}, CMake, etc. Writing Makefiles by hand works for small proje
by strkek 9y ago
My problem with C isn't even the language; it's the ecosystem around it. Glibc, auto{conf,tools,*}, CMake, etc.
Writing Makefiles by hand works for small projects, but for bigger ones you're forced to choose the lesser of all evils. And if you're on linux you'll still have to deal with glibc most of the time.
And of course you can only choose between compilers that do too much (as in, not "C compilers" but "compilers that happen to support C as well"), compilers that don't even aim for standards compliance, or proprietary compilers.
- oneplane 9y agoWell, as with C, the ecosystem around it is mostly just misunderstood. Autotools isn't all that hard once you actually know what you are doing. While having a build and configuration system that has the learning curve of a hockey stick isn't the nicest thing, spending some time to know to to use it gets you a lot of knowledge and access that is hard to come by otherwise. I have spent about three weeks going deep in the autotools rabbit hole (mostly converting FOSS projects that used other build systems and then ran into trouble) but coming out the other side I can say it's not as bad as it looks, and compared to other systems it could be much, much worse. As was posted earlier, calling C a "portable assembly language" seems right, and having a portable system to go with it to build and have common functionality isn't all that strange when you think about it that way. While other systems might be easier for a lot of cases, not much out there can get you where the classic stack of C + Autotools + (g)make + glibc/musl gets you. As with everything, it's a tradeoff between quality, cost (As in time/knowledge) and options.
- rwbt 9y ago> And of course you can only choose between compilers that do too much (as in, not "C compilers" but "compilers that happen to support C as well"), compilers that don't even aim for standards compliance, or proprietary compilers. I'm not sure if I understand, but almost all mainstream compilers treat 'C' as a first class citizen. Even MSVC, notorious for only supporting C89 finally caught up and now supports most of C11.
- strkek 9y agoWhat I mean is more like they're not "C compilers", but "C/C++/Objective-C/Java/Rust/Perl/Bash/Fortran compilers".
- jcelerier 9y agoand ? what would you gain if the other languages were not supported ?
- deckard1 9y ago> C/C++/Objective-C/Java/Rust/Perl/Bash/Fortran compilers huh? What compiler supports C and Perl and Bash? WTF? Sure, most C compilers are also C++ compilers. I'm not sure why this would be surprising to anyone. I don't even know how you would create a C++ compiler that didn't also compile C.
- skohan 9y agoI can't disagree with you as tools for managing builds, but isn't clang a pretty good C compiler which does everything you need and works pretty much everywhere?
- strkek 9y agoYup, but I'd like to remove the Objective-C{,++} support I'm almost definitely not gonna use in the foreseeable future, for example. Take it as my obsession for minimalism.
- saagarjha 9y agoSince Objective-C is so similar to C, I don't see why you would write a compiler for one and not do the amount of work to get it working with C and not do the comparatively smaller amount to get Objective-C to work.
- camgunz 9y agoMostly just get a CMakeLists.txt file and keep tweaking it. Here, have one of mine: https://github.com/camgunz/libd2k/blob/master/CMakeLists.txt https://github.com/camgunz/libd2k/blob/master/CMakeLists.txt
- mcintyre1994 9y ago404 on that file and the repo https://github.com/camgunz/libd2k https://github.com/camgunz/libd2k - is it private?
- Cyph0n 9y agoI tried using CMake for one of my course projects recently and it worked like a charm. Of course, I have no idea whether or not CMake can handle larger projects as effectively. Maybe someone with more experience can chime in.
- jcelerier 9y ago> I have no idea whether or not CMake can handle larger projects as effectively. well, it's able to handle whole operating systems so... https://github.com/reactos/reactos https://github.com/reactos/reactos
- blueline 9y agoboth times i inherited a cmake build system in two (small-ish) teams with moderately sized projects it seemed to suffer pretty hard from a "last mile" problem. 90% of what we wanted out of it was easy and the last 10% ranged from "easy but quirky" to "how is something this simple this hard" i don't have a solid gauge for how much of that was because of my own inexperience or the tool itself, although my gut feeling is that it's probably a bit of both.
- NelsonMinar 9y agoWorth noting sqlite has its own unique ecosystem of tools. Most people who compile it are compiling "the amalgamation", a unique thing where they smash all the sqlite source code together into one standalone .c file you can just compile and link with, no build tools needed. I've never worked with the actual source code but the docs talk about a simple Makefile, nothing more complex. https://www.sqlite.org/howtocompile.html https://www.sqlite.org/howtocompile.html
- pjc50 9y ago> compilers that do too much Why is this a problem?
- strkek 9y agoI don't like the many-compilers-in-one approach for the same reason I wouldn't like an `ls` program with bundled support for LDAP, SSH, Git, SVN and CVS, for example. Sure, some way or another all those can fall under the category "list directory contents", but I'd rather use separate programs for every one of those. Programs that I will install if and when I need them.
- lukaszsamson 9y agoC tools are not more complex than Javascript tools and they don't change that often. However, after few years in JS land I feel the rust.
- fsloth 9y agoTry meson. http://mesonbuild.com/ http://mesonbuild.com/ It seems to be actually a simple build configuration tool. A ton of projects are using it, including systemd. http://mesonbuild.com/Users.html http://mesonbuild.com/Users.html