I put together a repository on how to compile binaries and shared libraries from your user code - with lots of help from Jameson.
The instructions are in the README, and are hopefully straightforward. The juliac.jl script is also simple and easy to inspect and modify.
The hello.jl in this repo gets compiled into a hello binary, and can be executed like any other OS binary. I have tested all of this largely only on Linux at the moment, although with little tweaks it should work elsewhere.
My goal is to announce it here, get some feedback, and eventually get a juliac script included in the default julia distribution as the way to compile julia programs for various purposes. Also, I would love to have the documentation in the manual, and some form of CI (although build times are fairly large).
While the pieces have always been there, I feel that a complete example has been missing. Hope this helps.