From 5d298d9685f3b1bf3386b64742a54e841641ebd9 Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Sun, 26 Mar 2023 23:11:55 +0200 Subject: [PATCH 1/3] Add Guile 3.0 to Dockerfile --- impls/scheme/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/impls/scheme/Dockerfile b/impls/scheme/Dockerfile index 51583034af..b84c66bc04 100644 --- a/impls/scheme/Dockerfile +++ b/impls/scheme/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:focal +FROM ubuntu:22.04 MAINTAINER Joel Martin ########################################################## @@ -9,7 +9,7 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python +RUN apt-get -y install make python3 python-is-python3 # Some typical implementation and test requirements RUN apt-get -y install curl libreadline-dev libedit-dev @@ -25,7 +25,7 @@ WORKDIR /mal RUN DEBIAN_FRONTEND=noninteractive apt-get -y install gcc g++ bison flex groff make cmake pkg-config git # Prepackaged Scheme implementations -RUN apt-get -y install gauche chicken-bin +RUN apt-get -y install gauche chicken-bin guile-3.0 RUN chicken-install r7rs # Chibi From 91e13b4e24c2b28ea9045042c3e24fc081ba1527 Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Sun, 26 Mar 2023 23:13:57 +0200 Subject: [PATCH 2/3] Add guile-specific support code --- impls/scheme/lib/util.sld | 8 +++++++- impls/scheme/run | 15 ++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/impls/scheme/lib/util.sld b/impls/scheme/lib/util.sld index 679d73fca9..fff8f91d06 100644 --- a/impls/scheme/lib/util.sld +++ b/impls/scheme/lib/util.sld @@ -16,13 +16,19 @@ (begin -;; HACK: cyclone currently implements error the SICP way (cond-expand + ;; HACK: cyclone currently implements error the SICP way (cyclone (define (error-object? x) (and (pair? x) (string? (car x)))) (define read-error? error-object?) (define error-object-message car) (define error-object-irritants cdr)) + ;; HACK: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62464 + (guile + (define %error-object-irritants error-object-irritants) + (set! error-object-irritants + (lambda (ex) + (or (%error-object-irritants ex) '())))) (else)) (define (call-with-input-string string proc) diff --git a/impls/scheme/run b/impls/scheme/run index 9614f8baea..25e22a8039 100755 --- a/impls/scheme/run +++ b/impls/scheme/run @@ -15,12 +15,13 @@ elif [[ $(which sagittarius 2>/dev/null) ]]; then fi case ${scheme_MODE:-chibi} in - chibi) exec chibi-scheme -I$basedir $basedir/$step.scm "${@}" ;; - kawa) exec java -cp $kawa:$basedir/out $step "${@}" ;; - gauche) exec gosh -I$basedir $basedir/$step.scm "${@}" ;; - chicken) CHICKEN_REPOSITORY=$basedir/eggs exec $basedir/$step "${@}" ;; - sagittarius) exec $sagittarius -n -L$basedir $basedir/$step.scm "${@}" ;; - cyclone) exec $basedir/$step "${@}" ;; - foment) exec foment $basedir/$step.scm "${@}" ;; + chibi) exec chibi-scheme -I$basedir $basedir/$step.scm "${@}" ;; + kawa) exec java -cp $kawa:$basedir/out $step "${@}" ;; + gauche) exec gosh -I$basedir $basedir/$step.scm "${@}" ;; + chicken) CHICKEN_REPOSITORY=$basedir/eggs exec $basedir/$step "${@}" ;; + sagittarius) exec $sagittarius -n -L$basedir $basedir/$step.scm "${@}" ;; + cyclone) exec $basedir/$step "${@}" ;; + foment) exec foment $basedir/$step.scm "${@}" ;; + guile) exec guile -L $basedir -x .sld --r7rs -s $basedir/$step.scm "${@}" ;; *) echo "Invalid scheme_MODE: ${scheme_MODE}"; exit 2 ;; esac From 9f9034193a04250845145cb8a40114c763446ca6 Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Sun, 26 Mar 2023 23:14:19 +0200 Subject: [PATCH 3/3] Mention Guile wherever appropriate --- IMPLS.yml | 1 + Makefile.impls | 3 ++- README.md | 4 +++- docs/graph/base_data.yaml | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/IMPLS.yml b/IMPLS.yml index e660ed7626..b9b15dbc41 100644 --- a/IMPLS.yml +++ b/IMPLS.yml @@ -92,6 +92,7 @@ IMPL: - {IMPL: scheme, scheme_MODE: sagittarius} - {IMPL: scheme, scheme_MODE: cyclone} # - {IMPL: scheme, scheme_MODE: foment} + - {IMPL: scheme, scheme_MODE: guile} - {IMPL: skew} - {IMPL: sml, sml_MODE: polyml} - {IMPL: sml, sml_MODE: mlton} diff --git a/Makefile.impls b/Makefile.impls index f126bc7612..ace0a88939 100644 --- a/Makefile.impls +++ b/Makefile.impls @@ -20,7 +20,7 @@ d_MODE = gdc haxe_MODE = neko # octave or matlab matlab_MODE = octave -# scheme (chibi, kawa, gauche, chicken, sagittarius, cyclone, foment) +# scheme (chibi, kawa, gauche, chicken, sagittarius, cyclone, foment, guile) scheme_MODE = chibi # sml (polyml, mlton, mosml) sml_MODE = polyml @@ -104,6 +104,7 @@ scheme_STEP_TO_PROG_chicken = impls/scheme/$($(1)) scheme_STEP_TO_PROG_sagittarius = impls/scheme/$($(1)).scm scheme_STEP_TO_PROG_cyclone = impls/scheme/$($(1)) scheme_STEP_TO_PROG_foment = impls/scheme/$($(1)).scm +scheme_STEP_TO_PROG_guile = impls/scheme/$($(1)).scm # Map of step (e.g. "step8") to executable file for that step ada_STEP_TO_PROG = impls/ada/$($(1)) diff --git a/README.md b/README.md index 35f3a7dbb6..f9902832d0 100644 --- a/README.md +++ b/README.md @@ -1061,7 +1061,7 @@ scala -classpath target/scala*/classes stepX_YYY The Scheme implementation of MAL has been tested with Chibi-Scheme 0.10, Kawa 3.1.1, Gauche 0.9.6, CHICKEN 5.1.0, Sagittarius 0.9.7, -Cyclone 0.32.0 (Git version) and Foment 0.4 (Git version). You should +Cyclone 0.32.0 (Git version), Foment 0.4 (Git version) and Guile 3.0.1. You should be able to get it running on other conforming R7RS implementations after figuring out how libraries are loaded and adjusting the `Makefile` and `run` script accordingly. @@ -1085,6 +1085,8 @@ make cyclone scheme_MODE=cyclone ./run # foment scheme_MODE=foment ./run +# guile +scheme_MODE=guile ./run ``` ### Skew ### diff --git a/docs/graph/base_data.yaml b/docs/graph/base_data.yaml index 3ff703d35a..9206144f2c 100644 --- a/docs/graph/base_data.yaml +++ b/docs/graph/base_data.yaml @@ -70,7 +70,7 @@ languages: - [ruby , Ruby , OTHER , Dynamic , []] - [rust , Rust , C , Static , []] - [scala , Scala , C , Static , []] - - [scheme , Scheme (R7RS) , Lisp , Dynamic , [chibi,kawa,gauche,chicken,sagittarius,cyclone,foment]] + - [scheme , Scheme (R7RS) , Lisp , Dynamic , [chibi,kawa,gauche,chicken,sagittarius,cyclone,foment,guile]] - [skew , Skew , OTHER , Static , []] - [swift , Swift 2 , C , Static , []] - [swift3 , Swift 3 , C , Static , []]