[racket] Create executable for "Pretty Big" legacy program
Interesting; thanks Matthew!
Your comment implies that currently, the availability of the "Create
Executable" menu option for non-module language is somewhat misleading.
May I suggest that the DrRacket documentation be changed to reflect the
fact that compilation of non-module languages is not supported? It would
be good if your suggested workaround is mentioned in the documentation
of this menu option.
Please note that I'm just trying to be constructive here. I'm very
grateful for your help!
Best regards,
Bas
On 10/12/2012 16:51, Matthew Flatt wrote:
> 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