Hacker News new | ask | show | jobs
by notalaser 3281 days ago
> Someone would ask this sooner or later, so.. why is this written in C, really?

When systemd was started, Rust barely had a working compiler and go had been announced for about one year.

3 comments

Sure, but Ada was a first-class language in GCC, many distributions shipped OCaml code...
Do you think (as in bet-your-company's-profits-on-it believe) that Ada will still be a first-class language in GCC ten years from now (the standard product lifecycle for RHEL), and that you'll be able to staff the project and build a community throughout that period?
If I had to choose between betting my company's profits on Ada or C, I'd choose Ada (though I think there are better choices today). Limited tools and a need to train developers are easier to deal with than random crashes and security vulnerabilities.
But it's not "just" limited tools and a need to train developers. A language having a small community results in a lack of library and collaboration; you end up dealing with tool vendors who barely manage to keep themselves afloat, let alone invest in development, with long unmaintained libraries, with months, sometimes years passing between when a new architecture or OS is available and when the compiler and the libraries you use get updated.

It's not too different from how things are in Common Lisp land, a language (and a land...) that I'm pretty familiar with. It's a great, probably the best language. There are a few success stories, but truth is, in 2017, most large-scale, non-hobby projects are failures.

Ada, FreePascal, Oberon, ActiveOberon, ComponentPascal, Modula-3, D

All have GNU/Linux compilers available.

I love Ada, and I've written Ada code, but there are so few people who know it that building a community around an init system built in Ada is very difficult. The barrier of entry for contributions is "learn this language developed by the DoD thirty years ago that you won't use unless you work on embedded systems, in the US, for a living." I agree that it's a better technological choice than C, for any systems-level program, but Red Hat, like virtually any company out there, cares about money more than tech.

FreePascal, Oberon, ActiveOberon, are all great (I'm hesitant to say I know Oberon since I haven't written Oberon code in like 15 years), but besides having the same problem as Ada above, the communities maintaining the compilers are small and understandingly fragile. systemd is still going to be here 15 years from now. Oberon -- who knows?

Modula really belongs in a museum :-).

Besides, they'd all need things like D-Bus bindings etc., a working, stable compiler is just the first step.

Yeah, I am painful aware of the reality, being an Wirth language's fan since the early 90's.

The fact is that UNIX-like OSes are married with C, unless there is a commercial entity like Apple or Google, pushing out of the way, UNIX FOSS developers will always gravitate around it for system level applications.

It has always been like that, system languages that aren't the platform main language(s), are relegated to 2nd class status and eventually die or strive in a small niche.

Hence why I think UNIX only has a path to safety in the hands of Apple and Google, because I don't see *BSD or Linux developers using anything other than C for system level code.

It would appear none have sufficient interested developers to work on an init replacement
GNU Shepherd is an init replacement written in Guile, a dialect of Scheme. Guix ships with GNU Shepherd. Anything that runs in place of init should in principle be small, and hence not too difficult to write and maintain. So you are right that it is not any technical issues, but rather the disinterest of system software programmers in anything other than C, and the disinterest of language X programmers in system software, that is the main culprit.

https://www.gnu.org/software/shepherd/

https://www.gnu.org/software/guix/guix.html

Long time ago there was an attempt to build an userland in Ada, sadly they only managed to get an handful of developers.
systemd has had close to 1000 contributors now (as recorded by git), with 30-40 active per month. Higher than I imagined. https://www.openhub.net/p/systemd
I thought the piece of software under discussion was systemd-resolved. In which case-- why was it written in C?