Compare commits

...

7 Commits

Author SHA1 Message Date
Brian Seymour 6ff766d90b fix deno, fix clojure version, lolcode dynamic version 2021-03-12 14:12:25 -06:00
Brian Seymour 66a602038b specify m2 directory explicitly 2021-03-12 13:58:16 -06:00
Brian Seymour a2afccad26 add missing tests, give clojure more time 2021-03-12 13:33:17 -06:00
Brian Seymour 9f7d01bb18 add missing cd 2021-03-12 13:28:39 -06:00
Brian Seymour ed0a5c4f78 merge and add clojure 2021-03-12 13:27:06 -06:00
Brian Seymour fca3488743
Merge pull request #139 from Vrganj/add-lolcode
Add lolcode
2021-03-12 13:24:57 -06:00
Vrganj 14d1090daa Add lolcode 2021-03-12 20:18:43 +01:00
11 changed files with 69 additions and 2 deletions

View File

@ -22,6 +22,8 @@ const languages = require('../../config/languages.json');
versions[language] = /\d+/.exec(lines[1])?.[0];
} else if (language === 'emacs') {
versions[language] = /\d+\.\d+/.exec(lines[1])?.[0];
} else if (language === 'clojure') {
versions[language] = /\d+\.\d+\.\d+\.\d+/.exec(lines[1])?.[0];
} else {
versions[language] = /\d+\.\d+\.\d+/.exec(section)?.[0];
}

View File

@ -39,6 +39,13 @@
"c"
]
},
{
"name": "clojure",
"aliases": [
"clojure",
"clj"
]
},
{
"name": "crystal",
"aliases": [
@ -136,6 +143,12 @@
"java"
]
},
{
"name": "lolcode",
"aliases": [
"lolcode"
]
},
{
"name": "nim",
"aliases": [

View File

@ -284,7 +284,6 @@ MIX_ENV=prod mix escript.build --force
echo 'export PATH=$PATH:/opt/05AB1E/05AB1E' >> /opt/.profile
source /opt/.profile
# install prolog
# final binary: /opt/swipl/swipl-<version>/build/src/swipl
cd /opt && mkdir swipl && cd swipl
@ -300,6 +299,27 @@ ninja
echo "export PATH=\$PATH:/opt/swipl/$SUB_DIR/build/src" >> /opt/.profile
source /opt/.profile
# install lolcode
# final binary: /opt/lolcode/bin/lci
cd /opt
git clone https://github.com/justinmeza/lci.git lolcode
cd lolcode
mkdir bin
cd bin
cmake ..
make
echo 'export PATH=$PATH:/opt/lolcode/bin' >> /opt/.profile
source /opt/.profile
# install clojure
# final binary: /opt/clojure/bin/clojure
# get version: /opt/clojure/bin/clojure -version
cd /opt && mkdir clojure && cd clojure
curl -O https://download.clojure.org/install/linux-install-1.10.2.796.sh
chmod +x linux-install-1.10.2.796.sh
./linux-install-1.10.2.796.sh --prefix /opt/clojure
echo 'export PATH=$PATH:/opt/clojure/bin' >> /opt/.profile
# create runnable users and apply limits
for i in {1..150}; do
useradd -M runner$i

4
lxc/executors/clojure Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
cd /tmp/$1
timeout -s KILL 10 xargs -a args.args -d '\n' clojure -Sdeps '{:mvn/local-repo "/opt/.m2/repository"}' -M code.code < stdin.stdin

View File

@ -1,4 +1,5 @@
#!/bin/bash
cd /tmp/$1
timeout -s KILL 3 xargs -a args.args -d '\n' NO_COLOR=true deno run code.code < stdin.stdin
export NO_COLOR=true
timeout -s KILL 3 xargs -a args.args -d '\n' deno run code.code < stdin.stdin

4
lxc/executors/lolcode Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
cd /tmp/$1
timeout -s KILL 3 lci code.code < stdin.stdin

View File

@ -6,6 +6,8 @@ echo -n 'testing bash = '
../../cli/execute bash bash.sh
echo -n 'testing c = '
../../cli/execute c c.c
echo -n 'testing clojure = '
../../cli/execute clojure clojure.clj
echo -n 'testing cpp = '
../../cli/execute cpp cpp.cpp
echo -n 'testing crystal = '
@ -34,6 +36,8 @@ echo -n 'testing julia = '
../../cli/execute julia julia.jl
echo -n 'testing kotlin = '
../../cli/execute kotlin kotlin.kt
echo -n 'testing lolcode = '
../../cli/execute lolcode lolcode.lol
echo -n 'testing lisp = '
../../cli/execute lisp lisp.cl
echo -n 'testing nasm 32 bit = '

5
lxc/tests/clojure.clj Normal file
View File

@ -0,0 +1,5 @@
(ns clojure.examples.hello
(:gen-class))
(defn hello-world []
(println "good"))
(hello-world)

4
lxc/tests/lolcode.lol Normal file
View File

@ -0,0 +1,4 @@
HAI 1.2
CAN HAS STDIO?
VISIBLE "good"
KTHXBYE

View File

@ -21,6 +21,10 @@ echo 'cpp'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "g++ --version"
echo '---'
echo 'clojure'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "clojure -version"
echo '---'
echo 'crystal'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "crystal -v"
echo '---'
@ -77,6 +81,10 @@ echo 'lisp'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "sbcl --version"
echo '---'
echo 'lolcode'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "lci --version"
echo '---'
echo 'lua'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "lua -v"
echo '---'

View File

@ -260,6 +260,7 @@ Content-Type: application/json
`brainfuck`,
`c`,
`cpp`,
`clojure`,
`crystal`,
`csharp`,
`d`,
@ -275,6 +276,7 @@ Content-Type: application/json
`julia`,
`kotlin`,
`lisp`,
`lolcode`,
`lua`,
`nasm`,
`nasm64`,