All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.2.10 – 2023-08-28
-
Always use pre-generated LibraryLink bindings. (#57)
Previously, wolfram-library-link-sys would use bindgen to generate bindings at compile time. Now, the bindings are pre-generated and built-in to wolfram-library-link-sys, without any loss in functionality.
The build dependency on bindgen has been removed, simplifying the dependency tree and reducing compile times.
When wolfram-library-link occasionally updates to support a new minimum LibraryLink version, the bindings will need to be regenerated as described in docs/Maintenance.md.
-
Update wstp dependency to v0.2.8, which also replaces build-time use of bindgen with pre-generated bindings. (#59)
-
Developer: Replace custom RunTests.wls script with instructions on how to use the slightly more standardized
wolfram-cli paclet test
tool. (#58)
- Fixed build failure caused by assumption that
c_char
isi8
on every platform, which is not true.
0.2.9 – 2023-02-03
-
Add logging support to
wolfram-library-link-sys/build.rs
. (#54)wolfram-app-discovery v0.4.3 added support for logging via the Rust
log
logging facade library.wolfram-library-link-sys/build.rs
uses wolfram-app-discovery to findWolframLibrary.h
.Logging messages from
wolfram-library-link-sys/build.rs
can now be enabled by setting theRUST_LOG
environment to an appropriate value, as documented in theenv_logger
crate documentation. This can help debug discovery errors that occur during a build.
-
Reduce minimal configurable set of dependencies by adding new cargo features. (#53)
This release adds two new cargo features:
panic-failure-backtraces
automate-function-loading-boilerplate
which are enabled by default.
These features are used to control whether the following (now optional) dependencies are enabled:
backtrace
inventory
process_path
Making these dependnecies optional reduces the minimal possible set of overall dependencies in projects that use wolfram-library-link.
0.2.8 – 2023-02-01
- Update
wstp
andwolfram-app-discovery
dependencies so thatwolfram-app-discovery
v0.4.1 is being used everywhere, which has improved Linux support, and fixes several bugs. (#51)
0.2.7 – 2022-09-19
- Update
wolfram-app-discovery
dependency from v0.2.1 to v0.3.0, to take advantage of the improved flexibility of the new API functions tailored for use in build scripts. (#49)
0.2.6 – 2022-08-28
- Fixed
Failure["RustPanic", ..]
messages not being returned from#[export(wstp)]
functions when a panic occurs after partial results had begun being written to the WSTP link. (#46)
- Clarified documentation problem
described in comment on #44,
the documentation for
exported_library_functions_association()
was unclear about when and how to use thelibrary
parameter. (#47)
0.2.5 – 2022-06-11
0.2.4 – 2022-05-13
-
Added a new 'How To' page describing how to perform Wolfram evaluations from Rust library functions. (#38, #39)
0.2.3 – 2022-03-29
- Fixed docs.rs build failure in v0.2.2, caused by a
#[doc = include_str!(..)]
that fails on case-sensitive targets like the docs.rs Linux build host. (#34)
0.2.2 – 2022-03-28
-
Added a new
wolfram_library_link::docs
module, and an initial 'How To' documentation page describing how to convert between Rust types and Wolfram expressions. (#31)
0.2.1 – 2022-03-09
-
Added
exported_library_functions_association()
. (#26)This function returns an
Expr
containing an Association of the form<| name_?StringQ -> func_ |>
, with an entry for each library function exported using#[export(..)]
.Arguments that are applied to
func
will be used to call the compiled library function. -
Added
#[export(hidden)]
annotation.Exported functions with the
hidden
annotation will not be included in the Association returned byexported_library_functions_association()
.
exported_library_functions_association()
and #[export(hidden)]
are alternatives to
the generate_loader![]
macro. The generate_loader![]
macro is convenient, but I think
it hides too many details about how it works. It's too much magic.
Together, these two new features can be used by the library author to define a loader function for their own library, which would typically look like:
use wolfram_library_link::{self as wll, export, expr::Expr};
#[export(wstp, hidden)]
fn load_my_lib_funcs(_args: Vec<Expr>) -> Expr {
return wll::exported_library_functions_association(None);
}
#[export]
fn square(x: i64) -> i64 {
x * x
}
and which could be used from the Wolfram Language by evaluating:
loadLibraryFunctions = LibraryFunctionLoad[
"<library path>",
"load_my_lib_funcs",
LinkObject,
LinkObject
];
$functions = loadLibraryFunctions[];
Then, any function exported from the library could be called by accessing the named values
in $functions
:
(* Call the `square()` function exported by this library. *)
$functions["square"][5]
0.2.0 – 2022-03-07
-
Added new
#[export(..)]
attribute macro. (#23)Export a native function:
use wolfram_library_link::export; #[export] fn square(x: i64) -> i64 { x * x }
Export a WSTP function:
use wolfram_library_link::{export, wstp::Link}; #[export(wstp)] fn total(link: &mut Link) { let arg_count = link.test_head("List").unwrap(); let mut total = 0; for _ in 0..arg_count { total += link.get_i64().unwrap(); } link.put_i64(total).unwrap(); }
-
Changed
wolfram-library-link-sys
to generate the Rust bindings toWolframLibrary.h
at compile time. (#24)This ensures that the
wolfram-library-link
andwolfram-library-link-sys
crates can compile against the widest possible range of suppported Wolfram Language versions.
- Removed the
export![]
andexport_wstp![]
declarative macros. These have been replaced by#[export(..)]
. (#23)
0.1.2 – 2022-02-08
- Fix
wolfram-library-link-sys/build.rs
failure when building in the <docs.rs> build environment, where no Wolfram applications are available to query. (#17)
0.1.1 – 2022-02-08
- Update
wstp
dependency to fix <docs.rs> build failures caused by earlier versions ofwstp-sys
. (#16) - Fix missing
"full"
feature needed by thesyn
dependency ofwolfram-library-link-macros
. (#16)
0.1.0 – 2022-02-08
Initial release. wolfram-library-link-sys
was the only crate published in this release,
due to a docs.rs build failure
caused by bugs present in early versions of wolfram-app-discovery
and wstp-sys
.