News for hackers. Stuff that matters.
Re:Practical Scheme by valorzard on Tuesday October 21, 2025 @02:49AM (#45653147)
What scheme do I used if I want to compile to a standalone executable on both Linux and windows? (That’s not Racket)
Re:Practical Scheme by hedari on Tuesday October 21, 2025 @04:02AM (#45653538)
Others have already pointed out several good options. Let me add one more: Gambit Scheme https://gambitscheme.org/
Re:Practical Scheme by valorzard on Tuesday October 21, 2025 @04:37AM (#45653737)
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
Re:Practical Scheme by whizzter on Tuesday October 21, 2025 @08:50AM (#45655118)
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).

Re:Practical Scheme by packetlost on Tuesday October 21, 2025 @11:08AM (#45656770)
Gerbil gives you a lot of the niceties of Go and Racket on top of Gambit, I highly recommend it: https://cons.io
Re:Practical Scheme by forgotpwd16 on Tuesday October 21, 2025 @03:17AM (#45653290)
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...

Re:Practical Scheme by zem on Tuesday October 21, 2025 @03:22AM (#45653324)
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.
Re:Practical Scheme by valorzard on Tuesday October 21, 2025 @04:33AM (#45653714)
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/...
Re:Practical Scheme by ducklord on Tuesday October 21, 2025 @02:53AM (#45653161)
Re:Practical Scheme by kragen on Tuesday October 21, 2025 @07:51AM (#45654725)
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.
Re:Practical Scheme by crusty_jpeg on Tuesday October 21, 2025 @11:02AM (#45656696)
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.

Re:Practical Scheme by kragen on Tuesday October 21, 2025 @12:06PM (#45657490)
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.)
Re:Practical Scheme by shawn_w on Tuesday October 21, 2025 @02:59AM (#45653189)
Kawa + GraalVM?

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

Re:Practical Scheme by cess11 on Tuesday October 21, 2025 @03:06AM (#45653225)
Likely Chez, but you provide too little information to be sure what might be a good option.
Re:Practical Scheme by valorzard on Tuesday October 21, 2025 @04:33AM (#45653712)
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
Re:Practical Scheme by kragen on Tuesday October 21, 2025 @07:49AM (#45654712)
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.
Re:Practical Scheme by Boxxed on Tuesday October 21, 2025 @08:36AM (#45655028)
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.
Re:Practical Scheme by cess11 on Tuesday October 21, 2025 @09:37AM (#45655660)
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.

Re:Practical Scheme by precompute on Tuesday October 21, 2025 @09:22AM (#45655451)
It can't make a standalone executable, but Babashka might be useful.
Re:Practical Scheme by Borkdude on Thursday October 23, 2025 @09:50AM (#45681809)