I think Rust's documentation has some of the best new-user onboarding I've seen in a long time. I dig Go, but its docs mostly start with "here's how you structure a project". For instance:
> To compile and run a simple program, first choose a module path (we'll use example.com/user/hello)
What's example.com? Am I supposed to replace that with a real value here? Does it have meaning? Will stuff break if I choose badly (or don't choose)?
That said, let me dig in for a while and I’m sure I’ll find something to grouse about.
But seriously, between Go and Rust, I can’t see ever starting a new project in C again.
@tek C and go don't do the same thing, and rust is a giant PITA.
To get rust to do the things C can do you have to unsafe, which defeats the purpose anyway.
@Binder I'd rather a tiny part of the codebase be unsafe than all of it. C is an awful, slow language and I'm glad to see any viable alternatives come along.
@tek C isn't awful and certainly not slow.
It is a tool, and has a specific purpose. Except for some specific cases, anything safer than C must be slower than C.
Despite the improved tooling like static analysis, people just don't learn to use C properly anymore.
Even 20 years ago you would use C for the parts of the codebase which needed it, and perhaps another language for pieces which did not.
> Except for some specific cases, [in Rust] anything safer than C must be slower than C.
That hasn't been my personal experience with #rust. For example, consider the four toy benchmarks where Rust outperforms C, https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/gcc-rust.html In two of those, the Rust code uses `unsafe`; in the other two, it doesn't.
I know that's one data point, but it matches my experience – getting C-level performance from Rust will *sometimes* require `unsafe`, but just as often will not
When Java was first released it was touted because of how safe it was and how it would eliminate whole classes of security problems as well.
C has no overhead, ie: there are NO rails. Sometimes you can add safety with zero overhead, but its hard. In all other cases you are adding execution cost.
> Microbenchmarks are easy. Systems are hard.
Agreed 100%. #rust is just getting started, and I understand the skepticism—Rust makes some pretty bold claims, and the evidence to back them up is just starting to come in.
> Sometimes you can add safety with zero overhead, but its hard.
Agreed 100%. Rust's pitch—which I buy, but you may not—is that we can find those opportunities (aka "zero-cost abstractions") and then reuse them (either as libraries or part of the std library)
I've very concerned with memory movement for performance, but time will tell.
Give rust a decade and we'll see how it sorts out.
Discover & explore Mastodon with no ads and no surveillance. Publish anything you want on Mastodon: links, pictures, text, audio & video.