In the "and Rust can be used for X" department:
Add new builtins to Bash using a shared library (or .bundle on macOS) written in Rust. Bash also allows running bash other commands from native code. (There's a rust crate for creating bash builtins, but it doesn't currently compile on mac due to some improper and some missing linker flags.)