I've been programming in Rust for a few years now. I quite like the language, its tooling, and its library ecosystem. There's a few libraries ("crates") I especially like and use often. A short thread.

See https://blessed.rs/ for a list of "recommended crates" for a less personal list.

#Rust #RustLang

Crate List - Blessed.rs

clap is the command line argument parsing library. I especially like it because it lets me declare a struct, with strong Rust typing, to define what the command line should work like. I also like that meshes well with the tradition of Unix command line interfaces.

I've implemented command line parsing in C, shell, Python, and more. For a while the Python standard library had my implementation of getopt_long. clap is the only library for this that I actually enjoy using.

#Rust #RustLang

serde and the small ecosystem around it make it painless to serialize and deserialize structured data. I define a Rust type, annotate it with serde, and use serde-foo library to read and write files in format foo. I mostly use serde-json (for JSON) and serde-norway (for YAML) as those are the formats I mostly need.

#Rust #RustLang

thiserror lets me define error types. Rust has a powerful system for handling errors, which lets me write error messages that are useful to those using my software. This benefits from making many error types, from the very specific to the broad and general.

I'm tired of Unix programs saying "No such file or directory" without saying which file or directory doesn't exist. I want the programs I write to always be more helpful than that.

#Rust #RustLang

tempfile handles temporary files well. I need this surprisingly often, and tempfile has never left me wanting. It just works. No notes.

#Rust #RustLang

walkdir lets me scan directories for files. For some reason this is also something I often need to do. I spent a couple of years thinking I should write my own, to be a little more flexible and much faster. Then I benchmarked walkdir and it's damn fast. I haven't found a faster way to do what it does, yet.

#Rust #RustLang

(end)

@liw I just use “ignore”, which uses walkdir, but has support for gitignore style globbing, which I tend to eventually need anyway. When also using the parallel walker, it’s easy to build tools that finds the correct set of files from big hierarchy and process them very efficiently on all cores, it’s such a delight.