Re:Torvalds: You can avoid Rust as a C maintainer, but you c...
by pclmulqdq on Monday February 24, 2025 @08:13AM
(#43159149)
I am not convinced, given the amount of heavy lifting that the Rust type system does, that rusty Rust is nearly as brain-compilable as C. However, you can write the equivalent of C in many languages, and Rust is one of them. That kind of code is easy to compile in your head.
[ Parent
| on HN ]
Re:Torvalds: You can avoid Rust as a C maintainer, but you c...
by bayindirh on Monday February 24, 2025 @08:17AM
(#43159201)
It's not brain-compilability, it's getting used to what that specific compiler does with your code you brain-compile.
So, I have a model for my code in my brain, and this code also has a real-world behavior after it's compiled by your favorite toolchain. You do both enough times, and you'll have a feeling for both your code and the compiler's behavior for your code.
This feeling breaks when you change languages. I can brain-compile Go for example, but compiler adds other things like GC and null-pointer protection (carry local variables to heap if you're going to hit a null pointer exception after returning a function). Getting used to this takes time. Same for Rust.