Skip to content

JuliaLibWrapping-v0.3.0

Choose a tag to compare

@github-actions github-actions released this 02 Nov 12:53
· 5 commits to main since this release
96a5b54

JuliaLibWrapping JuliaLibWrapping-v0.3.0

Diff since JuliaLibWrapping-v0.2.0

Breaking changes

  • The Python target splits the package's public module in two. Generated
    wrappers are written to _generated.py on every build. _facade.py is now
    a hand-editable starter, written only when it does not already exist; it
    star-imports _generated and copies its __all__. __init__.py re-exports
    from _facade, including from ._facade import __all__, so a hand-written
    _facade.py must define __all__. Building into an output directory that
    already holds a _facade.py generated by v0.2 keeps that file, which then
    hides newly generated functions: delete it once to get the starter.
  • JuliaC v0.3.10 or later is required (the compat bound was 0.3.9).
  • C symbols of @api entry points are now valid C identifiers (this comes
    from JLWInterop v0.3): characters C does not allow become _, so
    @api scale!(...) exports Mod_scale rather than Mod_scale!. Two names
    that become the same symbol are rejected. Bindings that look up the old
    symbols must be regenerated.

New features

  • MATLAB target. MatlabTarget, or standard_build(...; matlab_package),
    emits one .m façade per @api declaration in a +package directory, a C
    MEX gateway that converts mxArrays to and from the carriers, and a
    build_mex.m script. Generating the files needs no MATLAB installation;
    compiling the gateway does.
  • Tuple returns. An @api declaration may return a Tuple of two or more
    supported types. Python receives a tuple, MATLAB receives multiple
    outputs ([x, n] = f(a)), and C receives a struct. Each element keeps its
    own ownership, and owning elements are released after conversion.
    Requires JLWInterop v0.3.
  • PythonTarget(...; coerce_arrays = true) (also a standard_build keyword)
    makes the generated wrappers convert array arguments to the carrier's dtype
    and memory layout (np.asfortranarray for rank two and higher,
    np.ascontiguousarray for vectors). The default, false, keeps rejecting
    mismatched arrays.
  • @api accepts a mutates = (a, ...) clause naming the array arguments the
    function writes to (from JLWInterop v0.3). The MATLAB target copies those
    arguments before the call.

Merged pull requests:

Closed issues:

  • Proposed discourse announcement (#88)