3 ms·
No, I wouldn't say C is the least terrible option. Languages like Ada/SPARK, C++, D, Rust, and Zig all outclass C in terms of safety and usability without sacri
by SubjectToChange 6y ago
No, I wouldn't say C is the least terrible option. Languages like Ada/SPARK, C++, D, Rust, and Zig all outclass C in terms of safety and usability without sacrificing performance. And although ATS has many sharp edges, it demonstrates how a functional language can have the exact same profile as a C program.
I think it would be a profound mistake to write a new OS in C. The safety issues are reason enough to abandon the language.
- young_unixer 6y agoFrom a language design perspective, C++ is worse than C. From a practical perspective, C++ can be better than C if the programmers are good and define a sane subset of the language to use. D has garbage collection by default. I know it can be disabled, but when 80% of people use the default, using anything else means means you're a second class citizen. Ada/SPARK I haven't looked enough into, mainly because Ada's extremely verbose syntax puts me off, and I guess most system programmers have a similar opinion. Rust and Zig have big potential to become good languages, but they're too immature right now (no standard, only 1 viable implementation, etc). Maybe in 10 years using Zig to write an OS will be a no brainer, but not yet.