Can Chez scheme produce compiled binaries?
Asked Answered
R

2

13

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.

Rrhoea answered 2/1, 2018 at 12:40 Comment(0)
R
11

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

Rrhoea answered 2/1, 2018 at 16:10 Comment(2)
Any benefit in terms of executable size and speed when comparing with Chicken?Rotate
@Rotate 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.Rrhoea
R
5

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
Raeannraeburn answered 2/1, 2018 at 13:24 Comment(1)
Thanks, 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.Rrhoea

© 2022 - 2024 — McMap. All rights reserved.