Suppose you were writing a GUI tool for Julia, in Julia. For instance if you were making an IDE or notebook-type interface with a Qt or Vulkan-based GUI. In order to execute Julia code that the user wants you to run within it, you wouldn’t want to execute it within the context of the Julia instance that was actually running the UI tool, for reasons of crash prevention, namespace clashes, and interactivity. How easy would it to be to embed a Julia instance within the tool, in the same way you would if your tool was written in c++? Sure, you could use a socket-type interface to a sub-interpreter like web-based UIs do, or you could use Julia’s distributed processing capabilities but you lose the performance and direct access benefits that you get from talking to Julia through shared address space like you can in c++, and the ability to directly query the interpreter with synchronous function calls.
One possibility might be to write c++ code that exports the julia jl_ functions from C back to Julia, but that seems convoluted, and would seem to obscure some of the advantages you should have because of the program invoking the interpreter being written in the same language as the code being passed to the sub-interpreter.
Are there any examples of doing this kind of thing?