Merge pull request #22 from ethancedwards8/deno_support
Deno and Haskell support
This commit is contained in:
commit
486c720868
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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"
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
main = putStrLn "Hello, World"
|
|
@ -0,0 +1 @@
|
|||
console.log('good')
|
|
@ -0,0 +1 @@
|
|||
console.log('good')
|
|
@ -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 '---'
|
||||
|
|
16
readme.md
16
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
|
||||
|
|
Loading…
Reference in New Issue