The .a's are ELF files. However, the calling conventions are very
different so one cannot simply link with C code and have things work.
> Can I load go functions from my C or python program using dlopen and
> dlsym and call them? What about passing strings and maps across
> language boundaries?
No, for the above reasons.
> The reason people use C and C++ for writing libraries on linux is
> because every language can load functions from an ELF so can call
> those functions.
Go can call into C code using the FFI. See misc/cgo/gmp/gmp.go in the
source distribution.
> What about interactions with Go's GC?
When calling C functions you should keep hold of any objects that the
C functions may use in order to stop the GC from collecting them.
> Am I going to have to write stub code? This seems like it would be
> painful because languages like Java already require JNI stubs in C,
> which would then have to dlsym, dlload my go stub... which would call
> the actual function.
You should see the GMP example.
AGL