|
| 1 | +Codebase validated to work with |
| 2 | + |
| 3 | + scalaVersion := "3.6.4" |
| 4 | + |
1 | 5 | When you have a fresh clone of the git repository, enter the command `sbt compile` in the |
2 | 6 | top-level directory to compile EpCoGen. sbt will properly install all necessary software |
3 | 7 | libraries. |
4 | 8 |
|
5 | | -We have tested with sbt versions of 1.7.1, 1.9.8, and 1.10.7. |
| 9 | +We have tested with sbt versions of 1.7.1, 1.9.8, 1.10.7, and 1.10.11. |
| 10 | + |
| 11 | +We have tested with Java JDK 18. |
6 | 12 |
|
7 | 13 | If your Java version is too advanced for the sbt, you may need to add the |
8 | 14 | following to the build.st file to lower the associated Java version. |
9 | 15 |
|
10 | | - javacOptions ++= Seq("-source", "11", "-target", "11"), |
| 16 | + javacOptions ++= Seq("-source", "11", "-target", "11") |
11 | 17 |
|
12 | 18 | And then you can install an openJDK version of Java 11 and use it by setting JAVA_HOME |
13 | | -properly and/or configuring PATH variable appropriately. |
| 19 | +properly and/or configuring PATH variable appropriately. Grab the appropriate JDK 11 |
| 20 | +from https://www.openlogic.com/openjdk-downloads |
14 | 21 |
|
15 | 22 | =================================== |
16 | 23 | Examples to run |
17 | 24 | =================================== |
18 | 25 |
|
19 | | -Sample commands to run. The first column shows the time it was launched, so to generate all |
20 | | -evolution stages for all approaches on a Linux machine took just under an hour. And the |
21 | | -compiling process for all code took just about three hours. |
22 | | - |
23 | | -15:17 sbt language-java/run |
24 | | -16:08 cd target/ |
25 | | -16:09 cd ep-java |
26 | | -16:11 python3 ../../scripts/compare.py ../../scripts/systems/system-main.json >> REPORT |
27 | | -16:12 python3 ../../scripts/compile.py |
28 | | -19:08 python3 ../../scripts/process.py > STATISTICS |
29 | | -19:09 cd .. |
30 | | -19:11 sbt "helloWorld/runMain org.combinators.fibonacci.FibonacciWithLucasScalaDirectToDiskMain" |
31 | | -19:13 cd target/fib |
32 | | -19:13 cd scala/ |
33 | | -19:13 sbt test |
| 26 | +Sample commands to run. The first column shows the time to execute, so to generate all |
| 27 | +evolution stages for all approaches on a Linux machine took 22 minutes. The greatest |
| 28 | +cost is compiling everything. To compile the main example took about 2 hours since there |
| 29 | +are 27 evolutionary stages in the example. |
| 30 | + |
| 31 | +Time Command |
| 32 | +00:02 sbt compile |
| 33 | +00:22 sbt language-java/run |
34 | 34 |
|
| 35 | + cd target/ep-java |
| 36 | +00:01 python3 ../../scripts/compare.py ../../scripts/systems/system-main.json >> REPORT |
| 37 | +02:10 python3 ../../scripts/compile.py |
| 38 | + |
| 39 | +00:01 python3 ../../scripts/process.py > STATISTICS |
| 40 | + cd ../.. |
| 41 | + |
| 42 | +--------------------------------- |
| 43 | +Java Generation |
35 | 44 | --------------------------------- |
36 | 45 |
|
| 46 | +The above generates all subdirectories that can now be compiled: |
| 47 | + |
| 48 | +* D1D2 (to just generated this, execute `sbt "language-java/runMain org.combinators.ep.language.java.GenerateAllD1D2"`) |
| 49 | + |
| 50 | + cd target/ep-java-d1d2 |
| 51 | + python3 ../../scripts/compare.py ../../scripts/systems/system-d1d2.json >> REPORT |
| 52 | + python3 ../../scripts/compile.py |
| 53 | + python3 ../../scripts/process.py > STATISTICS |
| 54 | + |
| 55 | +* Main (to just generated this, execute `sbt "language-java/runMain org.combinators.ep.language.java.GenerateAllMain"`) |
| 56 | + |
| 57 | + cd target/ep-java |
| 58 | + python3 ../../scripts/compare.py ../../scripts/systems/system-main.json >> REPORT |
| 59 | + python3 ../../scripts/compile.py |
| 60 | + python3 ../../scripts/process.py > STATISTICS |
| 61 | + |
| 62 | +* Merging (to just generated this, execute `sbt "language-java/runMain org.combinators.ep.language.java.GenerateAllMerging"`) |
| 63 | + |
| 64 | + cd target/ep-java-merging |
| 65 | + python3 ../../scripts/compare.py ../../scripts/systems/system-merging.json >> REPORT |
| 66 | + python3 ../../scripts/compile.py |
| 67 | + python3 ../../scripts/process.py > STATISTICS |
| 68 | + |
| 69 | +* Extended (to just generated this, execute `sbt "language-java/runMain org.combinators.ep.language.java.GenerateAllExtended"`) |
| 70 | + |
| 71 | + cd target/ep-java-extended |
| 72 | + python3 ../../scripts/compare.py ../../scripts/systems/system-extended.json >> REPORT |
| 73 | + python3 ../../scripts/compile.py |
| 74 | + python3 ../../scripts/process.py > STATISTICS |
| 75 | + |
| 76 | +* Third Alternate (to just generated this, execute `sbt "language-java/runMain org.combinators.ep.language.java.GenerateAllThirdAlternate"`) |
| 77 | + |
| 78 | + cd target/ep-java-third-alternate |
| 79 | + python3 ../../scripts/compare.py ../../scripts/systems/system-third-alternate.json >> REPORT |
| 80 | + python3 ../../scripts/compile.py |
| 81 | + python3 ../../scripts/process.py > STATISTICS |
| 82 | + |
| 83 | +* System J (to just generated this, execute `sbt "language-java/runMain org.combinators.ep.language.java.GenerateAllJ"`) |
| 84 | + |
| 85 | + cd target/ep-java-j |
| 86 | + python3 ../../scripts/compare.py ../../scripts/systems/system-j.json >> REPORT |
| 87 | + python3 ../../scripts/compile.py |
| 88 | + python3 ../../scripts/process.py > STATISTICS |
| 89 | + |
| 90 | + |
37 | 91 | When generating the full Java implementations for all approaches and all evolution stages, |
38 | | -there are 19,842 Java files containing 513,094 total lines of code. |
| 92 | +there are 17,469 Java files containing 432,215 total lines of code. |
39 | 93 |
|
40 | 94 | Using the CLOC utility, a more accurate picture appears. Of these only 3890 are truly |
41 | 95 | unique files. The reason? Because the Expression Problem shows how to extend a system without |
42 | 96 | modifying already created code, so it makes perfect sense that 80% of the code is duplicated! |
43 | 97 |
|
44 | 98 | % $CLOC --csv `find . -name "*.java"` |
45 | 99 |
|
46 | | - 19842 text files. |
47 | | - 3890 unique files. |
48 | | - 15952 files ignored. |
| 100 | + 17429 text files. |
| 101 | + 3279 unique files. |
| 102 | + 14150 files ignored. |
49 | 103 |
|
50 | | -files,language,blank,comment,code,"github.com/AlDanial/cloc v 1.86 T=17.31 s (224.7 files/s, 7917.7 lines/s)" |
51 | | -3890,Java,27755,4,109292 |
52 | | -3890,SUM,27755,4,109292 |
| 104 | +files,language,blank,comment,code,"github.com/AlDanial/cloc v 1.86 T=21.67 s (151.3 files/s, 4895.7 lines/s)" |
| 105 | +3279,Java,22368,4,83739 |
| 106 | +3279,SUM,22368,4,83739 |
53 | 107 |
|
54 | | -cloc reports 109,292 lines of code. |
| 108 | +cloc reports 83,739 lines of code. |
55 | 109 |
|
56 | 110 | Now run and turn off the uniqueness check: |
57 | 111 |
|
58 | 112 | % $CLOC --csv `find . -name "*.java"` --skip-uniqueness |
59 | 113 |
|
60 | | -19842,Java,117328,516,395250 |
| 114 | +17429,Java,101632,420,327068 |
61 | 115 |
|
62 | 116 | This reveals that 395,250 lines of Java code were generated. |
63 | 117 |
|
| 118 | +--------------------------------- |
| 119 | +ScalaGeneration |
| 120 | +--------------------------------- |
| 121 | +sbt "language-newScala/runMain org.combinators.ep.language.scala.codegen.GenerateAllJ" |
| 122 | +sbt "language-newScala/runMain org.combinators.ep.language.scala.codegen.GenerateAllD1D2" |
| 123 | +sbt "language-newScala/runMain org.combinators.ep.language.scala.codegen.GenerateAllMain" |
| 124 | +sbt "language-newScala/runMain org.combinators.ep.language.scala.codegen.GenerateAllMerging" |
| 125 | +sbt "language-newScala/runMain org.combinators.ep.language.scala.codegen.GenerateAllExtended" |
| 126 | + |
| 127 | +% $CLOC --csv `find ep-scala -name "*.scala"` `find ep-scala-d1d2 -name "*.scala"` `find ep-scala-extended -name "*.scala"` `find ep-scala-j -name "*.scala"` `find ep-scala-merging -name "*.scala"` |
| 128 | + |
| 129 | + 16770 text files. |
| 130 | + 12217 unique files. |
| 131 | + 4553 files ignored. |
64 | 132 |
|
| 133 | +files,language,blank,comment,code,"github.com/AlDanial/cloc v 1.86 T=31.21 s (391.5 files/s, 14591.1 lines/s)" |
| 134 | +12217,Scala,242004,0,213356 |
| 135 | +12217,SUM,242004,0,213356 |
0 commit comments