Skip to content

WolframResearch/wolfram-rust-library

Repository files navigation

wolfram-rust-library

Rust crates for working with the Wolfram Language. This monorepo consolidates three previously separate repositories:

  • wolfram-expr — Efficient and ergonomic representation of Wolfram expressions in Rust.
  • wstp — Bindings to the Wolfram Symbolic Transfer Protocol (WSTP), used for passing arbitrary Wolfram expressions between programs.
  • wolfram-library-link — Bindings to Wolfram LibraryLink, making it possible to call Rust code from the Wolfram Language.

Plus their FFI sibling crates (wstp-sys, wolfram-library-link-sys) and the proc-macro crate wolfram-library-link-macros.

Layout

wolfram-expr/                    Pure-Rust Expr AST (no Wolfram install required to build)
wstp/                            Safe WSTP API
wstp-sys/                        Bindgen-generated WSTP FFI (requires Wolfram install to build)
wolfram-library-link/            Safe LibraryLink API + #[export] macros
wolfram-library-link-sys/        Bindgen-generated LibraryLink FFI (requires Wolfram install to build)
wolfram-library-link-macros/     #[export] / #[init] proc macros
xtask/                           Maintainer tool: `cargo xtask gen-wstp-bindings`, `cargo xtask gen-library-link-bindings`

default-members excludes the -sys crates so contributors without a local Wolfram installation can still cargo check and cargo test from the workspace root.

Building

wolfram-expr builds with no system dependencies. The other crates use wolfram-app-discovery to locate a local Wolfram installation; if it lives in a non-standard location, set the WOLFRAM_APP_DIRECTORY environment variable. See each crate's README for details.

License

Licensed under either of

at your option.

Note: licensing of the WSTP library linked by the wstp crate is covered by the MathLink License Agreement.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors