\startluacode
mylib = require("mylib")
-- additional code using the C functions
\stopluacode
```
* Run ConTeXt with the `--permitloadlib` flag.
However, the second step requires (at least on Linux) liblua.a to be compiled with the `-fPIC` flag. I could do that by adding
```
set_property(TARGET lua PROPERTY POSITION_INDEPENDENT_CODE ON)
```
at line 47 in lua.cmake. Is there any known negative effect of doing that (apart from a possible small performance drop)?
(Just to be clear, this is not a feature request; I'm just wondering whether doing it on my side is fine.)
On a related note, is there a standard way to call external C functions (either in a shared library or in a .c file) from ConTeXt LMTX? The SwigLib library described in
https://www.pragma-ade.nl/general/manuals/swiglib-mkiv.pdf looks very promising (and maybe could be a way to achieve what I'm trying to do in a much cleaner way), but I (maybe for lack of trying hard enough) have not been able to make it work with ConTeXt LMTX so far.
Best regards,
Florent