Remix.run Logo
hardwaregeek 3 days ago

Nice! I've wanted to give a similar talk. My thesis is that Rust won on usability above all else. If you look at the semantics of Rust, it's essentially an ML style language with typeclasses and linear types. In some alternate history that's a PhD thesis by someone at Inria that exactly 4 people use. But by making the language actually usable with good errors, familiar syntax (yes, syntax matters!), and documentation, Rust got users. I don't want to get into an in depth comparison but if you look at the documentation of even the most popular functional languages, it's not even close. And they've had a head start of decades!

tialaramex 3 days ago | parent | next [-]

To be clear: Rust does not have linear types. Rust has affine types. An affine Goose can't destroyed more than once. However zero isn't more than one. A linear Goose must be destroyed exactly once. Austral would be an example of a language with linear types.

In C++ if we destroy this Goose twice, probably everything catches on fire, whoops.

In Rust or Austral if we attempt to destroy this Goose twice the code doesn't compile. No executable for you until you stop destroying the Goose twice.

In C++ or Rust if we forget to destroy the Goose, the Goose-destroying code never runs. Hope that wasn't important.

In Austral if we forget to destroy the Goose, the code doesn't compile. No executable for you until you ensure the Goose is destroyed.

pornel 3 days ago | parent | prev | next [-]

Rust has a combo: people come for safety, stay for usability.

Languages struggle to win on usability alone, because outside of passion projects it's really hard to justify a rewrite of working software to get the same product, only with neater code.

But if the software also has a significant risk of being exploited, or is chronically unstable, or it's slow and making it multi-core risks making it unstable, then Rust has a stronger selling point. Management won't sign off a rewrite because sum types are so cool, but may sign off an investment into making their product faster and safer.

torginus 2 days ago | parent | next [-]

Generally speaking I was more prone to agreeing with Rust-haters, and thought the whole idea of how Rust lifetimes are implemented is flawed, and the borrow checker is needlessly restrictive. I also disagree with some other ideas like the overreliance on generics to do static dispatch leading to large executables and slow compiles.

To be clear I still think these criticisms are valid. However after using the language in production, I've come to realize these problems in practice are manageable. The langauge is nice, decently well supported, has a relatively rich ecosystem.

Every programming language/ecosystem is flawed in some way, and I think as an experienced dev you learn to deal with this.

It having an actual functioning npm-like package management and build system makes making multiplatform software trivial. Which is something about C++ that kills my desire to deal with that language on a voluntary basis.

The ecosystem is full of people who try to do their best and produce efficient code, and try to understand the underlying problem and the machine. It feels like it still has a culture of technical excellence, while most libraries seem to be also well organized and documented.

This is in contrast to JS people, who often try to throw together something as fast as possible, and then market the shit out of it to win internet points, or Java/C# people who overcomplicate and obfuscate code by sticking to these weird OOP design pattern principles where every solution needs to be smeared across 5 classes and design patterns.

catlover76 a day ago | parent | prev [-]

[dead]

mrklol 3 days ago | parent | prev | next [-]

Not sure if I would follow that point about usability. For me usability means also how usable it is to new people. How usable is the language to a foreign person compared to e.g. Python, Go or even Java - or if you want to mention functional languages like F#?

But besides that I am totally on your side, usability is great.

IshKebab 3 days ago | parent | prev [-]

Couldn't agree more about the syntax. It may be "ugly" but it's just so much easier to mentally parse than ML-style syntax.