-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.sh
executable file
·49 lines (40 loc) · 1.18 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
echo "-= Compiling phase =-"
echo "Compiling C version..."
gcc -Wall ./ackermann.c -o ackermann-c
echo
echo "Compiling Go version..."
go build -o ackermann-go ./ackermann.go
echo
echo "Compiling Ocaml version..."
ocamlc ./ackermann.ml -o ackermann-ocaml
echo
echo "Compiling Haskell version..."
ghc ./ackermann.hs -o ackermann-haskell > /dev/null 2>&1
echo
echo "Compiling Python version..."
python -c "import ackermann"
mv ackermann.pyc ackermann-python.pyc
echo
echo "Compiling Pascal version..."
fpc -g ackermann.pas -oackermann-pascal> /dev/null 2>&1
echo
echo "-= Launching tests =-"
m=3
n=12
echo "C implementation:"
time ./ackermann-c $m $n
echo "------------------------------------------"
echo "Go implementation:"
time ./ackermann-go $m $n
echo "------------------------------------------"
echo "Pascal implementation:"
time ./ackermann-pascal $m $n
echo "------------------------------------------"
echo "OCaml implementation:"
time ./ackermann-ocaml $m $n
echo "------------------------------------------"
echo "Haskell implementation:"
time ./ackermann-haskell $m $n
echo "------------------------------------------"
echo "Python implementation:"
time python ackermann-python.pyc $m $n