Compiling standalone executables - racket/racket GitHub Wiki

Standalone executables can be created from the command line using raco or by using "Create Executable" in DrRacket.

What exactly is "standalone"?

Using raco exe produces an executable that may reference dynamically linked libraries from the system it was built in, including DLLs in the Racket distribution used to build the executable.

Using raco distribute includes all dynmically linked libraries necessary for the program to run.

The complete DrRacket-based explanation below creates a distribution, intended to run on any computer.

Want to try it?

  1. Download and install Racket from https://download.racket-lang.org
  2. Start DrRacket
  3. Choose the language: The Racket language in the Language dialog. (This shows up the first time you use DrRacket)
  4. Paste this simple GUI app into DrRacket. (the top 'Definitions' bit - don't forget to replace the #lang racket with the #lang racket/gui so you don't have two #lang ... lines)
#lang racket/gui

(define my-language 'English)

(define translations
  #hash([English . "Hello world"]
        [French . "Bonjour le monde"]
        [German . "Hallo Welt"]
        [Greek . "Γειά σου, κόσμε"]
        [Portuguese . "Olá mundo"]
        [Spanish . "Hola mundo"]
        [Thai . "สวัสดีชาวโลก"]))

(define my-hello-world
  (hash-ref translations my-language
            "hello world"))

(message-box "" my-hello-world)
  1. Click the yellow floppy disk icon to save, or use 'Save Definitions' in the File menu.
  2. Click the Create Executable in the Racket menu.
  3. For the type, choose Distribution to fully package your app to run on other machines.
  4. For base, choose GRacket. (don't worry about the files for icons for now)
  5. Click the Create button to compile your app.