Follow

rust (early impressions) 

So far, I think this Rust language is probably fine for writing and maintaining programs in.

I'm writing a tiny little utility. It needs so little from a runtime, and it's so peripheral to the system's core concerns, I thought stay-small-and-load-quick would be good qualities.

Seemed like a good candidate for an experiment with Rust, given its ahead-of-time compilation and lack of overhead for memory management.

What I've got so far — which barely does more than parse its arguments — is faster than a minimal CPython program and takes less memory, but CPython doesn't do so badly in comparison.

(I expect they probably scale very differently once you move out of this teensy-scale program; Python imports can accumulate fast.)

re: rust (early impressions) 

And my rust-produced executable is a lot bigger than I expected. That's also the sort of thing I only noticed because of this low-footprint goal; it's a concern that will vanish as you move into medium-size programs.

I'm enjoying this as a learning exercise, but practically speaking, is it a good fit for this case?

Maybe should have stuck with Python, assuming there's a shared instance of it already installed on the target. Which would be true of pretty much all Ubuntu-derived installations (it's in ubuntu-core), but maybe it's not as core to Debian as I thought, and it's unclear what runtimes will be available to future versions of OS X. 🤷

Making guesses about portability is hard!

(The initial impetus for this utility was something I couldn't figure out how to make readable in POSIX sh/sed/awk.)

Show thread
Sign in to participate in the conversation
Toot.Cat

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!