wolfram-export 0.6.0-alpha.4

Unified #[export] runtime for Wolfram LibraryLink: native MArgument, WSTP Link, and typed WXF ByteArray modes — pick the modes you need via feature flags.
Documentation

wolfram-export

Unified #[export] runtime for Wolfram LibraryLink functions. Choose the calling convention you need via Cargo features.

Calling conventions (features)

Feature Attribute Transport
native (default) #[export] / #[export_native] Raw MArgument C ABI
wstp #[export(wstp)] / #[export_wstp] WSTP Link
wxf #[export(wxf)] / #[export_wxf] Typed WXF ByteArray
[dependencies]
wolfram-export = { version = "0.6", features = ["wstp"] }
use wolfram_export::export;

#[export]
fn add(a: i64, b: i64) -> i64 {
    a + b
}

#[export(wstp)]
fn echo(args: Vec<wolfram_expr::Expr>) -> wolfram_expr::Expr {
    args.into_iter().next().unwrap_or(wolfram_expr::Expr::from(0))
}

The automate-function-loading-boilerplate feature (on by default) emits the __wolfram_manifest__ C-ABI symbol that lets the paclet loader discover all exported functions automatically.

Changelog

See docs/CHANGELOG.md.