Hi,
I am currently developing a JITable interpreter for a scripting language where users can define user-defined functions with the signature
func (...interface{}) interface{}
that can interoperate with the scripts. interface{} can be bool, int, string, []interface{} or another func(...interface{}) interface{} or one of many more.
Now I want to create a C/C++ library that offers additional functions with exactly this signature. My questions:
- interface{} is represented as a value (ptruint) and a type information pointer. Is there a way to somehow pass this information to C/C++?
- Does C/C++ (more specific: LLVM) have a calling convention that is ABI compatible to golang? (so I can use interface{} as a pair of parameters?)
- Is there any library code in golang that helps me to read out interface{}'s type information?