On 2026-04-03 13:01:11, 'Martin R' via sage-devel wrote:
> In
https://github.com/sagemath/sage/pull/41901 I have finally succeeded to
> put together a sensible FriCAS interface. I admit that I am quite proud of
> it.
>
> To make it work, I need one extra file which contains "spad" code, i.e.,
> code in FrICAS native language, which should be compiled when the interface
> is first invoked. It is about 70 lines of code and takes a millisecond to
> compile.
There is an example in sage/graphs/generators/distance_regular.pyx
where we find and load
shortened_000_111_extended_binary_Golay_code_graph.pickle.xz
at runtime. The data file sits somewhere in the source tree and is
installed by meson using install_sources. Then at runtime you find it
using
from importlib.resources import as_file, files
with as_file(files('sage.foo.bar').joinpath("your-file")) as f:
do_stuff_with(f)
...
If you need to store the compiled result somewhere, $DOT_SAGE/fricas?
We do something similar with the GAP workspace in $DOT_SAGE/gap.