Comments by "Scott Franco" (@scottfranco1962) on "Next Phase For Rust In The Linux Kernel" video.
-
@lorabex791 1. I work at Google, so no. As in they may be trying to do it somewhere, but not here. We still use it. Whatever people think of C++, they worked very hard to make sure it was efficient. 2. Drivers are different than kernel code. The majority of drivers are created in industry (I have worked on both disk drivers and network drivers), and a lot of it is C++ nowadays, which is the preference. There are a lot of Windows drivers in C++, and it is customary to borrow code between windows and Linux drivers. 3. I wasn't talking about replacing any code. This is about new drivers.
I don't have a dog in this fight. As a driver/low level guy I do most of my work in C, but increasingly I have to do C++ for higher level stuff. Google loves C++ (despite what you heard). Rust is "said" to be gaining traction at Google, and I have done deep dives in Rust, so I'm not (completely) ignorant in it.
Any language that claims to be a general purpose language, IMHO, has to have the following attributes:
1. Generate efficient code.
2. Interoperate with C since that is what virtually all operating systems today are built in. This includes calling into C and callbacks from C (I don't personally like callbacks, but my opinion matters for squat these days). [1]
Rust is fairly good at calling C, and gets a D grade for callbacks. Golang is basically a non-starter, because they have such an odd memory model that interactions with C are expensive.
Any language can interoperate. Python can call into C, and its an interpreter. Its about efficientcy.
Obviously its a moot point at this time, since "Linus an't a gonna do it", but it should be discussed. C++ is too important a language to ignore, especially if rust gets a pass.
Notes:
1. There are some rocks in the stream of C, including zero terminated strings and fungible pointers (pointer parameters that are NULL for "no parameter" and small integers for "not a pointer"). Most languages outside of C do not support some of all of this. These are bad habits in C and are eschewed these days, see the various arguments over strcmp vs. strncmp.
2
-
1
-
1