Deployment and Distribution: Shipping Racket Apps | Schema Programming Part 23
You've built an amazing Racket app. How do you give it to a friend who doesn't have Racket installed? You create a Standalone Executable.
Advertisement
Creating an Executable
The raco exe command compiles your source into a native binary.
raco exe my-app.rkt
This creates my-app.exe (on Windows) or my-app (on Mac/Linux). However, this executable still depends on Racket libraries being present.
Creating a Distribution
To make it truly standalone, you need to bundle the runtime and libraries.
raco distribute my-dist my-app.exe
This creates a folder my-dist/ containing:
bin/my-app.exelib/(all necessary DLLs and collection code)
You can zip this folder and send it to anyone!
Cross-Compilation?
Racket generally does not support cross-compilation (creating a Windows .exe from a Mac). You typically need to run raco distribute on the OS you are targeting (e.g., using GitHub Actions or a VM).
Advertisement
Summary
raco exe and raco distribute turn Racket from a "scripting language" into a simplified application delivery platform. You can even generate installers!
Which command bundles an executable and all its dependencies into a standalone directory?
Md Nasim Sheikh
Software Developer at softexForge