| ▲ | pessimizer 15 hours ago | |
No. As you've made clear, it's a question of being able to express things in a way that gives more information to a compiler, allowing it to create executables that run faster. Saying that a language is about "expressability" is obvious. A language is nothing other than a form of expression; no more, no less. | ||
| ▲ | toodlemcnoodle 15 hours ago | parent | next [-] | |
Yes. But the speed is dependent on whether or not the compiler makes use of that information and the machine architecture the compiler is running it on. Speed is a function of all three -- not just the language. Optimizations for one architecture can lead to perverse behaviours on another (think cache misses and memory layout -- even PROGRAM layout can affect speed). These things are out of scope of the language and as engineers I think we ought to aim to be a bit more precise. At a coarse level I can understand and even would agree with something like "Python is slower than C", but the same argument applies there as well. But at some point objectivity ought to enter the playing field. | ||
| ▲ | irishcoffee 14 hours ago | parent | prev [-] | |
> ... it's a question of being able to express things in a way that gives more information to a compiler, allowing it to create executables that run faster. There is expressing idea via code, and there is optimization of code. They are different. Writing what one may think is "fully optimized code" the first time is a mistake, every time, and usually not possible for a codebase of any significant size unless you're a one-in-a-billion savant. Programming languages, like all languages, are expressive, but only as expressive as the author wants to be, or knows how to be. Rarely does one write code and think "if I'm not expressive enough in a way the compiler understands, my code might be slightly slower! Can't have that!" No, people write code that they think is correct, compile it, and run it. If your goal is to make the most perfect code you possibly can, instead of the 95% solution is the robust, reliable, maintainable, and testable, you're doing it wrong. Rust is starting to take up the same mental headspace as LLMs: they're both neat tools. That's it. I don't even mind people being excited about neat tools, because they're neat. The blinders about LLMs/Rust being silver bullets for the software industry need to go. They're just tools. | ||