views:

59

answers:

2

I heard that you can compile .ss files with DrScheme, and even remember doing it once to result in some good speedups on my code, since it doesn't need to put in all the debugging info necessary for the GUI. How does one go about doing this?

A: 

Looks like there's a compiler included with PLT Scheme called mzc that produces standalone executables.

David Brown
+3  A: 

In the DrScheme IDE this can be found under the "Scheme -> Create Executable..." menu item. This can also be done from the command line with:

mzc --exe foo foo.ss
twopoint718
This seems to be what I want. Now I'm getting a strange error: " open-output-file: cannot open output file: "/pro/plt/csaftoiu/js-semantics/Redex/eval-jscore-silent" (Permission denied; errno=13)". This happens no matter what filename I give it, no matter which directory, and I definitely have access in some of the ones I tried. Any ideas?
Claudiu
Note that mzc does not get you any speedups -- code in PLT is always compiled before it's executed, so the speed is the same. Running in DrScheme might add some annotations to make debugging better, which can slow things, but that's still unrelated to debugging.In any case if you have weird problems like that, then please post them on the PLT mailing list. (see http://plt-scheme.org/maillist/)
Eli Barzilay
I realize that DrScheme always compiles. But the compilation process itself takes time. And, to make an analog to VC++, the code in DrScheme would be Debug mode, while the code I'm trying to generate here would be Release mode, which should be faster.
Claudiu
Unless you're talking about exceptionally big files, or dealing with a language like typed scheme, compilation shouldn't be a problem. As for VC++, the analogy doesn't work, because (by default) PLT compiles code in memory -- not to a file.
Eli Barzilay
I didn't mean with that respect. I mean VC++ generates Debug code which, for example, zeroes out any memory you malloc/put on the stack. This is slow, but it helps when debugging things. The Release code doesn't do this. DrScheme has to generate code that tells you, for example, where it should draw all those red arrows on your code when you get an error. MZC doesn't put any of that in there.
Claudiu