wll

Crates.iowll
lib.rswll
version0.1.1
sourcesrc
created_at2020-08-28 08:59:31.337728
updated_at2020-08-28 11:22:59.823552
descriptionA Wolfram LibraryLink interface.
homepage
repositoryhttps://github.com/miRoox/wll-rs/
max_upload_size
id281788
size37,887
Yong-an Lu (miRoox)

documentation

README

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)? })
}
Commit count: 162

cargo fmt