Back in the day Dijkstra wrote his famous letter to the ACM: "Go To Statement Considered Harmful". His argument was not that GOTO was intrinsically a bad thing but that it made it easier for sloppy, lazy, programmers to create code that was a tangled mess that was impossible to reason about.Even if you don't use or want very much object-oriented programming, I suspect the difficulty is that a working C++ compiler needs to be able to create all those those data structures and objects, just in case, and this is not possible for certain classes of micro-controllers. Oh well, I read that people are working on adding a wrapper library to the Linux kernel that allows coding loadable modules in Rust.
Linus Torvalds did not want to write his kernel in C++ or allow any C++ in it. When asked about that he will explain that it's because C++ OOP style and all the other features of C++ make it easy for sloppy, lazy, programmers to create code that was a tangled mess that impossible to reason about.
In effect he was saying "OOP Considered Harmful".
Oddly enough, I notice that recently people have started to come round to that idea. At least C++ style OOP.
Rust is perhaps the first language that is suitable for use in the kernel. Besides C of course. Personally I don't like the idea of mixing up different languages in a code base like the kernel. Especially since at the moment you would need both GCC and LLVM to build such a hybrid kernel and modules. That is a requirement to far...
Luckily we have two gigantic vendors who have a vested interest in their compilers producing efficient code. Both for two different architectures, x86 and ARM. Hence they both put so much work into LLVM. Which has the happy side effect of making it easy to reuse all that work to target other architectures, like RISC V.Since a high-quality open-source optimizing compiler and operating system is a threat to the business model of hardware lock-in practiced by some manufacturers, those manufacturers have become generous with funds and manpower for improving the tool chain to the point it become so complicated it can no longer be retargeted easily to new computer architectures.
Yeah, where did DavidS get to?Some time ago there was a thread about creating a new compiler for the Raspberry Pi simple enough that a single person could write it as well as audit it for security issues.
In this marathon series of live streamed coding by Per Vognsen, bitwise: https://www.youtube.com/watch?v=Oeqeqw4OHPE&t=5s, he writes a compiler for a language, Ion, which is basically C but with it's syntax streamlined to make it easy to write a compiler for.
Interesting article. He says sch things as "How much better could things actually be if we abandoned the enterprise development model?"Along similar lines, some blogger recently noticed...
He's only a couple of decades behind the times. Such thoughts have been discussed since before the Linux kernel was a thing and Open Source was "invented".