Most active commenters
  • valorzard(4)
  • kragen(3)

←back to thread

Practical Scheme

(practical-scheme.net)
153 points ufko_org | 20 comments | | HN request time: 1.003s | source | bottom
1. 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 #
2. ducklord ◴[] No.45653161[source]
https://github.com/cisco/ChezScheme
replies(1): >>45654725 #
3. shawn_w ◴[] No.45653189[source]
Kawa + GraalVM?

I think there's been some work lately to improve Chicken's Windows support.

4. cess11 ◴[] No.45653225[source]
Likely Chez, but you provide too little information to be sure what might be a good option.
replies(1): >>45653712 #
5. forgotpwd16 ◴[] No.45653290[source]
Gauche that is hosted on this site can do it. It does by statically linking the entire Gauche system so may not be the best option. Besides Chez (compiling to native code) that sibling comments mentioned, other options are CHICKEN and Gambit compiling to C (CHICKEN docs provide instructions to even cross-compile[0]).

[0]: http://wiki.call-cc.org/man/5/Cross%20development#cross-deve...

6. zem ◴[] No.45653324[source]
i am fairly sure chicken can do this (never used it on windows myself but the homepage lists all three major platforms). it worked great for building executables on linux and it had a good ecosystem of packages.
replies(1): >>45653714 #
7. hedari ◴[] No.45653538[source]
Others have already pointed out several good options. Let me add one more: Gambit Scheme https://gambitscheme.org/
replies(2): >>45653737 #>>45656770 #
8. valorzard ◴[] No.45653712[source]
I’ve tried chez exe and I can’t tell if it’s bit rotted or if it just doesn’t work on windows anymore
9. valorzard ◴[] No.45653714[source]
I’ve been able to build chicken on Linux kinda, but no dice on windows Edit: oh woops the maintainers responded to me on the mailing list! I should probably respond back https://lists.nongnu.org/archive/html/chicken-users/2025-10/...
10. valorzard ◴[] No.45653737[source]
I might try this next, will check out and try to build it tomorrow Shame that there’s no way to run ./configure on native windows though, I’ll have to use MSYS2
replies(1): >>45655118 #
11. kragen ◴[] No.45654712[source]
I've found Chicken reasonably good at compiling to a standalone executable on Linux. Because of how it works I imagine you can get it to work with msys too.
12. 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 #
13. Boxxed ◴[] No.45655028[source]
I've always liked bigloo. It's probably the most pragmatic of the schemes in my opinion. It never gets the attention that chicken and gambit get, though, and I've always wondered why.
replies(1): >>45655660 #
14. whizzter ◴[] No.45655118{3}[source]
Imho maintainers should just keep a set of pre-made header-files for a Windows compiler, a huge portion the work configure does is because we historically had:

- Bad compilers (that lacked stdlib features)

- Lacked package managers (so we need to detect versions instead of just specifying used libraries for the program)

- The mess of various nix/linux distros having differing paths (/bin or /local/bin or /usr/local/bin or whatever?) and nix binaries lacked a standardized way to just locate "themselves"

In contrast, Windows programs mostly just make an API call to detect where they live and then just load files from relative paths, this also allows for side-by-side installations of varying versions instead of multiple builds (Yes, some programs sadly needed installers but that's just bad engineering, whilst many programs have portable variants).

Considering Mac programs also are self contained I guess those also have some sane API's for program self-location.

Yes, I do realize that much of the centralization of programs harkens back to Unix multi-user paradigms with centralized management but personal computers has been the norm for some almost 40 years at this point (Even if we've moved to web mainframes instead).

15. precompute ◴[] No.45655451[source]
It can't make a standalone executable, but Babashka might be useful.
replies(1): >>45681809 #
16. cess11 ◴[] No.45655660[source]
Oh, right, I forgot about that one. As I remember, it's a good recommendation.

I'm guessing it doesn't get much chatter due to INRIA being not very good at promotion of the stuff they do, and Bigloo doesn't have the academia-industry-matrimonial push that e.g. Pharo has received.

17. crusty_jpeg ◴[] No.45656696{3}[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 #
18. packetlost ◴[] No.45656770[source]
Gerbil gives you a lot of the niceties of Go and Racket on top of Gambit, I highly recommend it: https://cons.io
19. kragen ◴[] No.45657490{4}[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.)
20. Borkdude ◴[] No.45681809[source]
You kinda can:

https://github.com/babashka/babashka/wiki/Self-contained-exe...