Julia is fully compiled in the sense all can be compiled. But sometimes it happens at runtime, yes (never strictly needed; for most code)
You can in some cases remove the LLVM dependency (back-end of the compiler), to very much reduce the compiled app size. It’s a very large dependency, the largest if I recall. You can remove more, maybe OpenBLAS, at least it should be possible if not right now.
But what then if you try to compile at runtime? Then your code will fail at runtime… not good, so you must be pretty sure that does not happen.
Since Julia also has an interpreter, then in that case such code could be run with --compile=min at least in theory. And since it’s much slower (even slower than Python, then make sure it’s not done for speed-critical code. 90% of code isn’t.
What you can do and I believe is not the default is use these (from doced with–help-hidden …):
--strip-metadata Remove docstrings and source location info from system image
--strip-ir Remove IR (intermediate representation) of compiled functions
This shouldn’t matter if your code is precompiled (but would if not fully compiled?), then the latter likely adds some fixed one-time latency per functions that aren’t fully compiled.
Both should make your app smaller, and faster. If you don’t have source code, I think you don’t (the point of compiling), nor the IR, then it seems you can’t compile further at runtime, e.g. for types you didn’t think of.
Some of Julia’s compiler is written in Julia, i.e. the frontend (and part of the optimzer?), and you should be able to drop it. Julia has a new parser, JuliaSyntax.jl and it’s bundled with. I’m not sure it’s dropped by default, maybe it should be. In theory you can include files at runtime. I think all code should be pre-parsed even if not precompiled, so should be safe, except in extreme cases (so likely not done). The legacy parser flisp is still there. I think it could be dropped, but likely not done… The focus should be on the largest dependencies first, though it might be a low-hanging fruit.