diff --git a/lxc/execute b/lxc/execute index 5e71f4a..9752781 100755 --- a/lxc/execute +++ b/lxc/execute @@ -120,6 +120,9 @@ case "$lang" in "emacs" | "elisp" | "el") bin=emacs ;; +"lisp" | "clisp" | "commonlisp" | "sbcl") + bin=sbcl + ;; "bash") bin=bash ;; diff --git a/lxc/executors/commonlisp b/lxc/executors/commonlisp new file mode 100755 index 0000000..1db1613 --- /dev/null +++ b/lxc/executors/commonlisp @@ -0,0 +1,8 @@ +cd /tmp/$2 + +if [[ -z $(grep '[^[:space:]]' args.args) ]]; then + runuser runner$1 -c "cd /tmp/$2 ; timeout -s KILL 3 sbcl --script code.code" +else + runuser runner$1 -c "cd /tmp/$2 ; cat args.args ; xargs -d '\n' timeout -s KILL 3 sbcl --script code.code" +fi + diff --git a/lxc/test_all_lxc b/lxc/test_all_lxc index f2068bd..fe079e5 100755 --- a/lxc/test_all_lxc +++ b/lxc/test_all_lxc @@ -49,3 +49,5 @@ echo 'testing python2' ../execute python2 test2.py echo 'testing python3' ../execute python3 test3.py +echo 'testing common lisp' +../execute sbcl --script test.cl diff --git a/lxc/tests/test.cl b/lxc/tests/test.cl new file mode 100755 index 0000000..e05c1c2 --- /dev/null +++ b/lxc/tests/test.cl @@ -0,0 +1 @@ +(write-line "hello world") diff --git a/lxc/versions b/lxc/versions index 830e69c..a63fa2d 100755 --- a/lxc/versions +++ b/lxc/versions @@ -100,3 +100,7 @@ echo '---' echo 'typescript' lxc-attach --clear-env -n piston -- /bin/bash -l -c "tsc --version" echo '---' + +echo 'common lisp' +lxc-attach --clear-env -n piston -- /bin/bash -l -c "sbcl --version" +echo '---' diff --git a/readme.md b/readme.md index 2f6c119..f02105b 100644 --- a/readme.md +++ b/readme.md @@ -240,6 +240,12 @@ echo 'export DENO_INSTALL="/opt/.deno"' >> /opt/.profile echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> /opt/.profile source /opt/.profile +# install common lisp +# final binary /usr/bin/sbcl +# get version: /usr/bin/sbcl --version +# important notice: use sbcl --script to run a clisp file, sbcl enters the REPL +apt install -y sbcl + # create runnable users and apply limits for i in {1..150}; do useradd -M runner$i