Skip to content

Instantly share code, notes, and snippets.

@doccaico
Last active November 10, 2026 10:58
Show Gist options
  • Select an option

  • Save doccaico/4ddac77096f68bee254905ef0d7e6ff6 to your computer and use it in GitHub Desktop.

Select an option

Save doccaico/4ddac77096f68bee254905ef0d7e6ff6 to your computer and use it in GitHub Desktop.
Chez Scheme: Create an executable on Windows (単独のファイルを扱うバージョン)
#include "scheme.h"
#include "petite_boot.h"
#include "scheme_boot.h"
#include "app_boot.h"
int main(int argc, char *argv[]) {
Sscheme_init(NULL);
Sregister_boot_file_bytes("petite.boot", (char *)petite_boot, petite_boot_len);
Sregister_boot_file_bytes("scheme.boot", (char *)scheme_boot, scheme_boot_len);
Sregister_boot_file_bytes("app.boot", (char *)app_boot, app_boot_len);
Sbuild_heap("app.boot", NULL);
int status = Sscheme_start(argc, (const char **)argv);
Sscheme_deinit();
return status;
}
(printf "Hello from Chez Scheme Single Binary!")
(newline)
(exit)
@echo off
setlocal
set CHEZ=C:\Langs\chez-scheme
scheme -q --script build.ss
xxd -i -n petite_boot %CHEZ%\boot\a6nt\petite.boot > petite_boot.h
xxd -i -n scheme_boot %CHEZ%\boot\a6nt\scheme.boot > scheme_boot.h
xxd -i -n app_boot app.boot > app_boot.h
cl /I "%CHEZ%\boot\a6nt" app.c /Fe:app.exe "%CHEZ%\bin\a6nt\csv1041.lib"
endlocal
REM vim: ft=dosbatch fenc=cp932 ff=dos
(make-boot-file "app.boot" '("scheme" "petite") "app.ss")
(exit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment