Compare commits

...

3 Commits

Author SHA1 Message Date
retropikzel a7e50b7007 Add support for Capyscheme 2026-03-13 07:02:00 +02:00
retropikzel 5fa00c1413 Update readme 2026-03-12 20:09:11 +02:00
retropikzel 3d04909627 Speed up tests 2026-03-12 19:50:47 +02:00
5 changed files with 17 additions and 10 deletions

View File

@ -1,5 +1,6 @@
ARG SCHEME=chibi
FROM docker.io/schemers/${SCHEME}
ARG IMAGE=chibi:latest
FROM docker.io/schemers/${IMAGE}
ARG SCHEME=chibi
ENV COMPILE_R7RS=${SCHEME}
RUN apt-get update && apt-get install -y make

1
Jenkinsfile vendored
View File

@ -4,6 +4,7 @@ pipeline {
filename 'Dockerfile.jenkins'
label 'docker-x86_64'
args '--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock'
reuseNode true
}
}

View File

@ -1,5 +1,6 @@
PREFIX=/usr/local
SCHEME=chibi
IMAGE=${SCHEME}:latest
RNRS=r7rs
all: build
@ -20,16 +21,12 @@ test:
@echo "(import (scheme base) (scheme write))" > .tmp/main.scm
@echo "(display \"Hello\") (newline)" >> .tmp/main.scm
@rm -rf .tmp/main
@if [ "${RNRS}" = "r6rs" ]; then cd .tmp && COMPILE_R7RS=${SCHEME} sh ../compile-r7rs -o main -I libs -A other_libs main.sps; fi
@if [ "${RNRS}" = "r7rs" ]; then cd .tmp && COMPILE_R7RS=${SCHEME} sh ../compile-r7rs -o main -I libs -A other_libs main.scm; fi
@cd .tmp && ./main
@rm -rf .tmp/main
@if [ "${RNRS}" = "r6rs" ]; then cd .tmp && COMPILE_R7RS=${SCHEME} sh ../compile-r7rs -I libs -A other_libs main.sps; fi
@if [ "${RNRS}" = "r7rs" ]; then cd .tmp && COMPILE_R7RS=${SCHEME} sh ../compile-r7rs -I libs -A other_libs main.scm; fi
@if [ "${RNRS}" = "r6rs" ]; then cd .tmp && COMPILE_R7RS=${SCHEME} sh ../compile-r7rs -o main main.sps; fi
@if [ "${RNRS}" = "r7rs" ]; then cd .tmp && COMPILE_R7RS=${SCHEME} sh ../compile-r7rs -o main main.scm; fi
@cd .tmp && ./main
test-docker:
docker build --build-arg SCHEME=${SCHEME} -f Dockerfile.test --tag=${SCHEME}-testing .
docker build --build-arg IMAGE=${IMAGE} --build-arg SCHEME=${SCHEME} -f Dockerfile.test --tag=${SCHEME}-testing .
docker run ${SCHEME}-testing sh -c "make SCHEME=${SCHEME} RNRS=${RNRS} test"

View File

@ -3,10 +3,13 @@ Implementation of
made with POSIX Shell.
No support for -D yet.
## Usage
COMPILE_R7RS=${SCHEME} compile-r7rs -o main -I libs -A other_libs main.scm
./main
Supported implementations:
## Implementations
- capyscheme
- chezscheme
- chibi
@ -29,3 +32,6 @@ Supported implementations:
- stklos
- tr7
- ypsilon
## Misc
- No support for -D yet.

View File

@ -56,6 +56,7 @@ prefix="#!/usr/bin/env -S"
case $rnrs in
R6RS)
case $COMPILE_R7RS in
capyscheme) printf "\n#|\nexec capy --r6rs $prepend_dirs $append_dirs --script \$0\n|#\n" >> "$output_file";;
chezscheme) echo "$prefix scheme --libdirs $prepend_dirs:$append_dirs --program" >> "$output_file";;
guile) printf "$prefix guile --r6rs $prepend_dirs $append_dirs\n!#\n" >> "$output_file";;
ikarus) echo "$prefix IKARUS_LIBRARY_PATH=$prepend_dirs:$append_dirs ikarus --r6rs-script" >> "$output_file";;
@ -71,6 +72,7 @@ case $rnrs in
esac;;
R7RS)
case $COMPILE_R7RS in
capyscheme) printf "\n#|\nexec capy --r7rs $prepend_dirs $append_dirs --script \$0\n|#\n" >> "$output_file";;
chicken) csc -o "$output_file" "$input_file";;
chibi) echo "$prefix chibi-scheme $prepend_dirs $append_dirs" >> "$output_file";;
cyclone) cyclone -o "$output_file" $prepend_dirs $append_dirs "$input_file";;