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.

Show thread

@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.

@Binder @tek

> 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, benchmarksgame-team.pages.debi 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

@codesections @tek Same thing can be said about Java. Microbenchmarks are easy. Systems are hard.

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.

@Binder @tek

> 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)

@codesections @tek
Last I looked at rust was ~1yr ago.
The borrow checker was still a PITA and there are various things which are dang near impossible in the language. (Doubly linked list).

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.

@Binder @tek

> Give rust a decade and we'll see how it sorts out.

Couldn't agree more :D

(though I plan to be along for the ride during that decade!)

Follow

@codesections @tek I've used something like 15 languages professionally. They are all tools, and I use the one I think is the best fit for the job.

· · Web · 0 · 1 · 3
Sign in to participate in the conversation
Mastodon 🐘

Discover & explore Mastodon with no ads and no surveillance. Publish anything you want on Mastodon: links, pictures, text, audio & video.