9.4 Standalone Rhombus Programs
Racket tools generally work on Rhombus programs, and that includes tools for creating and distributing standalone executables.
To generate a standalone executable prog from prog.rhm, use raco exe:
raco exe prog.rhm
That’s only the first step to creating an executable that can run on other machines, however. The resulting prog works on the machine used to build it, but it still relies on a Racket and Rhombus installation. To create a distribution that can be installed on another machine, use raco dist:
raco dist prog_dist prog
which assembles all needed files in "prog_dist".
By default, a standalone executable and distribution simply packages up all of the support needed to run a program the same as when running rhombus or racket directly. If a program does not use dynamic compilation facilities such as eval, then demodularizing and removing unneeded code can produce a smaller implementation that starts up more quickly. The raco demod tool performs that kind of pruning:
raco demod -g --work /tmp/work -o prog_small.zo prog.rhm
The output "prog_small.zo" can then be converted to an executable and/or distribution.
For cross compilation, see raco cross.