43 releases (23 breaking)

new 0.24.9 Nov 5, 2024
0.24.7 Sep 27, 2024
0.24.6 May 5, 2024
0.24.5 Mar 24, 2024
0.7.1 Jul 14, 2021

#235 in Operating systems

Download history 14/week @ 2024-07-18 19/week @ 2024-07-25 18/week @ 2024-08-01 19/week @ 2024-08-08 14/week @ 2024-08-15 18/week @ 2024-08-22 32/week @ 2024-08-29 15/week @ 2024-09-05 19/week @ 2024-09-12 42/week @ 2024-09-19 235/week @ 2024-09-26 93/week @ 2024-10-03 69/week @ 2024-10-10 50/week @ 2024-10-17 41/week @ 2024-10-24 260/week @ 2024-10-31

428 downloads per month
Used in irust

MIT license

115KB
1.5K SLoC

Rust 1K SLoC // 0.0% comments Python 178 SLoC // 0.0% comments Jupyter Notebooks 31 SLoC

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–10MB
~51K SLoC