I've been learning Rust for a couple of months now. Before that, as many other people, I had a sense of strong curiosity for Rust. Now, I read most of the posts in this forum just for the sake of learning new things even when I'm not actually coding myself.
A problem I encountered as a new Rustacean is that a lot of people in this community uses a lot of what I call "Rust lingo" to talk about things that are not necessarily obvious to a person new to Rust. Things that you don't necessarily learn by reading the book, or doing some tutorials.
I decided I wanted to start documenting my journey into Rust, and one of the things I want to do is to create a Rust glossary, something that I (or anyone for that matter) can refer to when these things pop up.
These are basic but there seems to be a lot of confusion among beginners about what they actually are and do:
Borrow: taking temporary control of a memory-backed resource in limited fashion. Mutable borrow: a borrow that enforces uniqueness i.e. no other borrows can co-exist with a mutable borrow. Shared borrow: a borrow that allows the borrowed resource to be borrowed again by other shared borrows. Often, though not definitionally, enforces read-only access.
TT muncher: design pattern for macros. Such macros match argument by pattern followed by $($rest:tt)*, and pass $($rest)* to the macro itself to process the rest part recursively.
Cell: Wrapper types to make values mutable through immutable reference.
Standard library has std::cell::{Cell, RefCell, UnsafeCell} for such purpose, and there are many third-party cell types for various uses.
Uninhabited types: Types which can have no values (i.e. values of such types cannot exist at runtime). ! type (never type) and std::convert::Infallible are examples of such types.
Nonexhaustive: When a type is nonexhaustive, downstream users cannot list all possible values of the type.
In old days, types are made nonexhaustive by adding hidden fields or variants (such as #[doc(hidden)] __Nonexhaustive. #[non_exhaustive] attribute is stable since Rust 1.40.
Oddly enough most of the above has never bothered me in the few months I have been getting into Rust. Just more acronyms to get used to. Not even the various "borrows" which are clear enough.
But:
"Executor"
"Async"
"Await"
"Future"
Even if I have an inkling what they are I have no idea how to write the simplest "hello async" program.
All kind of different ways of talking about types, none of which I can remember of hand now.
Then there is talk of:
"varadict generics"
"associated type"
Even "trait" is an alien concept.
None of these things have existed in my programming world, which spans from Algol to Javascript.
Niche: If a type does not use all bit values then the compiler can use those illegal values for something else when optimising. For example a reference can never be null so an Option type can use that null value instead of needing a separate boolean.
Related to RIIR is the so-called Rust Evangelism Task Force.
I feel that is a derogatory term but for completeness and history we should keep it in; perhaps as a subset under RIIR.
For a helpful reflection on the culture around this term, see Jonathan Turner's Rust 2018 post.
This type is Copy, that type is Clone.
Having a trait for a type is spoken as being this trait. I would say: this type has the Copy trait. Or implements the Copy trait. But this is to long, so the Rust lingo is : this type "is" Copy.