#language #script #scripting #api-bindings

nightly bin+lib julia

Idiomatic and safe Julia bindings for Rust

11 releases

Uses old Rust 2015

0.2.5 Nov 16, 2017
0.2.4 Nov 15, 2017
0.1.4 Nov 14, 2017

#167 in #scripting

Download history 3/week @ 2024-02-22 1/week @ 2024-02-29 3/week @ 2024-03-07 2/week @ 2024-03-14 41/week @ 2024-03-28 24/week @ 2024-04-04

65 downloads per month

Zlib license

170KB
3.5K SLoC

julia-rs

crates.io Docs

Safe and idiomatic Julia bindings for Rust

[dependencies]
julia = "0.2"
...

CONTRIBUTING.md

REPL

As an example application, an interactive Julia REPL written in 100% safe Rust is included. See its source at src/main.rs, build with cargo build and run with cargo run. See julia-rs -h or cargo run -- -h for help.

Example

See examples for more examples.

fn main() {
    use julia::api::{Julia, Value};

    let mut jl = Julia::new().unwrap();
    jl.eval_string("println(\"Hello, Julia!\")").unwrap();
    // Hello, Julia!

    let sqrt = jl.base().function("sqrt").unwrap();

    let boxed_x = Value::from(1337.0);
    let boxed_sqrt_x = sqrt.call1(&boxed_x).unwrap();

    let sqrt_x = f64::try_from(boxed_sqrt_x).unwrap();
    println!("{}", sqrt_x);
    // 36.565010597564445
}

TODO

pre 0.3

  • Safe wrappers for all remaining important functions.
    See ROADMAP.md for details.

pre 0.4

  • Fix any and all memory leaks and overflows at the ffi boundary.

pre 0.5

  • Standardize.
  • Test.
  • Add more thorough examples.

pre 0.6

  • Standardize documentation.
  • Document everything thouroughly.

License

julia-rs is licensed under the zlib/libpng license. See LICENSE or zlib.net/zlib_license.html for details.

Dependencies

~0.9–10MB
~93K SLoC