I hope Rust or Rust-like languages make it into the kernel, but I think it's worth noting that a huge problem right now is the toolchain and its dependencies. Go may have a better story here though I wouldn't bet on it being a more likely choice for kernel mode.
Nothing at all, really, but kernel developers are going to be picky. For example, does LLVM target all of the architectures Linux supports today? Also, I think it's hard to sell Rust as a hard dependency of the Linux kernel when it isn't nearly as widespread as almost every other kernel dependency.
I also sorta remember some kernel developers (not necessarily Linux) making a fuss about rustc using a huge amount of address space and not working on 32-bit systems for that reason - although frankly, I can't remember where I read that and I'm starting to question how much I'm misremembering there.
> I also sorta remember some kernel developers (not necessarily Linux) making a fuss about rustc using a huge amount of address space and not working on 32-bit systems for that reason - although frankly, I can't remember where I read that and I'm starting to question how much I'm misremembering there.
Yep, that's exactly what I was remembering. Though I disagree that rewriting coreutils in Rust is a good place to start, there are definitely some valid points in there. I wonder if the i386 situation has been resolved at this point.
Well, if you want to be pedantic, there's already non-C code in the kernel, it just doesn't make it into the runtime. I've seen Linus's opinion on C++ in the kernel, but I've never seen anyone explicitly state that no other languages would be accepted. I'm sure that it's something that's always possible even if very unlikely right now.
Blanketing every architecture LLVM doesn't support that GCC does an "obscure hobby architecture" is not really a great way to look at things imo. I haven't looked into it but I'm pretty sure outside the bubble of desktop computers there are plenty of important uses of Linux on less common architectures, I would assume mostly embedded systems.
When I said dependencies, I was not referring to dependency management. I was referring to the footprint of the toolchain. I'll reply to parent on what I meant in more detail, though.
I'm not a kernel programmer, and I haven't used Rust before, so take that into consideration.
Some of my favourite things about Ada is it's approach to concurrency, which (I think) is far superior to other imperative concurrent languages like Go. We should never have to deal with low-level primitives like semaphores and mutexes - it's 2018! Why are we stuck in the 80s?
I've heard that concurrency is difficult in Rust, but I've never used it, so I can't comment. I plan on learning very soon!
Not sure why I'm downvoted for this. I struggle to think of a "modern" imperative language that offers similar levels of safety and concurrency, aside from possibly Rust. Erlang is fantastic, but not imperative.
Go has channels, which is nice enough for message-passing behaviour, but nothing for elegantly sharing memory. ("Share memory by communicating" doesn't always work)
Things like conditional critical regions, monitors, and protected objects are much better abstractions for concurrency.
> I struggle to think of a "modern" imperative language that offers similar levels of safety and concurrency, aside from possibly Rust. Erlang is fantastic, but not imperative.
Which is fine, since D is supposed to be a better C.
I wouldn't consider its concurrent primitives comparable to Ada. This is to be expected, since I don't believe they aim for such a nuanced level of concurrency. The Ada runtime is incredibly huge and complex - it was created by the US military, after all.
One of the talking points of Rust is fearless concurrency.
Concurrency in Rust is not difficult (neither complex nor error-prone), but you have some high-level primitives that you must know how to choose and use.
That is an incorrect analogy. Semaphores are the "goto" statement of the concurrent world.
Semaphores are not typed. They is no semantic connection to the thing they protect. Debugging concurrent systems with mutual exclusion enforced through these low-level primitives is a nightmare.
If you forgot to lock/unlock, you'll never know! The compiler cannot check it. Deadlocks are imminent.
We've had better abstractions since the 80s. Conditional critical regions, monitors, and (ideally) protected objects. Hell, even guards are better than semaphores and mutexes - at least they are associated with their critical region!
I struggle to think of situations where a semaphore is the best choice. Maybe in extremely high-performance cases, but even then the compiler can usually make a better decision.