(Replying to PARENT post)

Is Rust truly the first good candidate for Linux's second language? Why didn't older languages get this far?
πŸ‘€oDotπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

>Why didn't older languages get this far?

It is the "first language" that Linus didn't object to. He hated both C++ and Ada. I am not entirely sure if he really likes rust, sees borrow checker as something important worth trying, or lost to the pressure from RESF ( Rust Evangelism Strike Force ) within the linux kernel dev community.

He is a proponent of C because he can imagine, or envision the generated assembly from C compiler. Something like a High Level of assembly. And something along the line of people who can write good C code tends to have all the scar tissue to prove it.

πŸ‘€ksecπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

The benefits of other languages didn't outweigh the costs associated.

The only major one I know of was some push for C++ which Linus wasn't a fan of: http://harmful.cat-v.org/software/c++/linus

πŸ‘€bombcarπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

It’s truly the only low-level language that could actually be used for systems programming.

C#, Java? Managed code with JITs, not supported on a kernel level no-way no-how. Ditto for Python, PHP, JavaScript, and other high-level languages without pointers and all that jazz.

Go would be close… but it requires bundling a bunch of libraries in with each binary and wasn’t designed for low-level development. Again unsuitable.

C++? Linus Torvalds and the kernel developers hate it for being unnecessarily complicated and only making things harder to maintain while bringing little to the table at this point (they’ve made it this far without classes, and C++ doesn’t bring anything new like memory safety).

πŸ‘€gjsman-1000πŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

Probably because the older languages did not bring enough to the table versus C.

I've notice that the trend of new compiled language is fairly recent with Nim (2006)/Go (2009)/Rust (2010). The previous trend was more oriented toward interpreted languages Python (1991)/Ruby (1995)/Javascript (1995).

So maybe, 10 years is the maturity age and we will see more of those language used for Linux kernel development.

πŸ‘€skywal_lπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

Many other potential systems programming languages are object-oriented (C++, D), which at the very least counts them out because Linus and perhaps the rest of the core team dislikes OOP. I can't say one way or the other whether their assessment is objectively correct, but another data point here is that Windows, while mostly written in C++, also sticks to C for the kernel, and even the C++ code sticks to C-compatible APIs at module boundaries, for maintainability reasons. Complexity may only arguably be a shortcoming of object-oriented languages, but compatibility is absolutely a problem.

Others, like Go, use garbage collection. That may not be universally unacceptable in OS kernels, but it's certainly not something anyone wants to see happening in the Linux kernel, which sees use in applications with low-memory and real-time constraints.

And the rest are dead or dying languages such as Pascal and Ada.

I can't speak to Rust's merits, I don't know it well enough, but if some reasonable subset of Rust makes it easy to stick to C-compatible ABIs without sacrificing most of the language's practical differences from C, then I would say that, yeah, it may truly be the first good - or even reasonable - candidate.

πŸ‘€mumblemumbleπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

Mostly because Linus hates C++, basically.

Other candidates like Modula-2 or Ada, never had big sucess in UNIX space.

Objective-C never went beyond NeXT and Apple (yes NeXTSTEP drivers were written in Objective-C).

πŸ‘€pjmlpπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

We have to rule out any language with a garbage collector. C++ adds about as much negative as positive to be worth while. That doesn’t leave many other options.
πŸ‘€goaliecaπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

> Why didn't older languages get this far?

People are talking about Linus' opinions of some other languages, but more importantly the Rust folks have been prepared to put in a lot of work to meet Linus' concerns. You're now seeing all sorts of other language advocates pop up with D, Zig, and so on, but they've not put in the same work to convince Linus that anything else are real options.

πŸ‘€rodgerdπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

Rust actually has support for freestanding programming without any standard library.
πŸ‘€matheusmoreiraπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

The list of appropriate languages is short. Here's what I have, for non-GC, systems languages, other than C:

- C++ - Rust - Zig - Ada

πŸ‘€the__alchemistπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

I guess it's because Rust is a "safe programming language" and the world needs that.
πŸ‘€henpaπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

Because no one bothered. I would rather prefer the drivers be written in Ada/SPARK.
πŸ‘€johnisgoodπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

Rust seems to be the first decent alternative to C that works for Linux and has momentum to invest in it.

I think Linus also commented that it has to be exciting and interesting for developers besides being useful obviously.

πŸ‘€shmerlπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

There are not many older languages that specifically targeted low level programming and gained some level of traction, which I cannot think out of C++ (and perhaps D? but it's not really popular).
πŸ‘€summerlightπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

popularity, safety guarantees, no GC, modern features

There might be objectively better languages for kernel development out there, but it doesn't do any good if nobody uses or knows them.

πŸ‘€fnord77πŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

Because c is simple.

Rust has many qualities, but it's not a simple language.

The problem with complex languages is that they are ill suited for low level stuff.

Sometimes it's better to not have high level language features, because it allows everybody to understand the code without having to know every feature of the language.

Simple is better. There are too many developers who prefer complexity.

πŸ‘€jokoonπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0

(Replying to PARENT post)

Less religious missionaries. Also, less funding by FAANG.
πŸ‘€fxtentacleπŸ•‘4yπŸ”Ό0πŸ—¨οΈ0