diff --git a/impls/ada.2/Dockerfile b/impls/ada.2/Dockerfile index b05b41362e..8b6e8c793a 100644 --- a/impls/ada.2/Dockerfile +++ b/impls/ada.2/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -22,4 +20,4 @@ WORKDIR /mal ########################################################## # GNU Ada compiler -RUN apt-get -y install gnat-8 +RUN apt-get -y install gnat libreadline-dev diff --git a/impls/ada/Dockerfile b/impls/ada/Dockerfile index 5eb272abe0..36fc239937 100755 --- a/impls/ada/Dockerfile +++ b/impls/ada/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -22,4 +20,4 @@ WORKDIR /mal ########################################################## # GNU Ada compiler -RUN apt-get -y install gnat-4.9 +RUN apt-get -y install gnat diff --git a/impls/awk/Dockerfile b/impls/awk/Dockerfile index 9d0e12cee1..ee827698ad 100644 --- a/impls/awk/Dockerfile +++ b/impls/awk/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal diff --git a/impls/bash/Dockerfile b/impls/bash/Dockerfile index 71720eb5e5..db4ba29f1c 100644 --- a/impls/bash/Dockerfile +++ b/impls/bash/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal diff --git a/impls/bbc-basic/Dockerfile b/impls/bbc-basic/Dockerfile index 32af593a86..b62ad192e7 100644 --- a/impls/bbc-basic/Dockerfile +++ b/impls/bbc-basic/Dockerfile @@ -1,4 +1,5 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 +MAINTAINER Joel Martin ########################################################## # General requirements for testing or common across many @@ -8,10 +9,8 @@ FROM ubuntu:18.04 RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal diff --git a/impls/c.2/Dockerfile b/impls/c.2/Dockerfile index 79bab2ecad..87a8e19d1c 100644 --- a/impls/c.2/Dockerfile +++ b/impls/c.2/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:bionic +FROM ubuntu:20.04 MAINTAINER Duncan Watts ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Duncan Watts RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -#RUN apt-get -y install curl +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal diff --git a/impls/clojure/Dockerfile b/impls/clojure/Dockerfile index 2d1dea49a3..4c824b4247 100644 --- a/impls/clojure/Dockerfile +++ b/impls/clojure/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,15 +19,13 @@ WORKDIR /mal # Specific implementation requirements ########################################################## +RUN apt-get -y install curl libreadline-dev libedit-dev + # # Clojure (Java and lein) # -RUN apt-get -y install openjdk-8-jdk - -ADD https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein \ - /usr/local/bin/lein -RUN chmod 0755 /usr/local/bin/lein +RUN apt-get -y install leiningen ENV LEIN_HOME /mal/.lein ENV LEIN_JVM_OPTS -Duser.home=/mal @@ -53,4 +49,3 @@ ENV NPM_CONFIG_CACHE /mal/.npm #RUN npm install -g ffi lumo-cljs ENV HOME=/mal - diff --git a/impls/coffee/Dockerfile b/impls/coffee/Dockerfile index 075c304e7f..2a5c1395e3 100644 --- a/impls/coffee/Dockerfile +++ b/impls/coffee/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,19 +19,6 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# For building node modules -RUN apt-get -y install g++ - -# Add nodesource apt repo config for 10.x stable -RUN apt-get -y install gnupg -RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - - -# Install nodejs -RUN apt-get -y install nodejs - +RUN apt-get -y install coffeescript g++ libreadline-dev npm ENV NPM_CONFIG_CACHE /mal/.npm - -# CoffeeScript specific -RUN npm install -g coffeescript RUN touch /.coffee_history && chmod go+w /.coffee_history - diff --git a/impls/common-lisp/Dockerfile b/impls/common-lisp/Dockerfile index 447f413bbb..549a96227c 100644 --- a/impls/common-lisp/Dockerfile +++ b/impls/common-lisp/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,8 +19,7 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# Install git, make -RUN apt-get -y install git make +RUN apt-get -y install curl git libreadline-dev libedit-dev # Install sbcl RUN apt-get -y install sbcl diff --git a/impls/cpp/Dockerfile b/impls/cpp/Dockerfile index 8d01389900..8c0e3f7931 100644 --- a/impls/cpp/Dockerfile +++ b/impls/cpp/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -22,4 +20,4 @@ WORKDIR /mal ########################################################## # Install g++ for any C/C++ based implementations -RUN apt-get -y install g++ +RUN apt-get -y install g++ libreadline-dev diff --git a/impls/cpp/Makefile b/impls/cpp/Makefile index 2377031883..1c81812297 100644 --- a/impls/cpp/Makefile +++ b/impls/cpp/Makefile @@ -1,14 +1,11 @@ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') +CXX=g++ ifeq ($(uname_S),Darwin) # Native build on yosemite. Requires: brew install readline - CXX=g++ READLINE=/usr/local/opt/readline INCPATHS=-I$(READLINE)/include LIBPATHS=-L$(READLINE)/lib -else - # Ubuntu 14.10 / docker - CXX=g++-4.9 endif LD=$(CXX) diff --git a/impls/cs/Dockerfile b/impls/cs/Dockerfile index f5f133484d..88e29c42cb 100644 --- a/impls/cs/Dockerfile +++ b/impls/cs/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal diff --git a/impls/elisp/Dockerfile b/impls/elisp/Dockerfile index 1eefd6c0c8..0085431a6b 100644 --- a/impls/elisp/Dockerfile +++ b/impls/elisp/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:wily +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,6 +19,4 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# Emacs 24 -RUN apt-get -y install emacs24-nox - +RUN apt-get -y install emacs-nox diff --git a/impls/elixir/Dockerfile b/impls/elixir/Dockerfile index 758c9036a6..df27ab7797 100644 --- a/impls/elixir/Dockerfile +++ b/impls/elixir/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:xenial +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -22,9 +20,4 @@ WORKDIR /mal ########################################################## # Elixir -RUN apt-get install -y wget -RUN wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb -RUN dpkg -i erlang-solutions_1.0_all.deb -RUN apt-get update -y -RUN apt-get install -y esl-erlang RUN apt-get install -y elixir diff --git a/impls/erlang/Dockerfile b/impls/erlang/Dockerfile index f2b907627c..ad9572b011 100644 --- a/impls/erlang/Dockerfile +++ b/impls/erlang/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,15 +19,4 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# Erlang R17 (so I can use maps) -RUN apt-get -y install build-essential libncurses5-dev libssl-dev -RUN cd /tmp && curl -O http://www.erlang.org/download/otp_src_17.5.tar.gz \ - && tar -C /tmp -zxf /tmp/otp_src_17.5.tar.gz \ - && cd /tmp/otp_src_17.5 && ./configure && make && make install \ - && rm -rf /tmp/otp_src_17.5 /tmp/otp_src_17.5.tar.gz -# Rebar for building the Erlang implementation -RUN apt-get -y install git sudo -RUN cd /tmp/ && git clone -q https://github.com/rebar/rebar.git \ - && cd /tmp/rebar && ./bootstrap && cp rebar /usr/local/bin \ - && rm -rf /tmp/rebar - +RUN apt-get -y install erlang rebar diff --git a/impls/erlang/rebar.config b/impls/erlang/rebar.config index f18253f3d9..80e028cbac 100644 --- a/impls/erlang/rebar.config +++ b/impls/erlang/rebar.config @@ -2,8 +2,6 @@ %% rebar configuration file (https://github.com/rebar/rebar) %% -{require_otp_vsn, "17|18"}. - {erl_opts, [debug_info, fail_on_warning]}. {clean_files, [ diff --git a/impls/es6/Dockerfile b/impls/es6/Dockerfile index f7677e91c8..04639574a1 100644 --- a/impls/es6/Dockerfile +++ b/impls/es6/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,14 +19,6 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# For building node modules -RUN apt-get -y install g++ - -# Add nodesource apt repo config for 10.x stable -RUN apt-get -y install gnupg -RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - - -# Install nodejs -RUN apt-get -y install nodejs +RUN apt-get install -y g++ libreadline-dev npm ENV NPM_CONFIG_CACHE /mal/.npm diff --git a/impls/factor/Dockerfile b/impls/factor/Dockerfile index c213838156..55b5627436 100644 --- a/impls/factor/Dockerfile +++ b/impls/factor/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,11 +19,10 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# Factor -RUN apt-get -y install libgtkglext1 -RUN cd /usr/lib/x86_64-linux-gnu/ \ - && curl -O http://downloads.factorcode.org/releases/0.97/factor-linux-x86-64-0.97.tar.gz \ - && tar xvzf factor-linux-x86-64-0.97.tar.gz \ - && ln -sf /usr/lib/x86_64-linux-gnu/factor/factor /usr/bin/factor \ - && rm factor-linux-x86-64-0.97.tar.gz +RUN apt-get -y install ca-certificates curl libgtkglext1-dev libreadline-dev + +RUN curl https://downloads.factorcode.org/releases/0.98/factor-linux-x86-64-0.98.tar.gz | tar -xzC/mal +ENV PATH $PATH:/mal/factor +# Allow /mal/factor to create the $HOME/.cache directory. +ENV HOME /mal diff --git a/impls/factor/lib/printer/printer.factor b/impls/factor/lib/printer/printer.factor index 8ff4266afe..0739f473ef 100644 --- a/impls/factor/lib/printer/printer.factor +++ b/impls/factor/lib/printer/printer.factor @@ -5,7 +5,7 @@ lib.types math math.parser sequences splitting strings summary vectors ; IN: lib.printer -GENERIC# (pr-str) 1 ( maltype readably? -- str ) +GENERIC#: (pr-str) 1 ( maltype readably? -- str ) M: object (pr-str) drop summary ; M: malatom (pr-str) [ val>> ] dip (pr-str) "(atom " ")" surround ; M: malfn (pr-str) 2drop "#" ; diff --git a/impls/factor/step2_eval/step2_eval.factor b/impls/factor/step2_eval/step2_eval.factor index 8b73333126..d27c8b8301 100755 --- a/impls/factor/step2_eval/step2_eval.factor +++ b/impls/factor/step2_eval/step2_eval.factor @@ -14,7 +14,7 @@ CONSTANT: repl-env H{ DEFER: EVAL -GENERIC# eval-ast 1 ( ast env -- ast ) +GENERIC#: eval-ast 1 ( ast env -- ast ) M: malsymbol eval-ast [ name>> ] dip ?at [ "no variable " prepend throw ] unless ; M: sequence eval-ast '[ _ EVAL ] map ; diff --git a/impls/factor/step3_env/step3_env.factor b/impls/factor/step3_env/step3_env.factor index 742c3f59f2..73c2b27bf1 100755 --- a/impls/factor/step3_env/step3_env.factor +++ b/impls/factor/step3_env/step3_env.factor @@ -16,7 +16,7 @@ SYMBOL: repl-env DEFER: EVAL -GENERIC# eval-ast 1 ( ast env -- ast ) +GENERIC#: eval-ast 1 ( ast env -- ast ) M: malsymbol eval-ast env-get ; M: sequence eval-ast '[ _ EVAL ] map ; M: assoc eval-ast '[ _ EVAL ] assoc-map ; diff --git a/impls/factor/step4_if_fn_do/step4_if_fn_do.factor b/impls/factor/step4_if_fn_do/step4_if_fn_do.factor index 37076e98f2..eccb64c14e 100755 --- a/impls/factor/step4_if_fn_do/step4_if_fn_do.factor +++ b/impls/factor/step4_if_fn_do/step4_if_fn_do.factor @@ -10,7 +10,7 @@ SYMBOL: repl-env DEFER: EVAL -GENERIC# eval-ast 1 ( ast env -- ast ) +GENERIC#: eval-ast 1 ( ast env -- ast ) M: malsymbol eval-ast env-get ; M: sequence eval-ast '[ _ EVAL ] map ; M: assoc eval-ast '[ _ EVAL ] assoc-map ; diff --git a/impls/factor/step5_tco/step5_tco.factor b/impls/factor/step5_tco/step5_tco.factor index aff1b9cf37..aaf8f279e9 100755 --- a/impls/factor/step5_tco/step5_tco.factor +++ b/impls/factor/step5_tco/step5_tco.factor @@ -10,7 +10,7 @@ SYMBOL: repl-env DEFER: EVAL -GENERIC# eval-ast 1 ( ast env -- ast ) +GENERIC#: eval-ast 1 ( ast env -- ast ) M: malsymbol eval-ast env-get ; M: sequence eval-ast '[ _ EVAL ] map ; M: assoc eval-ast '[ _ EVAL ] assoc-map ; diff --git a/impls/factor/step6_file/step6_file.factor b/impls/factor/step6_file/step6_file.factor index 290ee83333..fad99ed44a 100755 --- a/impls/factor/step6_file/step6_file.factor +++ b/impls/factor/step6_file/step6_file.factor @@ -10,7 +10,7 @@ SYMBOL: repl-env DEFER: EVAL -GENERIC# eval-ast 1 ( ast env -- ast ) +GENERIC#: eval-ast 1 ( ast env -- ast ) M: malsymbol eval-ast env-get ; M: sequence eval-ast '[ _ EVAL ] map ; M: assoc eval-ast '[ _ EVAL ] assoc-map ; diff --git a/impls/factor/step7_quote/step7_quote.factor b/impls/factor/step7_quote/step7_quote.factor index eae1cc5de1..619b7a0c05 100755 --- a/impls/factor/step7_quote/step7_quote.factor +++ b/impls/factor/step7_quote/step7_quote.factor @@ -11,7 +11,7 @@ SYMBOL: repl-env DEFER: EVAL -GENERIC# eval-ast 1 ( ast env -- ast ) +GENERIC#: eval-ast 1 ( ast env -- ast ) M: malsymbol eval-ast env-get ; M: sequence eval-ast '[ _ EVAL ] map ; M: assoc eval-ast '[ _ EVAL ] assoc-map ; @@ -49,7 +49,7 @@ M: object eval-ast drop ; swapd [ over length cut [ zip ] dip ] dip [ swap 2array suffix ] [ drop ] if* >hashtable ; -GENERIC# apply 0 ( args fn -- maltype newenv/f ) +GENERIC: apply ( args fn -- maltype newenv/f ) M: malfn apply [ exprs>> nip ] diff --git a/impls/factor/step8_macros/step8_macros.factor b/impls/factor/step8_macros/step8_macros.factor index ef4bd07083..43c68e22a9 100755 --- a/impls/factor/step8_macros/step8_macros.factor +++ b/impls/factor/step8_macros/step8_macros.factor @@ -11,7 +11,7 @@ SYMBOL: repl-env DEFER: EVAL -GENERIC# eval-ast 1 ( ast env -- ast ) +GENERIC#: eval-ast 1 ( ast env -- ast ) M: malsymbol eval-ast env-get ; M: sequence eval-ast '[ _ EVAL ] map ; M: assoc eval-ast '[ _ EVAL ] assoc-map ; @@ -52,7 +52,7 @@ M: object eval-ast drop ; swapd [ over length cut [ zip ] dip ] dip [ swap 2array suffix ] [ drop ] if* >hashtable ; -GENERIC# apply 0 ( args fn -- maltype newenv/f ) +GENERIC: apply ( args fn -- maltype newenv/f ) M: malfn apply [ exprs>> nip ] diff --git a/impls/factor/step9_try/step9_try.factor b/impls/factor/step9_try/step9_try.factor index 490d1e3758..cea89708b9 100755 --- a/impls/factor/step9_try/step9_try.factor +++ b/impls/factor/step9_try/step9_try.factor @@ -11,7 +11,7 @@ SYMBOL: repl-env DEFER: EVAL -GENERIC# eval-ast 1 ( ast env -- ast ) +GENERIC#: eval-ast 1 ( ast env -- ast ) M: malsymbol eval-ast env-get ; M: sequence eval-ast '[ _ EVAL ] map ; M: assoc eval-ast '[ _ EVAL ] assoc-map ; @@ -63,7 +63,7 @@ M: object eval-ast drop ; swapd [ over length cut [ zip ] dip ] dip [ swap 2array suffix ] [ drop ] if* >hashtable ; -GENERIC# apply 0 ( args fn -- maltype newenv/f ) +GENERIC: apply ( args fn -- maltype newenv/f ) M: malfn apply [ exprs>> nip ] diff --git a/impls/factor/stepA_mal/stepA_mal.factor b/impls/factor/stepA_mal/stepA_mal.factor index 438111f5de..8bb3b0a45e 100755 --- a/impls/factor/stepA_mal/stepA_mal.factor +++ b/impls/factor/stepA_mal/stepA_mal.factor @@ -11,7 +11,7 @@ SYMBOL: repl-env DEFER: EVAL -GENERIC# eval-ast 1 ( ast env -- ast ) +GENERIC#: eval-ast 1 ( ast env -- ast ) M: malsymbol eval-ast env-get ; M: sequence eval-ast '[ _ EVAL ] map ; M: assoc eval-ast '[ _ EVAL ] assoc-map ; @@ -63,7 +63,7 @@ M: object eval-ast drop ; swapd [ over length cut [ zip ] dip ] dip [ swap 2array suffix ] [ drop ] if* >hashtable ; -GENERIC# apply 0 ( args fn -- maltype newenv/f ) +GENERIC: apply ( args fn -- maltype newenv/f ) M: malfn apply [ exprs>> nip ] diff --git a/impls/fsharp/Dockerfile b/impls/fsharp/Dockerfile index 01cf8044c7..5b51faad9a 100644 --- a/impls/fsharp/Dockerfile +++ b/impls/fsharp/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,7 +19,4 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# Deps for Mono-based languages (C#, VB.Net) -RUN apt-get -y install mono-runtime mono-mcs mono-vbnc mono-devel - RUN apt-get -y install fsharp diff --git a/impls/gnu-smalltalk/Dockerfile b/impls/gnu-smalltalk/Dockerfile index 81b7cebc03..d48238b785 100644 --- a/impls/gnu-smalltalk/Dockerfile +++ b/impls/gnu-smalltalk/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:wily +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,6 +19,4 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# picolisp -RUN apt-get -y install gnu-smalltalk - +RUN apt-get -y install gnu-smalltalk libreadline-dev diff --git a/impls/go/Dockerfile b/impls/go/Dockerfile index 2be2be3f8a..02083089bb 100644 --- a/impls/go/Dockerfile +++ b/impls/go/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:xenial +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,8 +19,4 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# Install g++ for any C/C++ based implementations -RUN apt-get -y install g++ - -RUN apt-get -y install pkg-config -RUN apt-get -y install golang +RUN apt-get -y install g++ golang libedit-dev pkg-config diff --git a/impls/groovy/Dockerfile b/impls/groovy/Dockerfile index 196698ab78..fc18e61d70 100644 --- a/impls/groovy/Dockerfile +++ b/impls/groovy/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,10 +19,4 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# Java and Groovy -RUN apt-get -y install openjdk-7-jdk -#RUN apt-get -y install maven2 -#ENV MAVEN_OPTS -Duser.home=/mal -RUN apt-get -y install ant - RUN apt-get -y install groovy diff --git a/impls/guile/Dockerfile b/impls/guile/Dockerfile index 0b4ae22bc3..60f3aef303 100644 --- a/impls/guile/Dockerfile +++ b/impls/guile/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -22,12 +20,4 @@ WORKDIR /mal ########################################################## # Guile -RUN apt-get -y install libunistring-dev libgc-dev autoconf libtool flex gettext texinfo libgmp-dev -RUN apt-get -y install git pkg-config libffi-dev -# TODO: remove /tmp/guile in same command -RUN git clone git://git.sv.gnu.org/guile.git /tmp/guile \ - && cd /tmp/guile && ./autogen.sh && ./configure && make && make install -RUN ldconfig -# TODO: move this up with other deps -RUN apt-get -y install libpcre3 libpcre3-dev - +RUN apt-get -y install guile-3.0 libpcre3-dev diff --git a/impls/haskell/Dockerfile b/impls/haskell/Dockerfile index 73650f205a..bfcfe90e33 100644 --- a/impls/haskell/Dockerfile +++ b/impls/haskell/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:wily +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,15 +19,5 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# Haskell -RUN apt-get install -y software-properties-common && \ - add-apt-repository -y ppa:hvr/ghc && \ - apt-get update && \ - apt-get install -y cabal-install-1.22 ghc-7.10.3 - -ENV PATH /opt/cabal/1.22/bin:/opt/ghc/7.10.3/bin:$PATH - -RUN cabal update && cabal install --global readline -# TODO: editline when compile bug fixed -RUN cabal install --global parsec - +RUN apt-get -y install make python +apt-get install -y ghc libghc-readline-dev diff --git a/impls/haxe/Dockerfile b/impls/haxe/Dockerfile index a0b55723c8..daa3e9bea8 100644 --- a/impls/haxe/Dockerfile +++ b/impls/haxe/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,33 +19,12 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -### -# Node - -# For building node modules -RUN apt-get -y install g++ - -# Add nodesource apt repo config for 10.x stable -RUN apt-get -y install gnupg -RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - - -# Install nodejs -RUN apt-get -y install nodejs - -ENV NPM_CONFIG_CACHE /mal/.npm - - -### # Haxe +RUN apt-get -y install g++ haxe libreadline-dev npm -RUN apt-get -y install software-properties-common && \ - add-apt-repository -y ppa:haxe/releases && \ - apt-get -y update - +ENV NPM_CONFIG_CACHE /mal/.npm ENV HOME / -RUN apt-get install -y haxe && \ - mkdir /haxelib && haxelib setup /haxelib +RUN mkdir /haxelib && haxelib setup /haxelib # Install support for C++ compilation RUN haxelib install hxcpp - diff --git a/impls/java/Dockerfile b/impls/java/Dockerfile index 7c9fdd4aea..a19397a0ac 100644 --- a/impls/java/Dockerfile +++ b/impls/java/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:xenial +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -22,7 +20,5 @@ WORKDIR /mal ########################################################## # Java and maven -RUN apt-get -y install openjdk-8-jdk -RUN apt-get -y install maven +RUN apt-get -y install default-jdk-headless maven ENV MAVEN_OPTS -Duser.home=/mal - diff --git a/impls/js/Dockerfile b/impls/js/Dockerfile index f7677e91c8..0815fd3f2f 100644 --- a/impls/js/Dockerfile +++ b/impls/js/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,14 +19,6 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# For building node modules -RUN apt-get -y install g++ - -# Add nodesource apt repo config for 10.x stable -RUN apt-get -y install gnupg -RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - - -# Install nodejs -RUN apt-get -y install nodejs +RUN apt-get -y install g++ libreadline-dev nodejs npm ENV NPM_CONFIG_CACHE /mal/.npm diff --git a/impls/logo/Dockerfile b/impls/logo/Dockerfile index c9ca5c27f7..dd58217306 100644 --- a/impls/logo/Dockerfile +++ b/impls/logo/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,29 +19,24 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# Install g++ for any C/C++ based implementations -RUN apt-get -y install g++ - -# Install UCBLogo 6.0: -# * Fix the makefile to build correctly -# * Tweat GC settings to improve performance (it's still very slow) +# Rebuild ucblogo. +# * without X libraries so that the executable starts in text mode. # * Add the timems function implemented in C -RUN apt-get -y install libx11-dev \ - && cd /tmp \ - && curl -O -J -L http://www.cs.berkeley.edu/~bh/downloads/ucblogo.tar.gz \ - && tar xf ucblogo.tar.gz \ - && cd /tmp/ucblogo-6.0 \ - && rm -rf csls/CVS \ - && ./configure \ - && sed -i -e 's/svnversion/echo 206/' -e 's/^\s*(cd docs/#\0/' makefile \ - && echo "all: everything" >> makefile \ - && sed -i -e 's/^#define *SEG_SIZE *16000 /#define SEG_SIZE 6400000 /' logo.h \ - && sed -i -e 's/^#define GCMAX 16000$/#define GCMAX 16000000/' mem.c \ + +RUN echo 'deb-src http://deb.debian.org/debian stable main' > /etc/apt/sources.list.d/logo.list +RUN apt -y update +RUN apt -y install autoconf autoconf-archive automake dpkg-dev g++ libncurses-dev + +RUN cd /tmp \ + && apt source ucblogo \ + && cd /tmp/ucblogo-* \ + && autoreconf -f -i \ + && ./configure --disable-docs --disable-x11 \ && echo "extern NODE *ltimems(NODE *);" >> globals.h \ && echo "NODE *ltimems(NODE *args) { struct timeval tv; gettimeofday(&tv, NULL); return(make_floatnode(((FLONUM)tv.tv_sec) * 1000.0 + (tv.tv_usec / 1000))); }" >> coms.c \ && sed -i -e 's/^\(.*lthrow.*\)$/\1 {"timems", 0, 0, 0, PREFIX_PRIORITY, ltimems},/' init.c \ && make install \ && cd /tmp \ - && rm -rf /tmp/ucblogo.tar.gz /tmp/ucblogo-6.0 + && rm -rf /tmp/ucblogo* ENV HOME /mal diff --git a/impls/logo/run b/impls/logo/run index 5d90e8a7ab..b1e12231fc 100755 --- a/impls/logo/run +++ b/impls/logo/run @@ -1,2 +1,2 @@ #!/bin/bash -exec logo $(dirname $0)/${STEP:-stepA_mal}.lg - "${@}" +exec ucblogo $(dirname $0)/${STEP:-stepA_mal}.lg - "${@}" diff --git a/impls/make/Dockerfile b/impls/make/Dockerfile index 5f61062ee3..41ff17169d 100644 --- a/impls/make/Dockerfile +++ b/impls/make/Dockerfile @@ -11,9 +11,6 @@ RUN apt-get -y update # Required for running tests RUN apt-get -y install make python -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev - RUN mkdir -p /mal WORKDIR /mal diff --git a/impls/miniMAL/Dockerfile b/impls/miniMAL/Dockerfile index fa54933ccb..7842261250 100644 --- a/impls/miniMAL/Dockerfile +++ b/impls/miniMAL/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,17 +19,5 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# For building node modules -RUN apt-get -y install g++ - -# Add nodesource apt repo config for 10.x stable -RUN apt-get -y install gnupg -RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - - -# Install nodejs -RUN apt-get -y install nodejs - -ENV NPM_CONFIG_CACHE /mal/.npm - -# install miniMAL +RUN apt-get -y install g++ libreadline-dev nodejs npm RUN npm install -g minimal-lisp diff --git a/impls/nasm/Dockerfile b/impls/nasm/Dockerfile index 29008471ee..2927d80c03 100644 --- a/impls/nasm/Dockerfile +++ b/impls/nasm/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:xenial +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -23,4 +21,3 @@ WORKDIR /mal # Install nasm and ld RUN apt-get -y install nasm binutils - diff --git a/impls/nim/Dockerfile b/impls/nim/Dockerfile index 6b30bad9a5..d25f78843e 100644 --- a/impls/nim/Dockerfile +++ b/impls/nim/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:bionic +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,15 +19,7 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# Install g++ for any C/C++ based implementations -RUN apt-get -y install g++ - # Nim -RUN apt-get -y install xz-utils -RUN cd /tmp && curl -O https://nim-lang.org/download/nim-1.0.4.tar.xz \ - && tar xvJf /tmp/nim-1.0.4.tar.xz && cd nim-1.0.4 \ - && make && sh install.sh /usr/local/bin \ - && cp bin/nim /usr/local/bin/ \ - && rm -r /tmp/nim-1.0.4 +RUN apt-get -y install gcc libc-dev libreadline-dev nim ENV HOME /mal diff --git a/impls/objpascal/Dockerfile b/impls/objpascal/Dockerfile index 31bb193b10..f49d343492 100644 --- a/impls/objpascal/Dockerfile +++ b/impls/objpascal/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -22,4 +20,4 @@ WORKDIR /mal ########################################################## # Free Pascal -RUN apt-get -y install libc6-dev fp-compiler +RUN apt-get -y install libc-dev fp-compiler libedit-dev diff --git a/impls/ocaml/Dockerfile b/impls/ocaml/Dockerfile index 399553dbc3..a8f448f46e 100644 --- a/impls/ocaml/Dockerfile +++ b/impls/ocaml/Dockerfile @@ -1,4 +1,4 @@ -[FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -22,4 +20,3 @@ WORKDIR /mal ########################################################## RUN apt-get -y install ocaml-batteries-included - diff --git a/impls/perl/Dockerfile b/impls/perl/Dockerfile index b36833e072..78dedbf843 100644 --- a/impls/perl/Dockerfile +++ b/impls/perl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,4 +19,4 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -RUN apt-get -y install perl libapp-fatpacker-perl +RUN apt-get -y install perl diff --git a/impls/perl6/Dockerfile b/impls/perl6/Dockerfile index ea081e882a..3bade4df13 100644 --- a/impls/perl6/Dockerfile +++ b/impls/perl6/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -22,13 +20,4 @@ WORKDIR /mal ########################################################## # Perl6 build deps -RUN apt-get -y install libfile-copy-recursive-perl build-essential git - -RUN curl -O http://rakudo.org/downloads/star/rakudo-star-2016.07.tar.gz && \ - tar xzf rakudo-star-2016.07.tar.gz && \ - cd rakudo-star-2016.07 && \ - perl Configure.pl --prefix=/usr --gen-moar --gen-nqp --backends=moar && \ - make && \ - make install && \ - cd .. && \ - rm -rf rakudo-star-2016.07* +RUN apt-get -y install rakudo diff --git a/impls/php/Dockerfile b/impls/php/Dockerfile index 87709d4d9a..eec64dd89d 100644 --- a/impls/php/Dockerfile +++ b/impls/php/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,4 +19,4 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -RUN apt-get -y install php5-cli +RUN apt-get -y install php-cli diff --git a/impls/picolisp/Dockerfile b/impls/picolisp/Dockerfile index 36282ddb5e..a461e039ed 100644 --- a/impls/picolisp/Dockerfile +++ b/impls/picolisp/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:wily +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -22,5 +20,4 @@ WORKDIR /mal ########################################################## # picolisp -RUN apt-get -y install picolisp - +RUN apt-get -y install picolisp libreadline-dev diff --git a/impls/pike/Dockerfile b/impls/pike/Dockerfile index 121d2e8b73..1d306c7eab 100644 --- a/impls/pike/Dockerfile +++ b/impls/pike/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,4 +19,4 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -RUN apt-get -y install pike8.0 pike8.0-pcre +RUN apt-get -y install pike8.0 diff --git a/impls/prolog/Dockerfile b/impls/prolog/Dockerfile index ead962ed50..985f4b438c 100644 --- a/impls/prolog/Dockerfile +++ b/impls/prolog/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,7 +9,8 @@ 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 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal diff --git a/impls/ps/Dockerfile b/impls/ps/Dockerfile index d91f68e1ea..7c41d1f942 100644 --- a/impls/ps/Dockerfile +++ b/impls/ps/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -11,9 +11,6 @@ RUN apt-get -y update # Required for running tests RUN apt-get -y install make python -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev - RUN mkdir -p /mal WORKDIR /mal diff --git a/impls/python/Dockerfile b/impls/python/Dockerfile index 3e64cc116c..ee4d7777e5 100644 --- a/impls/python/Dockerfile +++ b/impls/python/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,8 +19,7 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# Nothing additional needed for python -RUN apt-get -y install python3 +RUN apt-get -y install python2 # For dist packaging RUN apt-get -y install zip diff --git a/impls/r/Dockerfile b/impls/r/Dockerfile index 42611aeca2..72170c3beb 100644 --- a/impls/r/Dockerfile +++ b/impls/r/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,4 +19,4 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -RUN apt-get -y install r-base-core +RUN apt-get -y install curl gcc libc-dev libreadline-dev r-base-core diff --git a/impls/racket/Dockerfile b/impls/racket/Dockerfile index 1b05ee258b..d2dedd9451 100644 --- a/impls/racket/Dockerfile +++ b/impls/racket/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -22,4 +20,4 @@ WORKDIR /mal ########################################################## # Racket -RUN apt-get -y install racket +RUN apt-get -y install libedit-dev racket diff --git a/impls/ruby/Dockerfile b/impls/ruby/Dockerfile index 3bda3bf706..b5bb496972 100644 --- a/impls/ruby/Dockerfile +++ b/impls/ruby/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal diff --git a/impls/rust/Dockerfile b/impls/rust/Dockerfile index 661df9e6ce..b132f22111 100644 --- a/impls/rust/Dockerfile +++ b/impls/rust/Dockerfile @@ -1,5 +1,24 @@ -FROM rust:1.38.0 +FROM ubuntu:20.04 +MAINTAINER Joel Martin -ENV CARGO_HOME /mal +########################################################## +# General requirements for testing or common across many +# implementations +########################################################## + +RUN apt-get -y update +# Required for running tests +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python + +RUN mkdir -p /mal WORKDIR /mal + +########################################################## +# Specific implementation requirements +########################################################## + +RUN apt-get -y install cargo + +ENV CARGO_HOME /mal diff --git a/impls/skew/Dockerfile b/impls/skew/Dockerfile index 8e689fdadb..b3c85410c2 100644 --- a/impls/skew/Dockerfile +++ b/impls/skew/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,17 +19,7 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# For building node modules -RUN apt-get -y install g++ - -# Add nodesource apt repo config for 0.12 stable -RUN curl -sL https://deb.nodesource.com/setup_0.12 | bash - - -# Install nodejs -RUN apt-get -y install nodejs - -# Link common name -RUN ln -sf nodejs /usr/bin/node +RUN apt-get -y install npm ENV NPM_CONFIG_CACHE /mal/.npm diff --git a/impls/sml/Dockerfile b/impls/sml/Dockerfile index 36a2c90bf2..72a3adca9c 100644 --- a/impls/sml/Dockerfile +++ b/impls/sml/Dockerfile @@ -7,12 +7,8 @@ FROM ubuntu:focal ########################################################## RUN apt-get -y update - -# Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -s /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal diff --git a/impls/tcl/Dockerfile b/impls/tcl/Dockerfile index 2ad3f330c3..f1098d5eaa 100644 --- a/impls/tcl/Dockerfile +++ b/impls/tcl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal diff --git a/impls/ts/Dockerfile b/impls/ts/Dockerfile index ae21ee02cf..5943c660a9 100644 --- a/impls/ts/Dockerfile +++ b/impls/ts/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,14 +19,6 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -# For building node modules -RUN apt-get -y install g++ - -# Add nodesource apt repo config for 10.x stable -RUN apt-get -y install gnupg -RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - - -# Install nodejs -RUN apt-get -y install nodejs +RUN apt-get -y install libreadline-dev nodejs npm ENV NPM_CONFIG_CACHE /mal/.npm diff --git a/impls/vhdl/Dockerfile b/impls/vhdl/Dockerfile index 6b841c0d2c..4eb39aec50 100644 --- a/impls/vhdl/Dockerfile +++ b/impls/vhdl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:14.04 +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,10 +19,6 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -RUN apt-get -y install software-properties-common && \ - apt-add-repository -y ppa:pgavin/ghdl && \ - apt-get update -y - -RUN apt-get -y install ghdl +RUN apt-get -y install gcc ghdl ghdl-gcc ENV HOME /mal diff --git a/impls/vimscript/Dockerfile b/impls/vimscript/Dockerfile index 35345f57fd..b54ae7d61a 100644 --- a/impls/vimscript/Dockerfile +++ b/impls/vimscript/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:vivid +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -22,13 +20,8 @@ WORKDIR /mal ########################################################## # To build the readline plugin -RUN apt-get -y install g++ - -# Vim 8.0 -RUN apt-get -y install bzip2 -RUN cd /tmp && curl -O ftp://ftp.vim.org/pub/vim/unix/vim-8.0.tar.bz2 \ - && tar xjf /tmp/vim-8.0.tar.bz2 \ - && cd vim80 && make && make install \ - && cd /tmp && rm -r /tmp/vim-8.0.tar.bz2 /tmp/vim80 +RUN apt-get -y install gcc libreadline-dev + +RUN apt-get -y install vim ENV HOME /mal diff --git a/impls/xslt/Dockerfile b/impls/xslt/Dockerfile index 4e94d7a62a..687fd84b87 100644 --- a/impls/xslt/Dockerfile +++ b/impls/xslt/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:bionic +FROM ubuntu:20.04 MAINTAINER Joel Martin ########################################################## @@ -9,25 +9,14 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev libpcre3-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal -######################################################### +########################################################## # Specific implementation requirements -######################################################### - -RUN apt-get -y install python3.8 openjdk-8-jre -RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 10 - -RUN curl https://repo1.maven.org/maven2/net/sf/saxon/Saxon-HE/9.9.1-6/Saxon-HE-9.9.1-6.jar -O - -RUN mv Saxon-HE-9.9.1-6.jar /bin/Saxon-HE-9.9.1-6.jar - -RUN echo -n "#!/bin/sh\njava -Xmx2G -cp /bin/Saxon-HE-9.9.1-6.jar net.sf.saxon.Transform \"\$@\"" > /usr/bin/saxon && chmod +x /usr/bin/saxon - +########################################################## +RUN apt-get -y install default-jdk-headless libsaxonhe-java diff --git a/impls/xslt/harness.py b/impls/xslt/harness.py deleted file mode 100644 index 72bf8d8835..0000000000 --- a/impls/xslt/harness.py +++ /dev/null @@ -1,153 +0,0 @@ -import time -import os -import readline -import sys -import xml.etree.ElementTree as ET -from threading import Thread -from threading import Lock -from collections import deque - -fname = sys.argv[1] -args = sys.argv[2:] -tree = ET.Element('mal') - -if len(args) > 0: - args0 = args[0] - ET.SubElement(tree, 'argv') - for a in tree.iter('mal'): - for a in a.iter('argv'): - for arg in args[1:]: - ET.SubElement(a, 'arg').text = arg - ET.SubElement(tree, 'no_repl') - -tree = ET.ElementTree(tree) -stdout = sys.stdout - -try: - readline.read_history_file('.xslt_mal_history') -except: - pass - -HALT = False -THE_PID = None -init_t = time.time() * 1000 -readline_queue = deque() -os.system('rm -rf xsl_error.xml') -os.system('mkfifo xsl_error.xml') - -def setup_request_file(): - os.system('rm -rf xsl_input-string') - os.system('mkfifo xsl_input-string') - - -def get_one(fd): - s = b"" - while True: - x = os.read(fd, 1) - if x == b'\n': - break - if x == b'': - break - s += x - if s == "": - return None - return s.decode('utf-8') - - -def serve_one_request(res): - global HALT - if len(res) == 0: - return - try: - xtree = ET.fromstring("" + res.strip('\x00') + "") - # stdout.write(xtree.attrib['kind']) - for req in xtree: - if req.attrib['kind'] == 'readline': - x = None - if len(readline_queue) > 0: - x = readline_queue.popleft() - else: - x = input(req.attrib['value']) - with open('xsl_input-string', 'w') as fx: - fx.write(x) - # stdout.write(' = ' + x) - elif req.attrib['kind'] == 'halt': - HALT = True - elif req.attrib['kind'] == 'display': - stdout.write(req.attrib['value'] + '\n') - elif req.attrib['kind'] == 'time': - x = time.time() * 1000 - init_t - # stdout.write(' = ' + str(int(x))) - with open('xsl_input-string', 'w') as fx: - fx.write(str(int(x))) - # stdout.write('\n') - elif req.attrib['kind'] == 'xpath-eval': - xpath = req.attrib['value'] - with open('xsl-eval.xslt', 'w') as f: - f.write(f'') - with open('xsl-null.xml', 'w') as f: - f.write(req.attrib['context']) - - if os.system(f'saxon -xsl:xsl-eval.xslt -s:xsl-null.xml > xsl-eval_output.xml'): - x = '' - else: - with open('xsl-eval_output.xml', 'r') as f: - x = f.read() - with open('xsl_input-string', 'w') as fx: - fx.write(x) - else: - stdout.write("UNKNOWN REQUEST " + req.attrib['kind']) - # stdout.write('\n') - except Exception as e: - # if str(e) != 'no element found: line 1, column 0': - # f.seek(0) - # print(e, list(x for x in f.read())) - return - # with open('xsl_error.xml', 'w') as f: - # f.write('') - -def transform(do_print=True): - global tree, HALT, THE_PID - - tree.write('xslt_input.xml') - setup_request_file() - pid = os.fork() - if pid == 0: - os.system(f'saxon -xsl:"{fname}" -s:xslt_input.xml -TP:perf.html > xslt_output.xml 2> xsl_error.xml') - HALT = True - else: - THE_PID = pid - fd = os.open('xsl_error.xml', os.O_RDONLY | os.O_CLOEXEC) - while True: - try: - if HALT: - os.kill(THE_PID, 9) - raise KeyboardInterrupt() - cmd = get_one(fd) - if cmd: - serve_one_request(cmd) - except KeyboardInterrupt: - exit() - except Exception as e: - print("Harness error:", e) - tree = ET.parse('xslt_output.xml') - if do_print: - stdout = '' - for a in tree.iter('mal'): - for a in a.iter('stdout'): - stdout = a - print(stdout.text) - stdout.clear() - del stdout - - -if len(args) > 0: - readline_queue.append(f'(do (load-file "{args0}") (xslt-halt))') - transform(do_print=False) -else: - if fname == 'stepA_mal.xslt': - readline_queue.append('(println (str "Mal [" *host-language* "]"))') - transform(do_print=False) - else: - transform() - readline.write_history_file('.xslt_mal_history') diff --git a/impls/xslt/run b/impls/xslt/run index 41f549b5bd..3d3625f34c 100755 --- a/impls/xslt/run +++ b/impls/xslt/run @@ -1,2 +1,161 @@ -#!/bin/bash -exec python harness.py $(dirname $0)/${STEP:-stepA_mal}.xslt "${@}" +#!/usr/bin/python3 + +import time +import os.path +import readline +import sys +import xml.etree.ElementTree as ET +from threading import Thread +from threading import Lock +from collections import deque + +saxon_jar = '/usr/share/java/Saxon-HE-*.jar' +saxon = f'java -Xmx2G -cp {saxon_jar} net.sf.saxon.Transform' + +step_dir = os.path.dirname(sys.argv[0]) +step_base = os.getenv(key='STEP', default='stepA_mal') +fname = os.path.join(step_dir, step_base + '.xslt') + +args = sys.argv[1:] +tree = ET.Element('mal') + +if len(args) > 0: + args0 = args[0] + ET.SubElement(tree, 'argv') + for a in tree.iter('mal'): + for a in a.iter('argv'): + for arg in args[1:]: + ET.SubElement(a, 'arg').text = arg + ET.SubElement(tree, 'no_repl') + +tree = ET.ElementTree(tree) +stdout = sys.stdout + +try: + readline.read_history_file('.xslt_mal_history') +except: + pass + +HALT = False +THE_PID = None +init_t = time.time() * 1000 +readline_queue = deque() +os.system('rm -rf xsl_error.xml') +os.system('mkfifo xsl_error.xml') + +def setup_request_file(): + os.system('rm -rf xsl_input-string') + os.system('mkfifo xsl_input-string') + + +def get_one(fd): + s = b"" + while True: + x = os.read(fd, 1) + if x == b'\n': + break + if x == b'': + break + s += x + if s == "": + return None + return s.decode('utf-8') + + +def serve_one_request(res): + global HALT + if len(res) == 0: + return + try: + xtree = ET.fromstring("" + res.strip('\x00') + "") + # stdout.write(xtree.attrib['kind']) + for req in xtree: + if req.attrib['kind'] == 'readline': + x = None + if len(readline_queue) > 0: + x = readline_queue.popleft() + else: + x = input(req.attrib['value']) + with open('xsl_input-string', 'w') as fx: + fx.write(x) + # stdout.write(' = ' + x) + elif req.attrib['kind'] == 'halt': + HALT = True + elif req.attrib['kind'] == 'display': + stdout.write(req.attrib['value'] + '\n') + elif req.attrib['kind'] == 'time': + x = time.time() * 1000 - init_t + # stdout.write(' = ' + str(int(x))) + with open('xsl_input-string', 'w') as fx: + fx.write(str(int(x))) + # stdout.write('\n') + elif req.attrib['kind'] == 'xpath-eval': + xpath = req.attrib['value'] + with open('xsl-eval.xslt', 'w') as f: + f.write(f'') + with open('xsl-null.xml', 'w') as f: + f.write(req.attrib['context']) + + if os.system(f'{saxon} -xsl:xsl-eval.xslt -s:xsl-null.xml > xsl-eval_output.xml'): + x = '' + else: + with open('xsl-eval_output.xml', 'r') as f: + x = f.read() + with open('xsl_input-string', 'w') as fx: + fx.write(x) + else: + stdout.write("UNKNOWN REQUEST " + req.attrib['kind']) + # stdout.write('\n') + except Exception as e: + # if str(e) != 'no element found: line 1, column 0': + # f.seek(0) + # print(e, list(x for x in f.read())) + return + # with open('xsl_error.xml', 'w') as f: + # f.write('') + +def transform(do_print=True): + global tree, HALT, THE_PID + + tree.write('xslt_input.xml') + setup_request_file() + pid = os.fork() + if pid == 0: + os.system(f'{saxon} -xsl:"{fname}" -s:xslt_input.xml -TP:perf.html > xslt_output.xml 2> xsl_error.xml') + HALT = True + else: + THE_PID = pid + fd = os.open('xsl_error.xml', os.O_RDONLY | os.O_CLOEXEC) + while True: + try: + if HALT: + os.kill(THE_PID, 9) + raise KeyboardInterrupt() + cmd = get_one(fd) + if cmd: + serve_one_request(cmd) + except KeyboardInterrupt: + exit() + except Exception as e: + print("Harness error:", e) + tree = ET.parse('xslt_output.xml') + if do_print: + stdout = '' + for a in tree.iter('mal'): + for a in a.iter('stdout'): + stdout = a + print(stdout.text) + stdout.clear() + del stdout + + +if len(args) > 0: + readline_queue.append(f'(do (load-file "{args0}") (xslt-halt))') + transform(do_print=False) +else: + if fname == 'stepA_mal.xslt': + readline_queue.append('(println (str "Mal [" *host-language* "]"))') + transform(do_print=False) + else: + transform() + readline.write_history_file('.xslt_mal_history')