Why can we not easily compile to standalone binary?

So I am new to Julia and in recent time I was learning abit about Interpreters and Compilers, still dont understand much beyond Lexer and Tokenizer so go easy on me here. I was wondering if Julia does rely on the LLVM Compiler Infrastructure, why does it seem to be so difficult to “just” compile to a binary, as like Rust does which also works on LLVM. I know such things as PackageCompiler.jl exists but this only creates “massive” binaries bundling all of the julia dependencies in and you can not just take the exe file and drop it somewhere else.
I would be realy interested what the problem here is such that I might be able to possibly contribute in the future (once I understand more about Compilers).
Thanks for any answers I appreciate your time.

There’s a number of threads on this, but I quite like this one - and I’m shamelessly linking to my own answer for why that’s a bit difficult :slight_smile:

3 Likes

so alot of problems lie in cross compilation do I understand your post right there?

Essentially, yes - the way Julia works conceptually makes general static compilation pretty hard in the first place, and (good) cross compilation just adds more difficulties on top. It’s a very large amount of work.

As far as compilers go, Julia is quite unusual.

1 Like