by paulddraper · 9y ago · 0 comments
At a macro scale, I have no doubts that Rust's benefits will win out. Understandable abstractions, fearless concurrency, etc. At a micro level, I would be surprised if some ugly, reprehensible C wasn't faster.
I think Rust's approach to systems programming is superior in many ways. I just won't be surprised if it loses a microbenchmark.
Then again, I don't really believe that the optimization opportunities are likely to ever matter much. At least not at this level. Perhaps for much more complicated things, e.g. a kind of compile-time sql or string-matcher the greater safety and the symbolic nature of the macros will let programmers write libraries that practically reason about instructions you give them and choose optimal strategies where C would need to do so at run time or with unmaintainable and unusable macros, but if it's just aliasing and some threading gains - well, those aren't huge often, and where they are, C can use em unsafely too (and that's often quite doable too!).
Safety and maintainability sound like more realistic selling points to me - it may never actually beat C in real-world performance; but it doesn't have to - it just needs to come close.
While this is also true (there are certainly correct programs that aren't writable in rust without unsafe{}), in this context I'm guessing you mean "incorrect programs".
The same is true of C; some ASM programs can't be transcribed in a way that pleases a C compiler.
I didn't say that Rice's theorem wasn't true. I said that in this case it doesn't matter. If program fails to compile, you don't give up because of Rice's theorem, you modify program to make it compile.
Will it make program less efficient? Who knows. There's no theorem about that. Most likely it will.