[Awesome Rust] Use evcxr_repl to run Interactive Rust
evcxr_repl
evcxr_repl
is A Rust REPL (Read-Eval-Print loop) built to provide evaluation context for Interactive programming.
Interactive programming, in which expressions are entered and evaluated in real-time, can be a powerful tool for exploring a language and problem solving. This capability is most often associated with dynamically evaluated languages such as JavaScript and Python. Compiled languages such as Java and C++ can also be used interactively, but tooling tends to lag by many years. Rust is a newer compiled language for which interactive programming has recently emerged. This article discusses interactive programming with Rust courtesy of the google/evcxr - https://github.com/google/evcxr crate.
Prerequites
Cargo is the Rust package manager. Cargo downloads your Rust package’s dependencies, compiles your packages, makes distributable packages, and uploads them to crates.io - https://crates.io/, the Rust community’s package registry.
- Install Rust and Cargo
The easiest way to get Cargo is to install the current stable release of Rust by using rustup. Installing Rust using rustup will also install cargo.
On Linux and macOS systems, this is done as follows:
1 | curl https://sh.rustup.rs -sSf | sh |
It will download a script, and start the installation. If everything goes well, you’ll see this appear:
1 | Rust is installed now. Great! |
Installation
Installed with the following command:
1 | cargo install evcxr_repl |
Usages
And start the REPL:
1 | evcxr |
See Usages - Google Search - https://github.com/google/evcxr/blob/main/COMMON.md to learn more Usages.
References
[2] Usages - Google Search - https://github.com/google/evcxr/blob/main/COMMON.md
[3] google/evcxr - https://github.com/google/evcxr
[5] evcxr - crates.io: Rust Package Registry - https://crates.io/crates/evcxr
[6] Introduction - The Cargo Book - https://doc.rust-lang.org/cargo/index.html