Making a manual page and renaming the program

This commit is contained in:
2025-11-07 12:18:32 +02:00
parent 5ff9e402e7
commit 8853ed5c5c
9 changed files with 430 additions and 242 deletions
+39
View File
@@ -0,0 +1,39 @@
## Roadmap
- Support for more implementations
- gambit
- Adding paths to compiled executable is such a pain that no support yet
- husk
- Dont know how to add directories to load path yet, might not be
implemented
- r7rs
- picrin
- Might not be possible, seems to not have (include...) that works like
others
- r7rs
- scheme-rs
- Waiting for implementation support
- r6rs
- r7rs
- stak
- Waiting for implementation support https://github.com/raviqqe/stak/issues/2355
- r7rs
- vicare
- So old that I have problems compiling it in Docker, so testing is
hard but I expect it to work once I get it to compile as it is R6RS
implementation
- r6rs
- Better and tested support for Windows
- Right now there is support for running this but I can not quarantee it
works on all if any cases
- Support for -D
- Most implementations dont have this or equivalent flag, but it would be
really nice feature to have so filing issues and implementing it myself is
something I would like to do
- Ask implementations to support adding to the front and back of load path, or
implement this onto implementations myself
- This might not be as important, but it would be nice to go towards SRFI-138
conformaty
- Environment variable to force the target operating system
- Since for example for interpreters the program produces .bat file with
command to run the interpreter "cross compiling" is easy.
+12
View File
@@ -0,0 +1,12 @@
## Build and install
You will need to have snow-chibi installed, it comes with Chibi Scheme.
You can run compile-r7rs on Chibi, Chicken, Gauche, Guile, Kawa, Sagittarius or
STklos.
snow-chibi --impls=SCHEME "(foreign c)"
snow-chibi --impls=SCHEME "(srfi 170)"
make build-SCHEME
make install
+82
View File
@@ -0,0 +1,82 @@
.TH compile-scheme 1
.SH NAME
compile-scheme \- Compiling Scheme programs to executables
.SH SYNOPSIS
\fBcompile-scheme\fR { [\fB-A\fR \fIpath\fR] [\fB-I\fR \fIpath\fR] [\fB-o\fR \fIpath\fR] [\fB-t\fR \fItarget\fR] input-file\fI{.scm | .sps}\fR | \fIlong-options...\fR }
.SH DESCRIPTION
.P
\fBcompile-scheme\fR is a tool to compile R6RS and R7RS Scheme programs.
It supports most of SRFI-138 but also adds more features.
.P
The program \fIinput-file\fR is compiled into an executable file.
The resulting executable file is written to file specified by the \fB-o\fR \fIpath\fR (if present) or to the file named same as \fIinput-file\fR but without the .scm or .sps suffix.
On Windows either .bat or .exe is appended to the output name.
.SS SUPPORT LIST
.P
Some implementations support both compiling and interpreting, in that
case only the compiler functionality is used and the implementation is marked
as compiler.
.IP "R6RS Compilers"
loko
.IP "R6RS Interpreters"
chezscheme guile ikarus ironscheme mosh racket sagittarius ypsilon
.IP "R7RS Compilers"
chicken cyclone loko
.IP "R7RS Interpreters"
chibi foment gauche guile kawa larceny meevax mit-scheme mosh racket sagittarius skint stklos tr7 ypsilon
.SH OPTIONS
.P
\fB\-A\fR \fIpath\fR
Append path to the list of directories that are searched in order to locate imported libraries.
.P
\fB\-I\fR \fIpath\fR
Prepend directory to the list of directories that are searched in order to locate imported libraries.
.P
\fB-o\fR \fIoutput-file\fR
Use the \fIoutput-file\fR file, instead of the default deducted from input-file, for the executable file produced.
.P
Multiple instances of the -A, and -I options can be specified.
.P
\fB\-t\fR { \fIunix\fR | \fIwindows\fR | \fIphp\fR }
Set the compilation target.
This is not needed if you are compiling for the target OS you are running.
Cross compilation is only supported in following cases:
.IP
From \fIunix\fR host to \fIphp\fR target when chosen implementation is interpreter.
.IP
From \fIunix\fR host to \fIwindows\fR target when chosen implementation is interpreter.
.P
.B \-\-list-r6rs
List supported R6RS implementations.
.P
.B \-\-list-r7rs
List supported R7RS implementations.
.P
.B \-\-list-all
List all supported implementations.
.P
\fB\-\-list-targets\fR
List all supported compilation targets.
.SH ENVIRONMENT
.P
\fBCOMPILE_R7RS/COMPILE_SCHEME\fR
.IP
This environment variable \fBmust\fR be set. Set it to the \fBname\fR of the implementation as specified in the support list.
\fBThis differs from SRFI-138\fR as the SRFI excepts a path.
.SH STANDARDS
.P
SRFI 138: Compiling Scheme programs to executables.
https://srfi.schemers.org/srfi-138/srfi-138.html
.SH CAVEATS
.P
Differences from SRFI-138
.IP
No support for -D flag.
.IP
Not all implementations support adding to beginning or end of load path so -I and -A might work the same
.IP
Only supports one input-file.
.SH EXAMPLES