evcxr (Rust REPL) is an incredible tool!
I haven’t seen evcxr come up in discussion too much, I think it isn’t super well known. I just started using it today and it is awesome, immediately upgraded itself to a MVT (most valuable tool) in my book. Here’s an intro:
What is it?
A terminal read-evaluate-print loop for Rust. This is like what Python or Julia have where you enter a console and can run the language line by line. That means that you can do:
$ evcxr
>> println!(“Hello!”);
Hello!
When is it useful?
I’ve been using it for quickly trying out small parts of crates that aren’t on the playground, where it doesn’t really make sense to start a new cargo project. Adding dependencies is easy:
>> :dep num_cpus
Compiling num_cpus v1.16.0
>> num_cpus::get()
12
It works with local crates and specific features too.
How do you get it
$ cargo install —locked evcxr_repl
$ evcxr
Works with binstall too of course if you have it (another great tool)
$ cargo binstall evcxr_repl
—-
That’s it. I’m not associated with the project at all, just started using it and couldn’t believe I didn’t have it in my toolkit already. It isn’t super fast but it works just fine for experimentation.
Worth a try!