Perhaps some of what you would like to accomplish here may be accomplished by StaticCompiler.jl and StaticTools.jl. This would allow a subset of Julia to be compiled into a static function that does not need the Julia runtime and thus does not need initialization or shutdown.
3 Likes