Reputation: 110452
I have the following program which I normally run from within DrRacket:
; 1.scm
#lang sicp
(display "hello\n")
(+ 1 1)
Is there a way to run the file directly as an executable, something like /path/to/racket/binary 1.scm
? If so, where can I find the binary for racket (I'm on Mac).
Upvotes: 0
Views: 822
Reputation: 194
I did it in both Debian and FreeBSD. First install racket (being root):
pkg install racket (FreeBSD)
apt install racket (Debian)
After installation, execute your program with:
racket 1.scm
*Plus, if you want to run somewhat related to SICP, then run:
raco pkg install sicp
With that, you are ready to code!
Upvotes: 0
Reputation: 110452
You should be able to find the executable path here, and for Mac it would be:
On Mac OS...It is probably in a Racket folder that you dragged into your Applications folder. If you want to use command-line tools, instead, Racket executables are in the "bin" directory of the Racket folder (and if you want to set your PATH environment variable, you’ll need to do that manually).
And to run it I could use the racket
binary:
$ '/Applications/Racket v8.0/bin/racket' ~/Desktop/sicp/1.scm
Upvotes: 0