Search code examples
compilationmit-scheme

Compiling .scm files with MIT-SCHEME


Well, I'm trying to compile this simple scheme code using the "better" scheme interpreter/compiler MIT-SCHEME:

code.scm:

(declare (usual-integrations))
(define (s x) (* x x))
(display (s 2))

What am I doing? I'm doing this:

DXHJ ~ mit-scheme
DXHJ ~ (cf "code.scm")

;Generating SCode for file: "s.scm" => "s.bin"... done
;Compiling file: "s.bin" => "s.com"... done
;Unspecified return value

Well, after that I can't run anything. How can I generate an .out file?


Solution

  • It seems mit-scheme cannot compile to native, stand-alone binaries. There are other implementations that can do this. For example, Chicken scheme, Bigloo and gambit.