Rustaceans Too Humble!

"Rust is a systems programming language that runs blazingly fast,
prevents segfaults, and guarantees thread safety." But actually, any
language, not just a systems language, needs to be fast (and
concurrent) and reliable.

Focusing on learning one language well will give a better outcome
than splitting the same commitment between learning two more specific
languages. So if possible, its better to focus on one language. If we
choose a high-level language it simply can't solve a whole category of
low-level problems. If we choose a low-level language, it mustn't be
too sub-optimal for high-level tasks. From this point of view, there
is only one programming language that we could genuinely call 'general
purpose' - Rust. So maybe we should start thinking about dropping the
'systems' and add 'general purpose', or at least make it a goal?

"Rust is a general purpose programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety." Sounds even better.

1 Like

Not convinced.

Have you ever used a programming language with dependent types? I mean where the type of a variable contains relationships it holds to other variables, like "this array arr has a length equal to that integer len." Rust's type system is positively lightweight. The keyword is proof-carrying code.

Do you need to process one big batch of data, just right now? Have you ever used a REPL as a programmable-graphing-calculator-on-steroids? There's really no point in using Rust unless it's a program you need other people to use (so you can't just fix it if it crashes), or it's going to take more time to run than to write (hard to predict, I know). There are a bunch of scientific libraries for Python because scientists write a lot of single-use programs. The keyword is interactive programming.

Are reliability and speed really your biggest problem? Most software projects don't fail because the implementation sucks. Most of them fail because the creators failed in requirements gathering, and just build the wrong thing. The keyword is exploratory programming.

Sometimes the rest of the world just isn't cooperative towards static typing, like if you have to talk to a bunch of other people's schema-less badly-documented REST APIs. That's what gradual type systems are for. (this is probably the worst reason, but it's one that real people have to deal with)

Or maybe your program just spends most of its time waiting for other programs to run.

I think I'd share my 2 thoughts about Rust slogan as well :slight_smile:

"Systems programming language without segfaults" part is spot on! Isn't it crazy that you can have a completely memory safe language without garbage collection? That you can rewrite a C library incrementally, function by function, and be sure that you are not creating new security vulnerabilities? And because we often hear something along the lines of "modern C++ is as memory safe as Rust, if you use it properly", we know that we communicate this point well.

But "guaranteed thread safety" is also unbelievable! You can send mutable data between threads, which goes completely against "shared mutable state concurrency is hot lava", but is nonetheless completely safe. You don't need to make your datastructures thread safe, because you know that compiler won't let you access them from different threads. But we don't often hear that "Java 8 streams are as thread safe as Rust" or "just use Akka". I think this means either that thread safety is not a big issue in practice, or that we are failing to communicate that Rust is magic when it comes to concurrency.

TLDR: we are doing great talking to C people about memory safety, but we don't talk to Java/Scala/C# people about thread safety as much.


I'd be very careful not to oversell Rust, because technical folks are very sensitive about overhyping things. However, I do agree Rust's homepage doesn't sell it well, but I think it's because of jargon.

What is "move semantics"? That sounds like academic program-language design jargon, and I'm not sure if anybody who hasn't used Rust before knows/cares about it.

"trait-based generics"? If I didn't know Rust already I'd have no idea why this is a good thing. I've heard of traits first in PHP, and generics in Java, and neither of these seemed interesting.

Overall the feature list is really just a very dry list of features, but it doesn't explain why these features are good.

  • "type inference" doesn't sound as great as "you get strict type-checking without having to write every type manually".
  • "threads without data races" could be "finds data races at compile time"
  • "minimal runtime" could be "can be linked with C programs with no hassle" and "works on microcontrollers"
  • "zero-cost abstractions" could be something like "high-level-language abstractions with zero cost at run time", etc.

i.e. explain benefits, not their implementation.