JuliaLang/julia — pull request #9438 by few (2014-12-22 08:00:55+00:00)
Title: Support building standalone executables

This work is inspired by the recent work on build_sysimg.jl and #9400. There's not that much innvoation here, but I thought it might be a useful starting point for others.

Summary:
contrib/build_executable.jl
Builds an executable that doesn't require any julia source code.
The user needs to provide a julia script that contains a function
main() taking no argument. The file may contain other needed julia
code, but must otherwise not rely on relative import, using or
include statements. It will be compiled into the sysimg.

Tested on linux. May work on other platforms.

Example:
$ cat hello_world.jl
function main()
println("Hello world!")
end

$ julia contrib/build_executable.jl standalone_test hello_world.jl
[...]

$ usr/bin/standalone_test
Hello world!