ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
Java 1Java 2LispRustDartJulia
2
167997411610361
3
4
Values collected by running java -cp build/util util.LineCount <files>
5
6
Source code for all solutions
7
https://github.com/renatoathaydes/prechelt-phone-number-encoding/tree/julia
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Comments:
29
Java 1 implements a different algorithm and hence is not directly comparable
30
Java 2 implements basic functions that could've been delegated to a widely used library like Guava, in which case its line count could go down by at least 19 LOC
31
Rust is penalized by its default formatter putting parameters on separate lines and a few local variables that cannot be avoided due to ownership rules. Still, only 6 to 10 lines could be saved sensibly.
32
Dart is hugely penalized by its default formatter forcing each switch case to be placed on new lines. If cases could be "joined", 16 lines would be saved.
33
34
35
Results after my second blog post:
36
37
Java 1Java 3LispRust v3Rust v4DartJulia
38
167112749911610361
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100