3 ms·
So many languages allow doing this. Lua and Tcl are famous for this, but many other languages/runtimes also can do this, Python, Ruby, Javascript, C#, Java. The
by dottrap 13y ago
So many languages allow doing this. Lua and Tcl are famous for this, but many other languages/runtimes also can do this, Python, Ruby, Javascript, C#, Java. They have a formal C API you can call through and define some memory management policy you need to conform to to interact with the garbage collector. This is pretty common stuff, albeit that some languages are much harder to embed than others.
As I said, spawning processes and IPC isn't an option on all platforms.
Are you sure Go doesn't have this ability?
- icebraining 13y agoYou can call Go from C, but the process main entry point must still be Go's, since that's the only way to launch its runtime. So technically you could embed it, but then you wouldn't be able to do any allocations or running goroutines.