mirror of
https://github.com/anoma/juvix.git
synced 2024-08-17 04:01:05 +03:00
* Closes #2392 Changes checklist ----------------- * [X] Abstract out data types for stored module representation (`ModuleInfo` in `Juvix.Compiler.Store.Language`) * [X] Adapt the parser to operate per-module * [X] Adapt the scoper to operate per-module * [X] Adapt the arity checker to operate per-module * [X] Adapt the type checker to operate per-module * [x] Adapt Core transformations to operate per-module * [X] Adapt the pipeline functions in `Juvix.Compiler.Pipeline` * [X] Add `Juvix.Compiler.Pipeline.Driver` which drives the per-module compilation process * [x] Implement module saving / loading in `Pipeline.Driver` * [x] Detect cyclic module dependencies in `Pipeline.Driver` * [x] Cache visited modules in memory in `Pipeline.Driver` to avoid excessive disk operations and repeated hash re-computations * [x] Recompile a module if one of its dependencies needs recompilation and contains functions that are always inlined. * [x] Fix identifier dependencies for mutual block creation in `Internal.fromConcrete` - Fixed by making textually later definitions depend on earlier ones. - Now instances are used for resolution only after the textual point of their definition. - Similarly, type synonyms will be unfolded only after the textual point of their definition. * [x] Fix CLI * [x] Fix REPL * [x] Fix highlighting * [x] Fix HTML generation * [x] Adapt test suite
69 lines
2.1 KiB
Bash
Executable File
69 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
function count() {
|
|
cloc $1 | grep 'SUM:' | awk '{print $5}'
|
|
}
|
|
|
|
function count_ext () {
|
|
find $2 -name $1 -print | xargs sed '/^[[:space:]]*$/d' | wc -l | tr -d ' '
|
|
}
|
|
|
|
RUNTIME_C=$(count runtime/src/juvix)
|
|
RUNTIME_VAMPIR=$(count_ext '*.pir' runtime/src/vampir)
|
|
RUNTIME_JVA=$(count_ext '*.jva' runtime/src/asm)
|
|
|
|
RUNTIME=$((RUNTIME_C+RUNTIME_VAMPIR+RUNTIME_JVA))
|
|
|
|
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/)
|
|
|
|
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/)
|
|
STORE=$(count src/Juvix/Compiler/Store/)
|
|
|
|
FRONT=$((CONCRETE + INTERNAL + BUILTINS + PIPELINE))
|
|
BACK=$((BACKENDC + GEB + VAMPIR + REG + ASM + CORE))
|
|
OTHER=$((APP + STORE + HTML + EXTRA + DATA + PRELUDE))
|
|
TESTS=$(count test/)
|
|
|
|
TOTAL=$((FRONT+BACK+OTHER+TESTS))
|
|
|
|
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"
|
|
echo " VampIR backend: $VAMPIR LOC"
|
|
echo " GEB backend: $GEB LOC"
|
|
echo " C backend: $BACKENDC LOC"
|
|
echo " JuvixReg: $REG LOC"
|
|
echo " JuvixAsm: $ASM LOC"
|
|
echo " JuvixCore: $CORE LOC"
|
|
echo "Runtime: $RUNTIME LOC"
|
|
echo " C runtime: $RUNTIME_C LOC"
|
|
echo " JuvixAsm runtime: $RUNTIME_JVA LOC"
|
|
echo " VampIR runtime: $RUNTIME_VAMPIR LOC"
|
|
echo "Other: $OTHER LOC"
|
|
echo " Application: $APP LOC"
|
|
echo " Store: $STORE LOC"
|
|
echo " Html: $HTML LOC"
|
|
echo " Extra: $EXTRA LOC"
|
|
echo " Data: $DATA LOC"
|
|
echo " Prelude: $PRELUDE LOC"
|
|
echo "Tests: $TESTS LOC"
|
|
echo ""
|
|
echo "Total: $TOTAL Haskell LOC + $RUNTIME_C C LOC + $RUNTIME_JVA JuvixAsm LOC + $RUNTIME_VAMPIR VampIR LOC"
|