42 lines
		
	
	
		
			916 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			916 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"
 | 
						|
 | 
						|
# ZLC Implementation
 | 
						|
print_section "zlc ($FILENAME.zl)"
 | 
						|
 echo "test input" | time zlc "$FILENAME.zl"
 | 
						|
 | 
						|
# ZRE Implementation
 | 
						|
print_section "zre ($FILENAME.zrl)"
 | 
						|
 echo "test input" | time ../src/zre -t "$FILENAME.zrl"
 |