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-12-15 21:08:40 +03:00
function count_ext ( ) {
find $2 -name $1 -print | xargs sed '/^[[:space:]]*$/d' | wc -l | tr -d ' '
2023-07-27 18:57:20 +03:00
}
2024-05-22 13:26:51 +03:00
RUNTIME_C = $( count runtime/c/src/juvix)
2024-06-13 13:37:01 +03:00
RUNTIME_RUST = $( count runtime/rust/juvix/src)
2024-05-22 13:26:51 +03:00
RUNTIME_VAMPIR = $( count_ext '*.pir' runtime/vampir)
RUNTIME_JVT = $( count_ext '*.jvt' runtime/tree)
RUNTIME_CASM = $( count_ext '*.casm' runtime/casm)
2023-07-27 18:57:20 +03:00
2024-05-22 13:26:51 +03:00
RUNTIME = $(( RUNTIME_C+RUNTIME_RUST+RUNTIME_VAMPIR+RUNTIME_JVT+RUNTIME_CASM))
2023-01-17 17:32:05 +03:00
2023-05-19 15:43:45 +03:00
BACKENDC = $( count src/Juvix/Compiler/Backend/C/)
2024-05-29 14:34:04 +03:00
BACKENDRUST = $( count src/Juvix/Compiler/Backend/Rust/)
2024-01-12 14:57:02 +03:00
CAIRO = $( count src/Juvix/Compiler/Backend/Cairo/)
2023-05-19 15:43:45 +03:00
GEB = $( count src/Juvix/Compiler/Backend/Geb/)
VAMPIR = $( count src/Juvix/Compiler/Backend/VampIR/)
2024-01-12 14:57:02 +03:00
CASM = $( count src/Juvix/Compiler/Casm/)
2024-01-11 15:04:38 +03:00
NOCK = $( count src/Juvix/Compiler/Nockma)
2023-05-19 15:43:45 +03:00
REG = $( count src/Juvix/Compiler/Reg/)
ASM = $( count src/Juvix/Compiler/Asm/)
2024-01-24 14:45:39 +03:00
TREE = $( count src/Juvix/Compiler/Tree/)
2023-05-19 15:43:45 +03:00
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/)
2024-06-05 13:23:24 +03:00
MARKDOWN = $( count src/Juvix/Compiler/Backend/Markdown/)
ISABELLE = $( count src/Juvix/Compiler/Backend/Isabelle/)
2023-05-19 15:43:45 +03:00
EXTRA = $( count src/Juvix/Extra/)
DATA = $( count src/Juvix/Data/)
PRELUDE = $( count src/Juvix/Prelude/)
2023-12-30 22:15:35 +03:00
STORE = $( count src/Juvix/Compiler/Store/)
2023-01-17 17:32:05 +03:00
2023-07-27 18:57:20 +03:00
FRONT = $(( CONCRETE + INTERNAL + BUILTINS + PIPELINE))
2024-05-29 14:34:04 +03:00
BACK = $(( BACKENDC + BACKENDRUST + GEB + VAMPIR + NOCK + REG + ASM + TREE + CORE + CASM + CAIRO))
2024-06-05 13:23:24 +03:00
OTHER = $(( APP + STORE + HTML + MARKDOWN + ISABELLE + 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 "
2024-05-29 14:34:04 +03:00
echo " Rust backend: $BACKENDRUST LOC "
2024-01-12 14:57:02 +03:00
echo " Cairo backend: $(( CASM + CAIRO)) LOC "
echo " Nockma backend: $NOCK LOC "
2023-01-17 17:32:05 +03:00
echo " JuvixReg: $REG LOC "
echo " JuvixAsm: $ASM LOC "
2024-01-24 14:45:39 +03:00
echo " JuvixTree: $TREE LOC "
2023-01-17 17:32:05 +03:00
echo " JuvixCore: $CORE LOC "
echo " Runtime: $RUNTIME LOC "
2023-07-27 18:57:20 +03:00
echo " C runtime: $RUNTIME_C LOC "
2024-05-22 13:26:51 +03:00
echo " Rust runtime: $RUNTIME_RUST LOC "
2024-01-30 18:46:10 +03:00
echo " JuvixTree runtime: $RUNTIME_JVT LOC "
2024-03-20 14:14:12 +03:00
echo " Cairo assembly runtime: $RUNTIME_CASM LOC "
2023-07-27 18:57:20 +03:00
echo " VampIR runtime: $RUNTIME_VAMPIR LOC "
2023-01-17 17:32:05 +03:00
echo " Other: $OTHER LOC "
echo " Application: $APP LOC "
2023-12-30 22:15:35 +03:00
echo " Store: $STORE LOC "
2023-01-17 17:32:05 +03:00
echo " Html: $HTML LOC "
2024-06-05 13:23:24 +03:00
echo " Markdown: $MARKDOWN LOC "
echo " Isabelle: $ISABELLE LOC "
2023-01-17 17:32:05 +03:00
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 ""
2024-05-22 13:26:51 +03:00
echo " Total: $TOTAL Haskell LOC + $RUNTIME_C C LOC + $RUNTIME_RUST Rust LOC + $RUNTIME_JVT JuvixTree LOC + $RUNTIME_CASM CASM LOC + $RUNTIME_VAMPIR VampIR LOC "