This currently shows a couple methods of interfacing Rust code with Python and Java.
The example code integrates a Levenshtein Distance routine from the following libraries
Slides, https://docs.google.com/presentation/d/18vT1ebpMWq2yKIAEAslnCM6Ln3VFG1XTwMG2IIMBFog/view
# deactive any current envs
deactivate
python3 -m venv lev.env
. lev.env/bin/activate
pip install -U pip
pip install -r requirements.txt
cd lev10
rustup override set nightly
cargo test
maturin build --interpreter `which python3`
cd jna-lev3
cargo build
mvn compile
ln -s target/debug/liblev3.dylib .
mvn exec:java -Dexec.mainClass="rustjna.Levenshtein"
output
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------------< rustjna:test >----------------------------
[INFO] Building levenshtein 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ test ---
levenshtein('boo','bar') = 2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.136 s
[INFO] Finished at: 2020-03-02T17:18:59-08:00
[INFO] ------------------------------------------------------------------------