#wolfram #bindings #librarylink #mathematica

sys wll-sys

A low-level bindings for Wolfram LibraryLink

1 unstable release

0.1.0 Aug 28, 2020

#5 in #mathematica


Used in wll

MIT license

70KB
751 lines

wll-rs

crates.io doc.rs CI

Wolfram LibraryLink interface for Rust

Inspired by wll-interface.

Purpose:

// lib.rs
use wll::{ErrorKind, Result};

#[wll::setup]
fn setup() {}

#[wll::teardown]
fn teardown() {}

// export function named `wll_add_two`
#[wll::export]
fn add_two(a: isize, b: isize)->Result<isize> {
    a.checked_add(b)
     .ok_or_else(|| ErrorKind::NumericalError.into())
}

#[wll::export(factorial)]
fn fac(n: usize) -> Result<usize> {
    Ok(if n == 0 { 1 } else { n * fac(n - 1)? })
}

lib.rs:

wll-sys is a low-level bindings for Wolfram LibraryLink. Typically doesn’t need to be used directly.

It is automatically generated by bindgen.

see also: Wolfram LibraryLink User Guide, LibraryLink Reference.

No runtime deps

~0–1.7MB
~34K SLoC