←back to thread

Practical Scheme

(practical-scheme.net)
153 points ufko_org | 3 comments | | HN request time: 0s | source
Show context
valorzard ◴[] No.45653147[source]
What scheme do I used if I want to compile to a standalone executable on both Linux and windows? (That’s not Racket)
replies(9): >>45653161 #>>45653189 #>>45653225 #>>45653290 #>>45653324 #>>45653538 #>>45654712 #>>45655028 #>>45655451 #
ducklord ◴[] No.45653161[source]
https://github.com/cisco/ChezScheme
replies(1): >>45654725 #
1. kragen ◴[] No.45654725[source]
I have not been able to get usable executables out of Chez, even on Linux, although it's nice and fast when used the normal way.
replies(1): >>45656696 #
2. crusty_jpeg ◴[] No.45656696[source]
The best way I've found to make a standalone executable is to compile my scheme program into a .boot file and embed it, along with Chez's .boot files, into a small C program that then calls the scheme program.

All of the necessary functions to create such a C program documented here: https://cisco.github.io/ChezScheme/csug10.0/foreign.html#./f...

The relevant functions for this applictation are:

Sscheme_init

Sregister_boot_file_bytes

Sbuild_heap

Senable_expeditor (if you want to use Chez's builtin REPL)

Sscheme_start

Sscheme_deinit

I'd post an example program, but I've not got access to my development machine at the moment.

replies(1): >>45657490 #
3. kragen ◴[] No.45657490[source]
Thank you! I wonder how much extra work it is to use Racket code in such a program. (Because that was what I wanted to do.)