[racket] Create executable for "Pretty Big" legacy program

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Dec 10 10:51:53 EST 2012

Sorry for the long delay.

Stand-alone executables are not generally supported for non-module
languages. It's possible to make something work, however, by using a
module that `load's your Pretty Big program after setting up a
namespace.

 #lang racket/base
 (require (for-syntax racket/base)
          racket/runtime-path)

 (define-runtime-module-path-index pb 'lang/plt-pretty-big-text)
 (define-runtime-path prog "myprogram.ss")

 (namespace-require pb)
 (load prog)

This approach bundles the source code for "program.ss" with the Pretty
Big language and then loads the source code at run time. Possibly, the
Pretty Big language involves some run-time configuration, which you
would imitate by setting relevant paraemeters before using `load'.

At Mon, 03 Dec 2012 23:55:03 +0100, Bas Steunebrink wrote:
> Ciao a tutti,
> 
> I have a program, written for the Pretty Big legacy language, and I'm 
> trying to create an executable for it. I tried the menu option Racket -> 
> Create Executable, which does indeed create an executable. However, the 
> executable appears to be dependent on the (single) original source code 
> file, without which the executable refuses to run. This kinda defeats 
> the whole exercise!
> 
> So my question is: how to go from myprogram.ss to myprogram.exe, such 
> that myprogram.exe does not need myprogram.ss to run?
> 
> 
> BTW, yes I'm running the latest version of DrRacket (5.3.1), and I've 
> also tried running raco distribute on the generated executable, but this 
> only causes further problems.
> 
> Best regards,
> Bas
> 
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.