I have been using chicken scheme lately and i find it really good, someone suggested that chez scheme is the fastest scheme implementation. So i wanted to try it, but i am not sure how to create compiled binaries from chez like in chicken scheme.
2 Answers
As Sylwester has already mentioned the fasl binaries, but this solution still requires to distribute a chez scheme interpreter. A more interesting solution which produces distributable binary is chez-exe https://github.com/gwatt/chez-exe
-
Any benefit in terms of executable size and speed when comparing with Chicken?– antonioFeb 17, 2018 at 23:55
-
@antonio Yes Chez scheme is actually faster than Chicken. Though I absolutely love chicken, I have heard a lot about chez which is why I wanted to give it a full inspection before making a final opinion. Feb 23, 2018 at 4:37
Chez has a JIT and you can compile files into fasl-like files that you can run just like source files.
From Using Chez Scheme:
Chez Scheme compiles source forms as it sees them to machine code before evaluating them, i.e., "just in time." In order to speed loading of a large file or group of files, each file can be compiled ahead of time via compile-file, which puts the compiled code into a separate object file. For example, (compile-file "path") compiles the forms in the file path.ss and places the resulting object code in the file path.so. Loading a pre-compiled file is essentially no different from loading the source file, except that loading is faster since compilation has already been done.
When compiling a file or set of files, it is often more convenient to use a shell command than to enter Chez Scheme interactively to perform the compilation. This is easily accomplished by "piping" in the command to compile the file as shown below.
echo '(compile-file "filename")' | scheme -q
-
3Thanks, but i was looking for a compiled single binary which does not require a chez-scheme interpreter. Found an interesting solution github.com/gwatt/chez-exe check it out. Jan 2, 2018 at 16:07