Expand description
Procedural macros for #[export] and #[init].
Emitted paths are resolved dynamically at expansion time via
proc-macro-crate: if the caller’s Cargo.toml has wolfram-export the
macro emits ::wolfram_export::*; if it has wolfram-library-link (legacy)
it emits ::wolfram_library_link::*. Both crates expose the same hidden
runtime surface so generated code resolves correctly in both cases.
Attribute Macros§
- export
- Export a function as a Wolfram LibraryLink function, in one of four wire
formats picked by a keyword argument. All four need
LibraryFunctionLoadon the Wolfram side and none of them need theautomate-function-loading-boilerplatefeature to work — that feature only affects whethercargo wl buildcan discover the load call for you (#[export(margs)]needs anargs =/ret =annotation for that discovered call to be correct — see below). - init
- Designate an initialization function to run once, when this library is
loaded via Wolfram LibraryLink — distinct from [
export], which wraps a function called on every invocation from Wolfram.