Calling C/Fortran program that embeds Julia in Julia

We have a Julia framework that needs to interact with a lot of legacy Fortran/C(++) applications. Instead of manually preparing the proper interface for the applications which involves lots of manual type conversions, we are wondering if it was possible to instead add Julia get/set functions for primitives that can be called from the legacy apps.
The idea is the following:

  • Storage.jl → Shared Julia library created by PackageCompiler. Stores data to be exchanged
  • LegacyApp.f90/c/cpp → Embeds Storage.jl as a shared library and uses get/set Julia functions to retrieve and deposit data in module variables/structures
  • Orchestrator.jl → Deposits data in Storage.jl and calls LegacyApp.f90/.c/.cpp with ccall

I found Is it possible for "ccall" to call the shared library created by PackageCompiler.jl? - #52 by lionisxn which makes me pessimistic that this is possible, since it does not seem possible to interact with shared Julia libraries in Julia.
At this point I am just looking for confirmation. I was able to embed Storage.jl just fine in C but as soon as I tried to do the same with ccall in Julia things started to go poorly.

Much easier to just pass C function pointers from Julia to the legacy code, which allows it to call back to Julia — see many discussions of passing callback functions (via @cfunction). Not only does this avoid PackageCompiler, it also ensures that you are using a single consistent libjulia runtime.

Thanks for your reply.
I was initially thinking function pointers would be a valid way of doing this, but I was hoping the library approach might work because that avoids having to pass them all the way through the legacy app wherever they might be needed. Especially when connecting with Fortran90 defining all the interfaces would become quite tedious.