1 unstable release

0.1.1 Aug 28, 2020
0.1.0 Aug 28, 2020

#198 in FFI

MIT license

100KB
1.5K SLoC

Rust 855 SLoC // 0.0% comments Wolfram 402 SLoC Objective-C 174 SLoC Batch 40 SLoC C 29 SLoC Shell 26 SLoC // 0.2% comments PowerShell 12 SLoC Java 10 SLoC

wll-rs

crates.io doc.rs CI

Wolfram LibraryLink interface for Rust

Inspired by wll-interface.

Purpose:

// lib.rs
use wll::{Error, 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(|| Error::from(ErrorKind::NumericalError))
}

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

lib.rs:

Wolfram LibraryLink interface for Rust.

Examples

Examples can found in the examples directory of the source code, or on GitHub.

Dependencies

~0–2MB
~40K SLoC