The Standard Cat Library

The cat manages the lolrust standard library. This is mostly a catalog of which Rust stdlib items the cat renamed and which the cat left alone. The cat is meticulous about this.

If a name does not appear in the renamed set below, it is passthrough ~ you write the Rust name in your .meow file, and the transpiler hands it to rustc unchanged.

The Renamed Set

These are the only stdlib types and variants the cat has cat-renamed.

Types

LolRustRustModule
YarnStringstd::string::String
Pile<T>Vec<T>std::vec::Vec
Cardboard<T>Box<T>std::boxed::Box
MaybeCheezburgr<T>Option<T>std::option::Option
Tryz<T, E>Result<T, E>std::result::Result

Variants

LolRustRustBelongs to
Has(value)Some(value)MaybeCheezburgr
EmptyBowlNoneMaybeCheezburgr
Purrfect(value)Ok(value)Tryz
Hairball(error)Err(error)Tryz

Macros

LolRustRust
meow!println!
hisss!eprintln!
ohno!panic!

That is the whole renamed set. Five types, four variants, three macros.

The Passthrough Set

Everything else in the Rust standard library is reachable in lolrust by its Rust name. If you would write std::fs::File in Rust, you write std::fs::File in lolrust. The transpiler passes the path through.

Some pieces you will use frequently:

Collections (std::collections)

I/O (std::io)

File System (std::fs)

Time (std::time)

Threading and Concurrency (std::thread, std::sync)

The reference-counted pointers were not renamed despite being conceptually similar to Cardboard<T>. The cat felt that PurrCard<T> (proposed during a 2020 RFC) was too cute, and that BigCardboard<T> (also proposed) implied Cardboard<T> was small. The names remain.

Networking (std::net)

Environment and Process (std::env, std::process)

Error Handling (std::error)

Iteration (std::iter)

The cat could have renamed iterators (PadPad was proposed for iter), but iteration is too common in lolrust code. Renaming would have produced unreadable lesson programs. The cat exercised restraint.

Names The Cat Considered And Rejected

For posterity, the names the cat has formally rejected:

Why So Few Renames

The cat’s renaming philosophy: rename a stdlib item only if the cat-name is at least as memorable as the Rust name AND the cat can explain why. Yarn for String works because cats love yarn. Pile for Vec works because a pile is what you call several things stacked. MaybeCheezburgr for Option works because of the meme.

Most stdlib items do not pass that bar. The cat is restrained.

Crate Ecosystem

For anything not in std, the entire Rust crate ecosystem is available because lolrust transpiles to Rust before rustc ever sees the code. gimme rand; becomes use rand; and pulls in the rand crate as you would expect.

For dependency management, see Cargo Wat?. The kibble package manager does not yet support pulling crates directly; for non-trivial dependency work, drop down to cargo.