- May create a
notebooks/
folder in the future, top level pyproject is set up to run local Jupyter. - All Python/Rust file-based solutions will be in specific folders
day##
. Each folder is a hybrid Rust/Python repo, effectively withcargo init
andpoetry init
.main.py
andmain.rs
will both be in thesrc/
folder.
In order to run the Notebooks with Rust Kernels locally, you'll need to set up the Rust toolchain and evcxr.
- Install Rust with rustup: https://www.rust-lang.org/tools/install
- Install
evcxr_jupyter
: https://github.com/google/evcxr/tree/main/evcxr_jupytercargo install evcxr_jupyter
evcxr_jupyter --install
Once that's one, you should have a Rust kernel available. You can check with jupyter kernelspec list
❯ poetry run jupyter kernelspec list
Available kernels:
python3 /home/kafonek/advent2022/.venv/share/jupyter/kernels/python3
rust /home/kafonek/.local/share/jupyter/kernels/rust
- Cd into directory (
cd day01
) - Compile packages
poetry run python -m compileall src/
cargo build --release
- Time and run
time poetry run python src/main.py
time cargo run --release