5

I am looking for a mature and maintained Scheme compiler that can produce stand-alone, native-code executables on (each of) Windows (.exe), Mac OS X, and Linux. No GUI is needed for the executables - just standard text IO (stdin/stdout/stderr) is fine. What compiler would you recommend satisfies these requirements?

An answer to a related (but different) question suggests Gambit-C. According to the commit log it still seems active. Is there any other competitor? MIT Scheme does not seem to be updated often - am I correct?

Thanks!

P.S. To answer a comment: for me, any version of Scheme since R4RS is fine, but rich SRFI support may be more important.

Another comment suggested CHICKEN, which also seems active. It also suggested Racket, which is a byte-code compiler but has JIT and can create a standalone package. (I haven't yet checked Chez Scheme. I am "copying" these "answers" here since the question is put on hold and cannot seem to be reopened even after being edited as instructed...)

Community
  • 1
  • 1
FPstudent
  • 831
  • 5
  • 9
  • This question might not be the best fit for stackoverflow (hence the close votes). There are several options. Of those you haven't mentioned: Racket, Chez Scheme, Chicken https://github.com/cisco/ChezScheme Also see: https://wingolog.org/archives/2013/01/07/an-opinionated-guide-to-scheme-implementations – soegaard Jul 01 '16 at 08:43
  • 1
    If you are targeting a specific RnRS version, you might also add that information. MIT Scheme has incomplete R5RS support, for example. – Michael Vehrs Jul 01 '16 at 08:49
  • Thanks, soegaard, for the information. I believe such answers as yours (and therefore my question too) fit well for SO and would also be useful for other people. I wasn't aware, for instance, that Racket supports compilation into _native_ code (not byte code) - or does it? https://docs.racket-lang.org/raco/index.html does not seem to produce native code for user programs (rather than the byte code interpreter itself). – FPstudent Jul 01 '16 at 09:06
  • Following Michael's suggestion, I've added my own preference about RnRS (and SRFI), but other information may also be useful for people. – FPstudent Jul 01 '16 at 09:16
  • 1
    @FPStudent Racket does compile to bytecode - but the jit will at runtime compile it to native code. – soegaard Jul 01 '16 at 14:05
  • @FPstudent Racket's `raco exe` and `raco distribute` can do similar to what you want. The code isn't truly native, but it does bundle the script as bytecode into a portable, stand-alone executable with all needed libraries so it is portable. Works on Linux, OSX and Windows. – eestrada Jul 01 '16 at 16:14
  • @eestrada The target machine needs to have installed racket before you may run the result though so its not standalone, at least not on Linux. – Sylwester Jul 01 '16 at 22:44
  • @Sylwester https://docs.racket-lang.org/raco/exe-dist.html says "raco distribute" produces a standalone package - does it not work on Linux? – FPstudent Jul 02 '16 at 07:18
  • @soegaard and others, I have edited my question so as to purge the forbidden word "recommend".:-) Seriously, I beg people to be constructive instead of being too dogmatic... – FPstudent Jul 02 '16 at 07:19
  • @FPstudent `raco distribute` changes the path the copied executable look for the racket runtime from `/usr/bin/racket` to be relative `../lib/plt/racket3m-6.5` and it is the same length as the racket executable installed on the system so I guess it will work. Both the racket executable and the compiled program uses shared libs so it will work on all linux installations with compatible version shared libraries and architecture, but it's slightly better than I though. Perhaps if you did it from a static compiled racket you would get away by just making a 32 and 64 bit version. – Sylwester Jul 02 '16 at 13:27
  • 1
    @FPstudent Chicken Scheme compiles R5RS Scheme programs and of course Chicken de facto extensions. With `-static` it will make a standalone executable with no requirements to the machine but the architecture. – Sylwester Jul 02 '16 at 13:39
  • @FPStudent I think your answer is fine, but there is a policy on this site to close questions of that nature. The policy is there to prevent flamewars. Here you were lucky to get an answer before the question was closed. It's more annoying to get a question closing without getting an answer - and then seeing the rationale behind is "the question has too many answers". – soegaard Jul 02 '16 at 14:40
  • @soegaard and others: thanks, I was not able to see _any_ close votes (even though I checked several times after your warning) until the question has already been put hold. Now I have edited the question following the instructions: it no longer asks for a "recommendation" - instead, it asks for a compiler that satisfies a specific set of requirements, which I believe is a specific problem and has specific answers like other questions in SO; how can we proceed next? – FPstudent Jul 02 '16 at 21:46
  • I suggest visiting the Scheme IRC channel instead. – soegaard Jul 02 '16 at 22:28

0 Answers0