Originally posted by slalomsk8er
View Post
Announcement
Collapse
No announcement yet.
Codon Looks Very Promising For Super-Fast Python Code
Collapse
X
-
-
Originally posted by Barnacle View Post
Yeah, that is totally valid. I'm just lamenting the amount of over-engineering that goes into a lot of languages that think they are going to take on C in performance, while simultaneously dumbing down the language and "auto optimizing" performance.
But also, C itself can be optimized a lot. What do you think an optimizing C compiler is? It has to use human intuition to find common patterns in code and rewrite them into a more optimized version. Yeah, if you're a genius or a savant you can do that manually, but most people write inefficient C code and let the compiler try (and sometimes fail and introduce bugs) to optimize it. There are countless computer science theories and experiments for making good programming languages that optimize themselves instead of trying to make a bloated compiler trying to mimic human intuition. Rust for example lets the compiler know a lot of extra things about a program as a fact, instead of trying to "guess" what a C program is trying to do, due to lifetime annotations.
I don't know if you think like this or not, but just an aside, I find it so disappointing this cult of "C is performance incarnate, no other language can compare" is so prevalent. People need to realize C isn't a magic spell, it compiles to machine code like any other language. All optimizations are how well the tools are made and how smart the tool user is. Tools can always be improved, it's literally cult behavior to imply they can't. C is not the Messiah, it's a tool that can, should, and will be replaced by a better one, because we are human beings and we evolve.
- Likes 2
Comment
-
Originally posted by Ironmask View PostBut also, C itself can be optimized a lot. What do you think an optimizing C compiler is? It has to use human intuition to find common patterns in code and rewrite them into a more optimized version.
Originally posted by Ironmask View PostYeah, if you're a genius or a savant you can do that manually, but most people write inefficient C code and let the compiler try (and sometimes fail and introduce bugs) to optimize it.
Originally posted by Ironmask View PostThere are countless computer science theories and experiments for making good programming languages that optimize themselves instead of trying to make a bloated compiler trying to mimic human intuition. Rust for example lets the compiler know a lot of extra things about a program as a fact, instead of trying to "guess" what a C program is trying to do, due to lifetime annotations.
Originally posted by Ironmask View PostI don't know if you think like this or not, but just an aside, I find it so disappointing this cult of "C is performance incarnate, no other language can compare" is so prevalent. People need to realize C isn't a magic spell, it compiles to machine code like any other language. All optimizations are how well the tools are made and how smart the tool user is. Tools can always be improved, it's literally cult behavior to imply they can't. C is not the Messiah, it's a tool that can, should, and will be replaced by a better one, because we are human beings and we evolve.
Golang was pretty close to being a decent language, but they messed up by having horrible interop with C, and the lack of separation between the OS kernel and the core language. Thus Golang became a niche language for web services, and not something that could ever take on C as the language that makes the computing world go round. Rust had even wackier ideas and went full-C++ right from the start, and has yet to really find a niche in anything 14 years later other than "Pacman, but written in Rust!" Github projects.
Comment
-
Originally posted by Barnacle View PostWhat C has going for it is that the core language is extremely low level and properly separates any interaction with the OS kernel from the core language. I would be open to an "improved, modern" replacement for C, but only if it keeps everything that is good about C, and maintains excellent compatibility with C, since the OS is written in C and even POSIX standard states the OS is to be written in C. Thus far, every language attempting to replace C has failed at this, and AFAICT the language designers never even figured out the reasons why, because they didn't properly understand the thing they were attempting to improve upon.
There are attempts to make new, stronger universal ABIs for languages to adhere to, but it's kind of under the radar. Most people are just focusing on tools that translate C APIs to other languages, and thats primarily where efforts are headed.
I've written it in another post in some other thread, but the reason nobody replaced C yet is because every language sucked. C++ sucks (just read Torvalds' rants on it), and no other language is even meant to be low-level, all requiring some huge runtime or GC or exceptions or other silly things. Rust is, somehow, the first unique low-level language to finally fit a gap that hasn't been filled in the last 50 years. It's why you now see it being included in nearly every major C/C++ codebase where no other language has ever done that.
Originally posted by Barnacle View PostRust had even wackier ideas and went full-C++ right from the start, and has yet to really find a niche in anything 14 years later other than "Pacman, but written in Rust!" Github projects.
I'm guessing you haven't been on this website in the last 4 or so years, Rust is already in Linux and several companies have rewritten their Go code in Rust.
It's not reached it's full potential yet, but it's largely replaced Go as an optimized server component, so it's at least already taken over that field, and it's on it's way to becoming the definitive new way to write device drivers. It's certainly showing no sign of slowing down.
Not to mention how dismissive that "14 year" statement is. It was nothing more than an obscure experiment for the first ten. People only really started to take note of it about 4 years ago (which is around when it hit 1.0), so thats actually some pretty explosive growth.Last edited by Ironmask; 26 March 2023, 11:13 PM.
Comment
-
Originally posted by Ironmask View PostI'm guessing you haven't been on this website in the last 4 or so years, Rust is already in Linux
Originally posted by Ironmask View Post...and several companies have rewritten their Go code in Rust.
It's not reached it's full potential yet, but it's largely replaced Go as an optimized server component, so it's at least already taken over that field, and it's on it's way to becoming the definitive new way to write device drivers. It's certainly showing no sign of slowing down.
Originally posted by Ironmask View PostNot to mention how dismissive that "14 year" statement is. It was nothing more than an obscure experiment for the first ten. People only really started to take note of it about 4 years ago (which is around when it hit 1.0), so thats actually some pretty explosive growth.
Comment
Comment