Part of the answer is to see that julia libraries are a lot like C++
template libraries distributed as header files. For example, if a
library implements a new numeric type, there's not much point in
distributing it in a way that prevents its code from being inlined
into user code.
An approach that handles this case is something like "p code", where
you parse each of the top-level expressions in your source file and
serialize them to binary format. Then you can write a wrapper that
loads them and calls "eval" on them. This hides the original source
text, but you can still look at the compiler's intermediate
representation.
At the other extreme, eventually you'll be able to statically compile
a whole program, and it can expose C-callable entry points. It will
look exactly like a library written in C, except that it might link
against the julia runtime. Then you will also be limited to the C ABI.
It would be kind of interesting to design something in between. That
would probably look like a shared library in a special format designed
to be loaded into the julia runtime. It would contain cached generated
native code (like sys.so), and some kind of type information in a
special data section.
Obviously I'm not excited about enabling proprietary code, but
ultimately I feel that's a decision for the code's author to make, not
for me to make.