38 releases

0.17.0 Dec 17, 2023
0.16.0 Oct 22, 2023
0.15.1 Jul 13, 2023
0.14.2 Jan 2, 2023
0.2.0 Oct 8, 2018

#454 in Rust patterns

Download history 915/week @ 2023-12-22 1012/week @ 2023-12-29 1766/week @ 2024-01-05 1848/week @ 2024-01-12 1645/week @ 2024-01-19 1733/week @ 2024-01-26 1731/week @ 2024-02-02 1455/week @ 2024-02-09 1823/week @ 2024-02-16 1741/week @ 2024-02-23 1439/week @ 2024-03-01 1730/week @ 2024-03-08 1636/week @ 2024-03-15 1670/week @ 2024-03-22 1509/week @ 2024-03-29 1670/week @ 2024-04-05

6,726 downloads per month

MIT/Apache

315KB
7K SLoC

Evcxr Rust REPL

Latest Version Downloads License

A Rust REPL (Read-Eval-Print loop) built using the evcxr evaluation context.

Installation

Before you can use the REPL, you must download a local copy of Rust's source code:

$ rustup component add rust-src

Once that's done, you have a choice of using pre-built binaries, or building from source.

Pre-built binaries

Pre-built binaries are available from the Releases page. These are currently built for Linux, Mac and Windows. In each case they are built with the latest version of each operating system. In the case of Linux, they're built on the latest Ubuntu. If your version of libc is different, they might not work, in which case you'll need to build yourself. See below.

Building yourself

If you can't, or don't want to use the pre-built binaries, you can build from source.

Make sure you've got a recent version of rust installed. Evcxr's dependencies often make use of new Rust features shortly after they're stabilized, so it's not uncommon that the latest release of Evcxr will end up requiring the latest version of rustc.

Now you can go ahead and install the binary:

$ cargo install --locked evcxr_repl

Usage

And start the REPL:

$ evcxr  
Welcome to evcxr. For help, type :help
>> 

Completion Type

Evcxr supports two modes of tab completion:

  • List: When you press tab, it will complete any common prefix shared by all available completions. Pressing tab twice will then list all available completions. This mode is the default.
  • Circular: When you press tab, it will show the first completion. Pressing tab again will cycle through all the available completions, then return to the start. To select this mode, set the environment variable EVCXR_COMPLETION_TYPE=circular.

Usage information

Evcxr is both a REPL and a Jupyter kernel. See Evcxr common usage for usage information that is common to both.

Manual Installation

You can install the REPL manually with git:

$ cargo install --force --git https://github.com/evcxr/evcxr.git evcxr_repl

Similar projects

  • irust. Looks to have quite a sophisticated command line interface. All your code gets rerun each time. For many uses this is fine and has the advantage that you can have variables reference other variables.
  • cargo-eval Not interactive, but it gives you a quick way to evaluate Rust code from the command line and/or scripts.
  • rusti. Deprecated since 2019. Also, rusti requires a nightly compiler from 2016 and doesn't appear to persist variable values.
  • Papyrus. Looks like it's no longer maintained.

Dependencies

~33–48MB
~892K SLoC