Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/01/21 in all areas

  1. Just wanted to gather the opinions with others and also put out some of my thought. It seems like the big contenders in this field are Rust, Zig and D. I think also Nim is targeting the system space programming of C along with V lang. Of all of the languages, I personally like the syntax of D and the meta programming concepts. Pretty much looks like what C++ should have been. I also like how memory safety in the compiler is not default and instead has to be specified when to use it and when to not. Might help cut down on compile times. A function that does a simple calculation like maybe calculating an interest rate might only be using stack variables and nothing allocated on the heap, so it doesn't really need the memory safety features wasting time on it, but adding a node to a list might. I have dabbled some in Rust. Honestly, I don't like it. The syntax just seems a little overly complicated and I feel like a lot of words in the ecosystem are not in fact new concepts, but instead renaming concepts already present in computer science. One thing I do like about rust, the compiler is verbose which always helps with troubleshooting/debugging. I do also like that is catches when branches of execution are not being handled such as exception handling. Zig has gotten some buzz in the BSD community but I see little else mentioned about it elsewhere. However, it is not at a 1.0 release yet, so that could be a reason why. Overall, I don't think these languages will fully replace C. It is just so easy to port and get stuff bootstrapped. Not to mention the time and resources needed to re-implement something like the Linux kernel in 100% Rust or another language would take forever. I see the C language being timeless and always having a use case. Maybe it will lessen some with the like of Rust, D and Zig starting to come up, but we probably won't have a day in my lifetime where C code isn't at play somewhere.
    2 points
  2. I agree that C isn't going anywhere. COBOL is still around, and I think that at this point C is more entrenched than COBOL ever was. Not everything is going to be rewritten. I can understand the aversion to Rust's verbose-looking syntax, but I think that the sacrifices in convenience are made worthwhile by the compile-time safety guarantees and expressiveness that Rust provides. On the syntactical level, C is simple, but the runtime behavior is difficult to reason about. This is evidenced by the countless security vulnerabilities that arise from common, but easy to make, memory management mistakes. The Rust compiler is able to eliminate these bugs at compile time, in part due to syntactical constructs relating to things such as variable mutability. Rust's type system is also stronger and more expressive than C's, which might make it more difficult to learn initially, but in my opinion it's very nice to have features like generics, instead of needing to rely on things like void pointers. Of course, it takes longer for Rust code to compile than C code, but in most cases I am fine with compile time for more compile-time safety and better ergonomics provided by the type system. To get back to the original topic though, I think it would be ideal for C to eventually get replaced with a more modern alternative that fixes some of C's pitfalls, but I don't think it's going to happen anytime in the near future. The cost of rewriting things can be excessive in many cases (like Linux for example), and there might be no practical benefit in rewriting a finished C program that has been already formally verified (thinking of aerospace software when writing this). Also, there are platforms where only C compilers (or outdated C++ compilers) currently exist, and making a compiler for one of these replacement languages target such platforms could very well be too costly to be worth it.
    1 point
  3. @WarFox I don't think that C will ever completely be replaced. At least in certain areas, like embedded programming where there are so many libraries written in C. In other areas, though, C might not be "king of the hill." I honestly haven't looked into some of the replacement languages like Rust, but was interested in playing around with it after reading about Wasm. C will always be here. I think it will be interesting to see in what areas its replacements become more popular, though!
    1 point
×
×
  • Create New...