Crates.io | irust_repl |
lib.rs | irust_repl |
version | |
source | src |
created_at | 2021-05-04 10:42:58.648773 |
updated_at | 2024-11-05 06:55:58.717103 |
description | IRust Repl abstraction |
homepage | |
repository | https://github.com/sigmaSd/IRust/tree/master/crates/irust_repl |
max_upload_size | |
id | 392945 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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.
A Jupyter Kernel is provided https://github.com/sigmaSd/IRust/tree/master/crates/irust_repl/irust_kernel, to use it:
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
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
irust.ipynb (simple showcase) and evcxr.ipynb (showcase of evcxr protocol) are provided as an example