This demo corresponds to a WTC23 talk which discussed ways in which to call external libraries using 2 approaches: the Foreign Function Interface and the Wolfram Compiler.
To use the FFI section of this demo, simply do:
Load the paclet directory:
PacletDirectoryLoad["~/path/to/ICULink"];
Do a Needs
of the paclet:
Needs["ICULink`"]
Call a function defined in ICULink`FFI
:
In[]:= ICULink`FFI`UnicodeVersion[]
Out[]= {11, 0, 0, 0}
Run the script:
./scripts/build.wls
The generated library should be stored in (depending on your OS):
$ ls ICULink/LibraryResources/MacOSX-ARM64/
ICULink.dylib*
Load the paclet directory:
PacletDirectoryLoad["~/path/to/ICULink"];
Do a Needs
of the paclet:
Needs["ICULink`"]
Call any of the functions defined in ICULink`CC
and the compiled component should be autoloaded:
In[]:= ICULink`CC`UnicodeVersion[]
Out[]= {11, 0, 0, 0}