diff --git a/lxc/execute b/lxc/execute index e19b9f4..de824e1 100755 --- a/lxc/execute +++ b/lxc/execute @@ -87,6 +87,9 @@ case "$lang" in "node" | "js" | "javascript") bin=node ;; +"deno" | "denojs" | "denots") + bin=deno + ;; "perl") bin=perl ;; @@ -117,6 +120,9 @@ case "$lang" in "typescript" | "ts") bin=typescript ;; +"haskell" | "hs") + bin=haskell + ;; *) echo "invalid language" exit diff --git a/lxc/executors/deno b/lxc/executors/deno new file mode 100644 index 0000000..76d65ae --- /dev/null +++ b/lxc/executors/deno @@ -0,0 +1,7 @@ +cd /tmp/$2 + +if [[ -z $(grep '[^[:space:]]' args.args) ]]; then + runuser runner$1 -c "cd /tmp/$2 ; timeout -s KILL 3 deno code.code" +else + runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 deno code.code" +fi \ No newline at end of file diff --git a/lxc/executors/haskell b/lxc/executors/haskell new file mode 100644 index 0000000..d2902b1 --- /dev/null +++ b/lxc/executors/haskell @@ -0,0 +1,3 @@ +cd /tmp/$2 +timeout -s KILL 10 ghc -dynamic -o binary code.code +runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary" diff --git a/lxc/test_all_lxc b/lxc/test_all_lxc index dd7453f..1641e41 100755 --- a/lxc/test_all_lxc +++ b/lxc/test_all_lxc @@ -45,3 +45,9 @@ echo 'testing python2' ../execute python2 test2.py echo 'testing python3' ../execute python3 test3.py +echo 'testing haskell' +../execute haskell test.hs +echo 'testing deno js' +../execute deno testdeno.js +echo 'testing deno ts' +../execute deno testdeno.ts diff --git a/lxc/tests/test.hs b/lxc/tests/test.hs new file mode 100644 index 0000000..2d96bbc --- /dev/null +++ b/lxc/tests/test.hs @@ -0,0 +1 @@ +main = putStrLn "Hello, World" diff --git a/lxc/tests/testdeno.js b/lxc/tests/testdeno.js new file mode 100644 index 0000000..847245f --- /dev/null +++ b/lxc/tests/testdeno.js @@ -0,0 +1 @@ +console.log('good') diff --git a/lxc/tests/testdeno.ts b/lxc/tests/testdeno.ts new file mode 100644 index 0000000..868450a --- /dev/null +++ b/lxc/tests/testdeno.ts @@ -0,0 +1 @@ +console.log('good') \ No newline at end of file diff --git a/lxc/versions b/lxc/versions index 1e36ea3..d3c6318 100755 --- a/lxc/versions +++ b/lxc/versions @@ -66,3 +66,9 @@ echo '---' echo 'typescript' lxc-attach --clear-env -n piston -- /bin/bash -l -c "tsc --version" echo '---' +echo 'haskell' +lxc-attach --clear-env -n piston -- /bin/bash -l -c "ghc --version" +echo '---' +echo 'deno' +lxc-attach --clear-env -n piston -- /bin/bash -l -c "deno --version" +echo '---' diff --git a/readme.md b/readme.md index b3bc4ca..f8e9962 100644 --- a/readme.md +++ b/readme.md @@ -54,7 +54,7 @@ apt-get update apt-get install -y \ nano wget build-essential pkg-config libxml2-dev \ libsqlite3-dev mono-complete curl cmake libpython2.7-dev \ - ruby libtinfo-dev + ruby libtinfo-dev unzip # install python2 # final binary: /opt/python2/Python-2.7.17/python @@ -218,6 +218,19 @@ make echo 'export PATH=$PATH:/opt/lua/lua54/src' >> /opt/.profile source /opt/.profile +# install haskell +# final binary: /usr/bin/ghc +# get version: /usr/bin/ghc --version +apt install -y ghc + +# install deno +# final binary: /opt/.deno/bin/deno +# get version: /opt/.deno/bin/deno --version +curl -fsSL https://deno.land/x/install/install.sh | sh +echo 'export DENO_INSTALL="/opt/.deno"' >> /opt/.profile +echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> /opt/.profile +source /opt/.profile + # create runnable users and apply limits for i in {1..150}; do useradd -M runner$i @@ -323,6 +336,7 @@ If an invalid language is supplied, a typical response will look like the follow - elixir - emacs - go +- haskell - java - julia - kotlin