Go to file
retropikzel 6e0d9efdf1 Started moving towards distribution as C files 2025-04-13 08:08:44 +03:00
chicken Got it to compile with Chicken 6 2025-04-13 06:07:17 +03:00
snow Started moving towards distribution as C files 2025-04-13 08:08:44 +03:00
src Started moving towards distribution as C files 2025-04-13 08:08:44 +03:00
test Started moving towards distribution as C files 2025-04-13 08:08:44 +03:00
.gitignore Got it to compile with Chicken 6 2025-04-13 06:07:17 +03:00
Dockerfile Got it to compile with Chicken 6 2025-04-13 06:07:17 +03:00
Jenkinsfile Got it to compile with Chicken 6 2025-04-13 06:07:17 +03:00
LICENSE Added license 2025-01-13 17:20:58 +02:00
Makefile Started moving towards distribution as C files 2025-04-13 08:08:44 +03:00
README.md Update readme, fixing racket.exe building 2025-02-07 08:23:25 +02:00
compile-r7rs.rkt Started moving towards distribution as C files 2025-04-13 08:08:44 +03:00
compile-r7rs.scm Started moving towards distribution as C files 2025-04-13 08:08:44 +03:00
configure Made this 2024-12-23 22:01:08 +02:00
retropikzel.pffi.import.scm Started moving towards distribution as C files 2025-04-13 08:08:44 +03:00

README.md

compile-r7rs is a tool to compile R7RS Scheme programs, it aims for compability with SRFI-138.

Dependencies

For scripts:

apt install sharutils

For binaries:

apt install build-essential

For jar:

apt install default-jdk

Installing

make install

Usage

The environment variable SCMC must be set to the same value as the implementations command. The command is the first word on the list. So for example guile for Guile, csi for Chicken interpreter, csc for Chicken compiler.

If the command has .exe at it's end cross compilation from Linux to .exe with Wine is assumed.

Run

SCMC=<SCHEME> compile-r7rs -I <DIR> <file.scm>

So for example to build hello-world.scm with Racket for both Linux and Wine run:

SCMC=racket compile-r7rs -I ./snow hello-world.scm
SCMC=racket.exe compile-r7rs -I ./snow hello-world.scm

Libraries in these commands are assumed to be under snow directory, so library (foo bar) would be in snow/foo/bar.sld.

Outputs

Self contained, self extracting and runnable shell script

Requires the Scheme implementation to be installed to run.

  • chibi-scheme
  • csi (Chicken)
  • icyc (Cyclone)
  • gsi (Gambit)
  • gosh (Gauche)
  • guile
  • mosh
  • sash
  • stklos
  • skint
  • tr7i (tr7)
  • ypsilon

Static binary executable

Does not require Scheme implementation to be installed to run.

  • csc (Chicken)
  • racket (Racket)

Java ARchive (JAR)

Only requires Java to be installed to run.

  • kawa
    • The build folder needs to contain kawa.jar

.exe

  • racket.exe
    • Install Racket and r7rs library with Wine to default locations

How it works

The scripts searches for .sld files in given paths, compiles them if needed and combines them with the main script to form something that can be run on it's own. Meaning that the only thing the person running the things needs, might be, the Scheme implementation, Java, or nothing.