News for hackers. Stuff that matters.
Re:Why Is SQLite Coded in C? (2017) by strkek on Wednesday March 14, 2018 @11:26AM (#16585395)
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.

Re:Why Is SQLite Coded in C? (2017) by NelsonMinar on Wednesday March 14, 2018 @11:59AM (#16585691)
Worth 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
Re:Why Is SQLite Coded in C? (2017) by oneplane on Wednesday March 14, 2018 @11:37AM (#16585497)
Well, 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.

Re:Why Is SQLite Coded in C? (2017) by rwbt on Wednesday March 14, 2018 @11:40AM (#16585526)
> 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.

Re:Why Is SQLite Coded in C? (2017) by strkek on Wednesday March 14, 2018 @11:43AM (#16585558)
What I mean is more like they're not "C compilers", but "C/C++/Objective-C/Java/Rust/Perl/Bash/Fortran compilers".
Re:Why Is SQLite Coded in C? (2017) by deckard1 on Wednesday March 14, 2018 @03:09PM (#16587420)
> 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.

Re:Why Is SQLite Coded in C? (2017) by jcelerier on Wednesday March 14, 2018 @12:20PM (#16585849)
and ? what would you gain if the other languages were not supported ?
Re:Why Is SQLite Coded in C? (2017) by camgunz on Wednesday March 14, 2018 @11:45AM (#16585568)
Mostly just get a CMakeLists.txt file and keep tweaking it. Here, have one of mine: https://github.com/camgunz/libd2k/blob/master/CMakeLists.txt
Re:Why Is SQLite Coded in C? (2017) by mcintyre1994 on Wednesday March 14, 2018 @11:56AM (#16585661)
404 on that file and the repo https://github.com/camgunz/libd2k - is it private?
Re:Why Is SQLite Coded in C? (2017) by skohan on Wednesday March 14, 2018 @11:41AM (#16585533)
I 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?
Re:Why Is SQLite Coded in C? (2017) by strkek on Wednesday March 14, 2018 @11:55AM (#16585658)
Yup, 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.

Re:Why Is SQLite Coded in C? (2017) by saagarjha on Wednesday March 14, 2018 @04:27PM (#16587998)
Since 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.
Re:Why Is SQLite Coded in C? (2017) by fsloth on Wednesday March 14, 2018 @04:50PM (#16588182)
Try meson. 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

Re:Why Is SQLite Coded in C? (2017) by Cyph0n on Wednesday March 14, 2018 @11:52AM (#16585633)
I 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.
Re:Why Is SQLite Coded in C? (2017) by jcelerier on Wednesday March 14, 2018 @12:21PM (#16585859)
> 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

Re:Why Is SQLite Coded in C? (2017) by blueline on Wednesday March 14, 2018 @12:48PM (#16586104)
both 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.

Re:Why Is SQLite Coded in C? (2017) by lukaszsamson on Wednesday March 14, 2018 @05:55PM (#16588669)
C 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.
Re:Why Is SQLite Coded in C? (2017) by pjc50 on Wednesday March 14, 2018 @12:01PM (#16585700)
> compilers that do too much

Why is this a problem?

Re:Why Is SQLite Coded in C? (2017) by strkek on Wednesday March 14, 2018 @12:23PM (#16585875)
I 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.