Thanks to visit codestin.com
Credit goes to lib.rs

48 releases (24 breaking)

Uses new Rust 2024

0.25.1 Aug 18, 2025
0.24.12 Aug 10, 2025
0.24.11 Mar 11, 2025
0.24.10 Dec 22, 2024
0.7.1 Jul 14, 2021

#631 in Command-line interface


Used in irust

MIT license

120KB
1.5K SLoC

Codestin Search App Codestin Search App Codestin Search App

IRust Repl

Repl engine used by IRust to interpret rust code

The core is println!("{:?}", expression) with tricks to conserve variables and context

Example:

use irust_repl::{Repl, ToolChain};

let mut repl = Repl::new(ToolChain::Stable).unwrap();
repl.insert("let a = 5");
assert_eq!(repl.eval("a+a").unwrap().output, "10");

Checkout the examples and tests folders for more info.

Jupyter Kernel

A Jupyter Kernel is provided https://github.com/sigmaSd/IRust/tree/master/crates/irust_repl/irust_kernel, to use it:

Installation

This requires IPython 3.

pip install irust_kernel
python -m irust_kernel.install

To use it, run one of:

code # vscode have the best implementation
zed # zed implementation is nice as well
jupyter notebook
# In the notebook interface, select IRust from the 'New' menu
jupyter qtconsole --kernel irust
jupyter console --kernel irust

Developement

This requires https://github.com/pypa/flit

To start developping locally use flint install --symlink optionally followed by python -m irust_kernel.install --local-build if there are changes to Re executable

Examples

irust.ipynb (simple showcase) and evcxr.ipynb (showcase of evcxr protocol) are provided as an example

Dependencies

~0.2–2.2MB
~41K SLoC