34 releases (22 breaking)

0.23.0 Apr 27, 2023
0.21.0 Apr 17, 2023
0.20.3 Mar 13, 2023
0.20.0 Nov 7, 2022
0.7.1 Jul 14, 2021

#14 in #repl

Download history 146/week @ 2023-02-03 125/week @ 2023-02-10 176/week @ 2023-02-17 870/week @ 2023-02-24 224/week @ 2023-03-03 246/week @ 2023-03-10 163/week @ 2023-03-17 91/week @ 2023-03-24 127/week @ 2023-03-31 84/week @ 2023-04-07 279/week @ 2023-04-14 186/week @ 2023-04-21 196/week @ 2023-04-28 152/week @ 2023-05-05 66/week @ 2023-05-12 76/week @ 2023-05-19

543 downloads per month
Used in irust

MIT license

78KB
1K SLoC

Rust 1K SLoC // 0.0% comments Python 144 SLoC // 0.0% comments

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 basic jupyer kernel is provided for demo 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:

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

~205–430KB