Now it is possible preprocess GoLang and it is possible to load a binary file and represent it as a byte array through just only line command (see example)
var imageArray = []uint8{/*$binfile("./image.png","uint8[]")$*/}
var imageArray = []uint8{/*$binfile("./image.png","uint8[]")$*/}
:-initialization(Goal).
gplc --min-size PrologFile.plTo decrease size of resulted file just use upx utlity
upx --all-methods exeFile
main :- Goal, Goal, Goal.Compile with string
swipl -O --foreign=save --toplevel=halt --goal=main --stand_alone=true -o exeFile -c PrologFile.plCheck usage of system libraries with
ldd exeFileIt will show something like
linux-vdso.so.1 => (0x00007ffcdc3f8000)libswipl.so.X.X is used by the executable file and must be bundled together with compiled file
libswipl.so.7.2 => /usr/lib/libswipl.so.7.2 (0x00007febe1ec8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007febe1cab000)