On modern programming languages and growing hardware complexity

Thanks for channeling this into its own topic @HadrienG !

I will support the general idea that Rust has to be a conscious decision. I can do with a few lines of bash/perl/groovy things that would take a day's worth of C/Rust. For most things, I'd get acceptable performance quicker in high level languages.
But, after I've tried the quick, high level solution and deemed it too slow, (which happens regularly, though not often) I am down-on-my-knees grateful that I can use Rust, instead of C.

I consider myself something of a language polyglot, having programmed in Java, Python, Groovy, Bash, Perl and Rust for production use cases in bioinformatics.
Importantly: I am NOT a C/C++ developer with years of experience, and I am NOT a Functional wizard with Haskell/Lisp/Erlang experience.

I am not the worlds best programmer. I learnt mostly in dynamic languages, and I WILL mess up some obscure pointer aliasing, cache invalidation or thread safety rule if you let me.
Rust tells me when I'm about to do this, every time I hit "compile". If I had to do it in C, probably my production server logs would tell me, on a Monday morning after the servers spent an entire weekend twiddling thumbs because my code segfaulted two minutes after I left the office.

I often get the impression that people who complain about "fights" with the borrow checker feel that it an unnecessary obstacle. I however see it as a safety net telling me I've missed an edge case I am too inexperienced to recognise.

Also, I can have my cake and eat it too; write most stuff in Python, Perl or Groovy, and embed some compiled rust in the hot loops (numpy style). I haven't used it yet; but I a so pleased to have the option!

I suspect that I am not alone in being conservative with my risk. The part where programmers "waste everyone's time and cycles" is not out of malice, but out of fear/caution to not mess it up.
I'd rather my program be slow in python than crash because I misused C-embedding.
Rust allows me to learn and experiment with native coding, confident that the compiler and\or type system will catch me.

In that respect, Rust doesn't offer new possibilities for performance tuning and close-to-the-metal programming, but it does expand the audience of people to whom it is available.

18 Likes