38 lines
814 B
Bash
Executable File
38 lines
814 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Exit on error
|
|
set -e
|
|
|
|
# Check if a filename was provided
|
|
if [ "$#" -ne 1 ]; then
|
|
echo "Usage: $0 <filename_without_extension>"
|
|
exit 1
|
|
fi
|
|
|
|
FILENAME=$1
|
|
|
|
# Function to print section headers
|
|
print_section() {
|
|
printf '\n\e[1;34m%s\e[0m\n' "$1"
|
|
}
|
|
|
|
# Unfair LuaJIT Implementation
|
|
print_section "Lua ($FILENAME.lua)"
|
|
echo "test input" | time luajit "$FILENAME.lua"
|
|
|
|
# Lua Implementation
|
|
print_section "Lua ($FILENAME.lua)"
|
|
echo "test input" | time lua "$FILENAME.lua"
|
|
|
|
# Perl Implementation
|
|
print_section "Perl ($FILENAME.pl)"
|
|
echo "test input" | time perl "$FILENAME.pl"
|
|
|
|
# Python Implementation
|
|
print_section "Python ($FILENAME.py)"
|
|
echo "test input" | time python3 "$FILENAME.py"
|
|
|
|
# ZRE Implementation
|
|
print_section "zre ($FILENAME.zre)"
|
|
echo "test input" | time ../../src/zre "$FILENAME.zre"
|