2023-01-17 17:32:05 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-05-19 15:43:45 +03:00
|
|
|
function count() {
|
|
|
|
cloc $1 | grep 'SUM:' | awk '{print $5}'
|
|
|
|
}
|
2023-01-17 17:32:05 +03:00
|
|
|
|
2023-07-27 18:57:20 +03:00
|
|
|
function count_pir () {
|
|
|
|
find $1 -name '*.pir' -print | xargs sed '/^[[:space:]]*$/d' | wc -l | tr -d ' '
|
|
|
|
}
|
|
|
|
|
|
|
|
RUNTIME_C=$(count runtime/src/juvix)
|
|
|
|
RUNTIME_VAMPIR=$(count_pir runtime/src/vampir)
|
|
|
|
|
|
|
|
RUNTIME=$((RUNTIME_C+RUNTIME_VAMPIR))
|
2023-01-17 17:32:05 +03:00
|
|
|
|
2023-05-19 15:43:45 +03:00
|
|
|
BACKENDC=$(count src/Juvix/Compiler/Backend/C/)
|
|
|
|
GEB=$(count src/Juvix/Compiler/Backend/Geb/)
|
|
|
|
VAMPIR=$(count src/Juvix/Compiler/Backend/VampIR/)
|
|
|
|
REG=$(count src/Juvix/Compiler/Reg/)
|
|
|
|
ASM=$(count src/Juvix/Compiler/Asm/)
|
|
|
|
CORE=$(count src/Juvix/Compiler/Core/)
|
2023-01-17 17:32:05 +03:00
|
|
|
|
2023-05-19 15:43:45 +03:00
|
|
|
CONCRETE=$(count src/Juvix/Compiler/Concrete/)
|
|
|
|
INTERNAL=$(count src/Juvix/Compiler/Internal/)
|
|
|
|
BUILTINS=$(count src/Juvix/Compiler/Builtins/)
|
|
|
|
PIPELINE=$(count src/Juvix/Compiler/Pipeline/)
|
|
|
|
|
|
|
|
APP=$(count app/)
|
|
|
|
HTML=$(count src/Juvix/Compiler/Backend/Html/)
|
|
|
|
EXTRA=$(count src/Juvix/Extra/)
|
|
|
|
DATA=$(count src/Juvix/Data/)
|
|
|
|
PRELUDE=$(count src/Juvix/Prelude/)
|
2023-01-17 17:32:05 +03:00
|
|
|
|
2023-07-27 18:57:20 +03:00
|
|
|
FRONT=$((CONCRETE + INTERNAL + BUILTINS + PIPELINE))
|
2023-05-19 15:43:45 +03:00
|
|
|
BACK=$((BACKENDC + GEB + VAMPIR + REG + ASM + CORE))
|
2023-01-17 17:32:05 +03:00
|
|
|
OTHER=$((APP + HTML + EXTRA + DATA + PRELUDE))
|
2023-05-19 15:43:45 +03:00
|
|
|
TESTS=$(count test/)
|
2023-01-17 17:32:05 +03:00
|
|
|
|
2023-06-20 17:39:53 +03:00
|
|
|
TOTAL=$((FRONT+BACK+OTHER+TESTS))
|
|
|
|
|
2023-01-17 17:32:05 +03:00
|
|
|
echo "Front end: $FRONT LOC"
|
|
|
|
echo " Concrete: $CONCRETE LOC"
|
|
|
|
echo " Internal: $INTERNAL LOC"
|
|
|
|
echo " Builtins: $BUILTINS LOC"
|
|
|
|
echo " Pipeline: $PIPELINE LOC"
|
|
|
|
echo "Middle and back end: $BACK LOC"
|
2023-05-19 15:43:45 +03:00
|
|
|
echo " VampIR backend: $VAMPIR LOC"
|
2023-02-01 14:04:05 +03:00
|
|
|
echo " GEB backend: $GEB LOC"
|
2023-05-19 15:43:45 +03:00
|
|
|
echo " C backend: $BACKENDC LOC"
|
2023-01-17 17:32:05 +03:00
|
|
|
echo " JuvixReg: $REG LOC"
|
|
|
|
echo " JuvixAsm: $ASM LOC"
|
|
|
|
echo " JuvixCore: $CORE LOC"
|
|
|
|
echo "Runtime: $RUNTIME LOC"
|
2023-07-27 18:57:20 +03:00
|
|
|
echo " C runtime: $RUNTIME_C LOC"
|
|
|
|
echo " VampIR runtime: $RUNTIME_VAMPIR LOC"
|
2023-01-17 17:32:05 +03:00
|
|
|
echo "Other: $OTHER LOC"
|
|
|
|
echo " Application: $APP LOC"
|
|
|
|
echo " Html: $HTML LOC"
|
|
|
|
echo " Extra: $EXTRA LOC"
|
|
|
|
echo " Data: $DATA LOC"
|
|
|
|
echo " Prelude: $PRELUDE LOC"
|
2023-05-19 15:43:45 +03:00
|
|
|
echo "Tests: $TESTS LOC"
|
2023-06-20 17:39:53 +03:00
|
|
|
echo ""
|
2023-07-27 18:57:20 +03:00
|
|
|
echo "Total: $TOTAL Haskell LOC + $RUNTIME_C C LOC + $RUNTIME_VAMPIR VampIR LOC"
|