Still dabbling with Rust.

I'm currently writing the same thing in Rust and in C: A little `ls`.
Just show the files with modes and stuff. A learning project.

As for Rust: It is such a relief that I don't constantly have to worry
how this or that might crash the program in unexpected ways. "Is this a
valid pointer, can this overflow, where do I free this, ..." The
compiler checks it all for you and you still get a binary that runs fast
(not an interpreted script like Python, not Java bytecode, not something
with garbage collection like Go). If it compiles, it won't crash weirdly
or, worse, appear to work but actually doesn't.

C is a great language because it's so simple, but there are so many
pitfalls. When you use it long enough, you become blind to all those
dangers. But really, it's quite horrible. As I was writing my `ls`, I
immediately ran into one of these traps: `realloc(foo, num_allocated)`
instead of `realloc(foo, num_allocated * sizeof (struct TheThing)`. Bah.
Of course, it's a very stupid mistake ... but stuff like that only
happens in C (and ASM, maybe). Other languages got that sorted out and
*help you*.

Then on the other hand: The build directory for my Rust program is 15 MB
in size. That's already too much, if you ask me. And that's the tiny
version, because I already use some flags to recude that size. The
normal "debug" version is a whopping 85 MB. It is almost impossible for
me to make peace with the fact that Rust and Go create such enormous
binaries and build artifacts.

Also, Rust is just a horrible language. They keep adding language
features all the time. Who is supposed to learn all that stuff and keep
up with it?

Go is much simpler than Rust. I'd consider switching to Go if I didn't
get the impression that it's also mostly meant for "modern" application
models: Build a program, then deploy it on some server or in Kubernetes.
For this use case, all the static linking is great. You can use a tiny
"operating system" as you base layer, then put your one single Go binary
(or Rust binary) there and it just works. Same goes for when you want to
provide precompiled binaries to your users -- static linking and all
that, it's great.

Rust is still so young, I don't know if they want to keep going that
direction. But Go? That's pretty much settled, from what I can tell. So,
yeah, I guess I'll keep exploring Rust in the hopes that it eventually
becomes a generic replacement for C++ (with the distribution packaging
libraries and all that).

I mean, I am getting older and I've used C for a pretty long time now,
so I'm very used to how things work there ... Maybe I just need more
time to grow fond of Rust, because I'm getting -- wait for it -- rusty.
Sorry, I'll see myself out.