Guide for embedding Julia with packages?

I am aware of this 2017 question: Embedding Julia and Packages.
However, it doesn’t really have an answer.

I am looking for a way to embed Julia into a C/C++ program, and the Julia script may use a variety of packages. What is the canonical way to manage dependency/load packages/distribute program etc.?

You handle dependencies in the same way as a normal Julia program. Activate an environment with a Project.toml and Manifest.toml and do the import and using you need.

I doubt there is a canonical way for distribution and it would depend on what constraints you have. E.g. do you need to obfuscate your code, can you tolerate JIT latencies, is it ok to download packages from the internet, can you assume the user to have Julia installed, etc.?

1 Like